diff options
| author | Stefan Monnier | 2014-10-22 21:38:59 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-10-22 21:38:59 -0400 |
| commit | d361bcfbc7a69737ccd383e127fc8744c80cf5b4 (patch) | |
| tree | 0a900898735e6daefe02ead8f846fe1c37f3539a /lisp/term | |
| parent | 6a7884caf2a6f4a7fb7faa9ba275163d40f6bd96 (diff) | |
| download | emacs-d361bcfbc7a69737ccd383e127fc8744c80cf5b4.tar.gz emacs-d361bcfbc7a69737ccd383e127fc8744c80cf5b4.zip | |
* lisp/select.el: Use lexical-binding.
(gui-set-selection): Provide an implementation for non-GUI frames.
* lisp/term/x-win.el: Use lexical-binding.
(x-clipboard-yank): Fix up missed renamings.
* lisp/term/w32-win.el (libgif-version, libjpeg-version): Silence compiler.
(w32--set-selection): Fix up var names.
* lisp/term/pc-win.el: Use lexical-binding.
(w16-selection-exists-p): Silence compiler warning.
(w16-selection-owner-p): Fix up missed renamings.
* lisp/emacs-lisp/bytecomp.el (byte-compile-form): Remove left-over debug.
* lisp/frame.el (frame-notice-user-settings): Fix excessive quoting.
Fixes: debbugs:18791
Diffstat (limited to 'lisp/term')
| -rw-r--r-- | lisp/term/pc-win.el | 38 | ||||
| -rw-r--r-- | lisp/term/w32-win.el | 7 | ||||
| -rw-r--r-- | lisp/term/x-win.el | 6 |
3 files changed, 27 insertions, 24 deletions
diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el index b224d6820f9..90eb14aab25 100644 --- a/lisp/term/pc-win.el +++ b/lisp/term/pc-win.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; pc-win.el --- setup support for `PC windows' (whatever that is) | 1 | ;;; pc-win.el --- setup support for `PC windows' (whatever that is) -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1994, 1996-1997, 1999, 2001-2014 Free Software | 3 | ;; Copyright (C) 1994, 1996-1997, 1999, 2001-2014 Free Software |
| 4 | ;; Foundation, Inc. | 4 | ;; Foundation, Inc. |
| @@ -45,20 +45,20 @@ | |||
| 45 | (declare-function w16-get-clipboard-data "w16select.c") | 45 | (declare-function w16-get-clipboard-data "w16select.c") |
| 46 | (declare-function msdos-setup-keyboard "internal" (frame)) | 46 | (declare-function msdos-setup-keyboard "internal" (frame)) |
| 47 | 47 | ||
| 48 | ;;; This was copied from etc/rgb.txt, except that some values were changed | 48 | ;; This was copied from etc/rgb.txt, except that some values were changed |
| 49 | ;;; a bit to make them consistent with DOS console colors, and the RGB | 49 | ;; a bit to make them consistent with DOS console colors, and the RGB |
| 50 | ;;; values were scaled up to 16 bits, as `tty-define-color' requires. | 50 | ;; values were scaled up to 16 bits, as `tty-define-color' requires. |
| 51 | ;;; | 51 | ;;; |
| 52 | ;;; The mapping between the 16 standard EGA/VGA colors and X color names | 52 | ;; The mapping between the 16 standard EGA/VGA colors and X color names |
| 53 | ;;; was done by running a Unix version of Emacs inside an X client and a | 53 | ;; was done by running a Unix version of Emacs inside an X client and a |
| 54 | ;;; DJGPP-compiled Emacs on the same PC. The names of X colors used to | 54 | ;; DJGPP-compiled Emacs on the same PC. The names of X colors used to |
| 55 | ;;; define the pixel values are shown as comments to each color below. | 55 | ;; define the pixel values are shown as comments to each color below. |
| 56 | ;;; | 56 | ;;; |
| 57 | ;;; If you want to change the RGB values, keep in mind that various pieces | 57 | ;; If you want to change the RGB values, keep in mind that various pieces |
| 58 | ;;; of Emacs think that a color whose RGB values add up to less than 0.6 of | 58 | ;; of Emacs think that a color whose RGB values add up to less than 0.6 of |
| 59 | ;;; the values for WHITE (i.e. less than 117963) are ``dark'', otherwise the | 59 | ;; the values for WHITE (i.e. less than 117963) are ``dark'', otherwise the |
| 60 | ;;; color is ``light''; see `frame-set-background-mode' in lisp/faces.el for | 60 | ;; color is ``light''; see `frame-set-background-mode' in lisp/faces.el for |
| 61 | ;;; an example. | 61 | ;; an example. |
| 62 | (defvar msdos-color-values | 62 | (defvar msdos-color-values |
| 63 | '(("black" 0 0 0 0) | 63 | '(("black" 0 0 0 0) |
| 64 | ("blue" 1 0 0 52480) ; MediumBlue | 64 | ("blue" 1 0 0 52480) ; MediumBlue |
| @@ -226,15 +226,17 @@ Consult the selection. Treat empty strings as if they were unset." | |||
| 226 | (with-demoted-errors "w16-get-clipboard-data:%s" | 226 | (with-demoted-errors "w16-get-clipboard-data:%s" |
| 227 | (w16-get-clipboard-data))) | 227 | (w16-get-clipboard-data))) |
| 228 | 228 | ||
| 229 | (declare-function w16-selection-exists-p "w16select.c") | ||
| 229 | ;; gui-selection-owner-p is used in simple.el. | 230 | ;; gui-selection-owner-p is used in simple.el. |
| 230 | (gui-method-define gui-selection-exists-p pc #'w16-selection-exists-p) | 231 | (gui-method-define gui-selection-exists-p pc #'w16-selection-exists-p) |
| 231 | (gui-method-define gui-selection-owner-p pc #'w16-selection-owner-p) | 232 | (gui-method-define gui-selection-owner-p pc #'w16-selection-owner-p) |
| 233 | |||
| 232 | (defun w16-selection-owner-p (_selection) | 234 | (defun w16-selection-owner-p (_selection) |
| 233 | ;; FIXME: Other systems don't obey gui-select-enable-clipboard here. | 235 | ;; FIXME: Other systems don't obey select-enable-clipboard here. |
| 234 | (if gui-select-enable-clipboard | 236 | (if select-enable-clipboard |
| 235 | (let ((text | 237 | (let ((text |
| 236 | ;; Don't die if w16-get-clipboard-data signals an error. | 238 | ;; Don't die if w16-get-clipboard-data signals an error. |
| 237 | (ignore-errors | 239 | (with-demoted-errors "w16-get-clipboard-data: %S" |
| 238 | (w16-get-clipboard-data)))) | 240 | (w16-get-clipboard-data)))) |
| 239 | ;; We consider ourselves the owner of the selection | 241 | ;; We consider ourselves the owner of the selection |
| 240 | ;; if it does not exist, or exists and compares | 242 | ;; if it does not exist, or exists and compares |
| @@ -242,9 +244,7 @@ Consult the selection. Treat empty strings as if they were unset." | |||
| 242 | ;; Windows clipboard. | 244 | ;; Windows clipboard. |
| 243 | (cond | 245 | (cond |
| 244 | ((not text) t) | 246 | ((not text) t) |
| 245 | ((or (eq text gui-last-selected-text) | 247 | ((equal text gui--last-selected-text-clipboard) text) |
| 246 | (string= text gui-last-selected-text)) | ||
| 247 | text) | ||
| 248 | (t nil))))) | 248 | (t nil))))) |
| 249 | 249 | ||
| 250 | ;; gui-set-selection is used in gui-set-selection. | 250 | ;; gui-set-selection is used in gui-set-selection. |
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 063acd7e8bb..bb9a7e481a2 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el | |||
| @@ -211,6 +211,8 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") | |||
| 211 | 211 | ||
| 212 | (defvar dynamic-library-alist) | 212 | (defvar dynamic-library-alist) |
| 213 | (defvar libpng-version) ; image.c #ifdef HAVE_NTGUI | 213 | (defvar libpng-version) ; image.c #ifdef HAVE_NTGUI |
| 214 | (defvar libgif-version) | ||
| 215 | (defvar libjpeg-version) | ||
| 214 | 216 | ||
| 215 | ;;; Set default known names for external libraries | 217 | ;;; Set default known names for external libraries |
| 216 | (setq dynamic-library-alist | 218 | (setq dynamic-library-alist |
| @@ -381,12 +383,13 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") | |||
| 381 | (declare-function w32-set-clipboard-data "w32select.c" | 383 | (declare-function w32-set-clipboard-data "w32select.c" |
| 382 | (string &optional ignored)) | 384 | (string &optional ignored)) |
| 383 | (declare-function w32-get-clipboard-data "w32select.c") | 385 | (declare-function w32-get-clipboard-data "w32select.c") |
| 386 | (declare-function w32-selection-exists-p "w32select.c") | ||
| 384 | 387 | ||
| 385 | ;;; Fix interface to (X-specific) mouse.el | 388 | ;;; Fix interface to (X-specific) mouse.el |
| 386 | (defun w32--set-selection (type value) | 389 | (defun w32--set-selection (type value) |
| 387 | (if (eq type 'CLIPBOARD) | 390 | (if (eq type 'CLIPBOARD) |
| 388 | (w32-set-clipboard-data text) | 391 | (w32-set-clipboard-data value) |
| 389 | (put 'x-selections (or type 'PRIMARY) data))) | 392 | (put 'x-selections (or type 'PRIMARY) value))) |
| 390 | 393 | ||
| 391 | (defun w32--get-selection (&optional type data-type) | 394 | (defun w32--get-selection (&optional type data-type) |
| 392 | (if (and (eq type 'CLIPBOARD) | 395 | (if (and (eq type 'CLIPBOARD) |
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index ebc34d3fdd6..a54846c7d7c 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; x-win.el --- parse relevant switches and set up for X -*-coding: iso-2022-7bit;-*- | 1 | ;;; x-win.el --- parse relevant switches and set up for X -*-coding: iso-2022-7bit; lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1993-1994, 2001-2014 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1993-1994, 2001-2014 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -1163,8 +1163,8 @@ as returned by `x-server-vendor'." | |||
| 1163 | "Insert the clipboard contents, or the last stretch of killed text." | 1163 | "Insert the clipboard contents, or the last stretch of killed text." |
| 1164 | (declare (obsolete clipboard-yank "25.1")) | 1164 | (declare (obsolete clipboard-yank "25.1")) |
| 1165 | (interactive "*") | 1165 | (interactive "*") |
| 1166 | (let ((clipboard-text (x-selection-value-internal 'CLIPBOARD)) | 1166 | (let ((clipboard-text (gui--selection-value-internal 'CLIPBOARD)) |
| 1167 | (x-select-enable-clipboard t)) | 1167 | (select-enable-clipboard t)) |
| 1168 | (if (and clipboard-text (> (length clipboard-text) 0)) | 1168 | (if (and clipboard-text (> (length clipboard-text) 0)) |
| 1169 | (kill-new clipboard-text)) | 1169 | (kill-new clipboard-text)) |
| 1170 | (yank))) | 1170 | (yank))) |