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> 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. * obsolete/iswitchb.el (iswitchb-mode): Use normal autoload cookie.
Remove redundant obsolescence thingy. Remove redundant obsolescence thingy.
* loadup.el: Don't load obsolete/loaddefs.el. * loadup.el: Don't load obsolete/loaddefs.el.
* icomplete.el: Move Iswitchb autoload here. Much simpler.
* Makefile.in (obsolete-autoloads): Remove. * Makefile.in (obsolete-autoloads): Remove.
(AUTOGENEL): Remove obsolete/loaddefs.el. (AUTOGENEL): Remove obsolete/loaddefs.el.
   
......
...@@ -252,7 +252,6 @@ ...@@ -252,7 +252,6 @@
(load "w32-vars") (load "w32-vars")
(load "term/w32-win") (load "term/w32-win")
(load "disp-table") (load "disp-table")
(load "w32-common-fns")
(when (eq system-type 'windows-nt) (when (eq system-type 'windows-nt)
(load "w32-fns") (load "w32-fns")
(load "ls-lisp") (load "ls-lisp")
......
...@@ -376,12 +376,69 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") ...@@ -376,12 +376,69 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(gui-method-define window-system-initialization w32 (gui-method-define window-system-initialization w32
#'w32-initialize-window-system) #'w32-initialize-window-system)
;;;; Selections
(declare-function w32-set-clipboard-data "w32select.c" (declare-function w32-set-clipboard-data "w32select.c"
(string &optional ignored)) (string &optional ignored))
(gui-method-define gui-select-text w32 (declare-function w32-get-clipboard-data "w32select.c")
(lambda (text)
(if gui-select-enable-clipboard (defun w32--select-text (text)
(w32-set-clipboard-data 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) (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 @@ ...@@ -26,7 +26,6 @@
;;; Code: ;;; Code:
(require 'w32-vars) (require 'w32-vars)
(require 'w32-common-fns)
(defvar explicit-shell-file-name) (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> 2014-10-05 Paul Eggert <eggert@cs.ucla.edu>
   
* keyboard.c (Qleft, Qright): Remove duplicate definitions (Bug#9927). * keyboard.c (Qleft, Qright): Remove duplicate definitions (Bug#9927).
...@@ -20,10 +24,9 @@ ...@@ -20,10 +24,9 @@
(ns_draw_window_cursor): Adjust y for hbar cursor only if smaller than (ns_draw_window_cursor): Adjust y for hbar cursor only if smaller than
line height (Bug#17977). line height (Bug#17977).
   
* macfont.m: Fix indentation and import changes from macport * macfont.m: Fix indentation and import changes from macport 24.3.94.
24.3.94.
(macfont_closest_traits_index): New function. (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_closest_traits_index.
(macfont_list): Use macfont_closest_traits_index_p. (macfont_list): Use macfont_closest_traits_index_p.
   
...@@ -40,8 +43,8 @@ ...@@ -40,8 +43,8 @@
   
2014-10-04 Martin Rudalics <rudalics@gmx.at> 2014-10-04 Martin Rudalics <rudalics@gmx.at>
   
* buffer.c (scroll_bar_width, scroll_bar_height): Fix * buffer.c (scroll_bar_width, scroll_bar_height):
doc-strings. Fix doc-strings.
* window.c (Fset_window_scroll_bars): Fix doc-string. * window.c (Fset_window_scroll_bars): Fix doc-string.
(Fwindow_scroll_bars): Have it return what the doc-string says. (Fwindow_scroll_bars): Have it return what the doc-string says.
   
...@@ -144,8 +147,8 @@ ...@@ -144,8 +147,8 @@
values. values.
(my_create_window): Move the calculation of the coordinates of the (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 frame's top-left edge here. Pass them to the input thread via the
second parameter of the WM_EMACS_CREATEWINDOW message. See second parameter of the WM_EMACS_CREATEWINDOW message.
http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00892.html See http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00892.html
for the details. for the details.
   
2014-09-30 Eli Zaretskii <eliz@gnu.org> 2014-09-30 Eli Zaretskii <eliz@gnu.org>
...@@ -156,8 +159,8 @@ ...@@ -156,8 +159,8 @@
obey it if the glyph row showing point will be fully visible. obey it if the glyph row showing point will be fully visible.
Likewise when the window start is in a continuation line. If, Likewise when the window start is in a continuation line. If,
after trying everything under the 'force_start' label, point is after trying everything under the 'force_start' label, point is
still not fully visible, give up and scroll the window. Add still not fully visible, give up and scroll the window.
debugging traces. (Bug#18545) Add debugging traces. (Bug#18545)
   
* window.c (Frecenter): Set the window's redisplay flag. * window.c (Frecenter): Set the window's redisplay flag.
   
......
...@@ -153,7 +153,6 @@ lisp = \ ...@@ -153,7 +153,6 @@ lisp = \
$(lispsource)/term/w32-win.elc \ $(lispsource)/term/w32-win.elc \
$(lispsource)/ls-lisp.elc \ $(lispsource)/ls-lisp.elc \
$(lispsource)/disp-table.elc \ $(lispsource)/disp-table.elc \
$(lispsource)/w32-common-fns.elc \
$(lispsource)/dos-w32.elc \ $(lispsource)/dos-w32.elc \
$(lispsource)/w32-fns.elc \ $(lispsource)/w32-fns.elc \
$(lispsource)/dos-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