Commit 3ef041ae authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/term/w32-win.el: Move all code from 32-common-fns.el here.

(gui-select-text, gui-selection-value): Use w32 handlers in the w32
console as well.
* lisp/w32-common-fns.el: Remove.
* lisp/loadup.el: Don't load w32-common-fns.el.
* w32-fns.elc: Don't require w32-common-fns.
* src/lisp.mk (lisp): Remove w32-common-fns.elc.

Fixes: debbugs:18629
parent 71785ae7
2014-10-06 Stefan Monnier <monnier@iro.umontreal.ca>
 
* term/w32-win.el: Move all code from 32-common-fns.el here.
(gui-select-text, gui-selection-value): Use w32 handlers in the w32
console as well (bug#18629).
* w32-common-fns.el: Remove.
* loadup.el: Don't load w32-common-fns.el.
* w32-fns.elc: Don't require w32-common-fns.
* icomplete.el: Move Iswitchb autoload here. Much simpler.
* obsolete/iswitchb.el (iswitchb-mode): Use normal autoload cookie.
Remove redundant obsolescence thingy.
* loadup.el: Don't load obsolete/loaddefs.el.
* icomplete.el: Move Iswitchb autoload here. Much simpler.
* Makefile.in (obsolete-autoloads): Remove.
(AUTOGENEL): Remove obsolete/loaddefs.el.
 
......
......@@ -252,7 +252,6 @@
(load "w32-vars")
(load "term/w32-win")
(load "disp-table")
(load "w32-common-fns")
(when (eq system-type 'windows-nt)
(load "w32-fns")
(load "ls-lisp")
......
......@@ -376,12 +376,69 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(gui-method-define window-system-initialization w32
#'w32-initialize-window-system)
;;;; Selections
(declare-function w32-set-clipboard-data "w32select.c"
(string &optional ignored))
(gui-method-define gui-select-text w32
(lambda (text)
(if gui-select-enable-clipboard
(w32-set-clipboard-data text))))
(declare-function w32-get-clipboard-data "w32select.c")
(defun w32--select-text (text)
(if gui-select-enable-clipboard (w32-set-clipboard-data text)))
(defun w32--get-selection-value ()
"Return the value of the current selection.
Consult the selection. Treat empty strings as if they were unset."
(if gui-select-enable-clipboard
;; Don't die if x-get-selection signals an error.
(with-demoted-errors "w32-get-clipboard-data:%S"
(w32-get-clipboard-data))))
;; Arrange for the kill and yank functions to set and check the clipboard.
(gui-method-define gui-select-text w32 #'w32--select-text)
(gui-method-define gui-selection-value w32 #'w32--get-selection-value)
(when (eq system-type 'windows-nt)
;; Make copy&pasting in w32's console interact with the system's clipboard!
(gui-method-define gui-select-text t #'w32--select-text)
(gui-method-define gui-selection-value t #'w32--get-selection-value))
;;; Fix interface to (X-specific) mouse.el
(gui-method-define gui-own-selection w32
(lambda (type value)
(put 'x-selections (or type 'PRIMARY) data)))
(gui-method-define gui-disown-selection w32
(lambda (type)
(put 'x-selections (or type 'PRIMARY) nil)))
(gui-method-define gui-get-selection w32
(lambda (&optional type _data-type)
(get 'x-selections (or type 'PRIMARY))))
;; gui-selection-owner-p is used in simple.el
(gui-method-define gui-selection-owner-p w32
(lambda (selection)
(and (memq selection '(nil PRIMARY SECONDARY))
(get 'x-selections (or selection 'PRIMARY)))))
;; The "Windows" keys on newer keyboards bring up the Start menu
;; whether you want it or not - make Emacs ignore these keystrokes
;; rather than beep.
(global-set-key [lwindow] 'ignore)
(global-set-key [rwindow] 'ignore)
(declare-function x-server-version "w32fns.c" (&optional terminal))
(defun w32-version ()
"Return the MS-Windows version numbers.
The value is a list of three integers: the major and minor version
numbers, and the build number."
(x-server-version))
(defun w32-using-nt ()
"Return non-nil if running on a Windows NT descendant.
That includes all Windows systems except for 9X/Me."
(getenv "SystemRoot"))
(provide 'w32-win)
......
;;; w32-common-fns.el --- Lisp routines for Windows and Cygwin-w32
;; Copyright (C) 1994, 2001-2014 Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;;
;;; This file contains functions that are used by both native NT Emacs
;;; and Cygwin Emacs compiled to use the native Windows widget
;;; library.
(declare-function x-server-version "w32fns.c" (&optional terminal))
(defun w32-version ()
"Return the MS-Windows version numbers.
The value is a list of three integers: the major and minor version
numbers, and the build number."
(x-server-version))
(defun w32-using-nt ()
"Return non-nil if running on a Windows NT descendant.
That includes all Windows systems except for 9X/Me."
(getenv "SystemRoot"))
(declare-function w32-get-clipboard-data "w32select.c")
(declare-function w32-set-clipboard-data "w32select.c")
(declare-function x-server-version "w32fns.c" (&optional display))
;;; Fix interface to (X-specific) mouse.el
(gui-method-define gui-own-selection w32
(lambda (type value)
(put 'x-selections (or type 'PRIMARY) data)))
(gui-method-define gui-disown-selection w32
(lambda (type &optional _time-object _frame)
(put 'x-selections (or type 'PRIMARY) nil)))
(gui-method-define gui-get-selection w32
(lambda (&optional type _data-type)
(get 'x-selections (or type 'PRIMARY))))
;; gui-selection-owner-p is used in simple.el
(gui-method-define gui-selection-owner-p w32
(lambda (selection)
(and (memq selection '(nil PRIMARY SECONDARY))
(get 'x-selections (or selection 'PRIMARY)))))
;; The "Windows" keys on newer keyboards bring up the Start menu
;; whether you want it or not - make Emacs ignore these keystrokes
;; rather than beep.
(global-set-key [lwindow] 'ignore)
(global-set-key [rwindow] 'ignore)
(defvar w32-charset-info-alist) ; w32font.c
;;;; Selections
(defun w32-get-selection-value ()
"Return the value of the current selection.
Consult the selection. Treat empty strings as if they were unset."
(if gui-select-enable-clipboard
;; Don't die if x-get-selection signals an error.
(with-demoted-errors "w32-get-clipboard-data:%S"
(w32-get-clipboard-data))))
;; Arrange for the kill and yank functions to set and check the clipboard.
(gui-method-define gui-selection-value w32 #'w32-get-selection-value)
(provide 'w32-common-fns)
......@@ -26,7 +26,6 @@
;;; Code:
(require 'w32-vars)
(require 'w32-common-fns)
(defvar explicit-shell-file-name)
......
2014-10-06 Stefan Monnier <monnier@iro.umontreal.ca>
* lisp.mk (lisp): Remove w32-common-fns.elc.
2014-10-05 Paul Eggert <eggert@cs.ucla.edu>
 
* keyboard.c (Qleft, Qright): Remove duplicate definitions (Bug#9927).
......@@ -20,10 +24,9 @@
(ns_draw_window_cursor): Adjust y for hbar cursor only if smaller than
line height (Bug#17977).
 
* macfont.m: Fix indentation and import changes from macport
24.3.94.
* macfont.m: Fix indentation and import changes from macport 24.3.94.
(macfont_closest_traits_index): New function.
(macfont_closest_traits_index_p): Renamed from
(macfont_closest_traits_index_p): Rename from
macfont_closest_traits_index.
(macfont_list): Use macfont_closest_traits_index_p.
 
......@@ -40,8 +43,8 @@
 
2014-10-04 Martin Rudalics <rudalics@gmx.at>
 
* buffer.c (scroll_bar_width, scroll_bar_height): Fix
doc-strings.
* buffer.c (scroll_bar_width, scroll_bar_height):
Fix doc-strings.
* window.c (Fset_window_scroll_bars): Fix doc-string.
(Fwindow_scroll_bars): Have it return what the doc-string says.
 
......@@ -144,8 +147,8 @@
values.
(my_create_window): Move the calculation of the coordinates of the
frame's top-left edge here. Pass them to the input thread via the
second parameter of the WM_EMACS_CREATEWINDOW message. See
http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00892.html
second parameter of the WM_EMACS_CREATEWINDOW message.
See http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00892.html
for the details.
 
2014-09-30 Eli Zaretskii <eliz@gnu.org>
......@@ -156,8 +159,8 @@
obey it if the glyph row showing point will be fully visible.
Likewise when the window start is in a continuation line. If,
after trying everything under the 'force_start' label, point is
still not fully visible, give up and scroll the window. Add
debugging traces. (Bug#18545)
still not fully visible, give up and scroll the window.
Add debugging traces. (Bug#18545)
 
* window.c (Frecenter): Set the window's redisplay flag.
 
......
......@@ -153,7 +153,6 @@ lisp = \
$(lispsource)/term/w32-win.elc \
$(lispsource)/ls-lisp.elc \
$(lispsource)/disp-table.elc \
$(lispsource)/w32-common-fns.elc \
$(lispsource)/dos-w32.elc \
$(lispsource)/w32-fns.elc \
$(lispsource)/dos-fns.elc \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment