;;; common-win.el --- common part of handling window systems
-;; Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 2001-2015 Free Software Foundation, Inc.
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
;; Keywords: terminals
;; This file is part of GNU Emacs.
;;; Code:
-(defcustom x-select-enable-clipboard t
- "Non-nil means cutting and pasting uses the clipboard.
-This is in addition to, but in preference to, the primary selection.
-
-Note that MS-Windows does not support selection types other than the
-clipboard. (The primary selection that is set by Emacs is not
-accessible to other programs on MS-Windows.)
-
-This variable is not used by the Nextstep port."
- :type 'boolean
- :group 'killing
- ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not.
- :version "24.1")
-
-(defvar x-last-selected-text) ; w32-fns.el
-(declare-function w32-set-clipboard-data "w32select.c"
- (string &optional ignored))
-(defvar ns-last-selected-text) ; ns-win.el
-(declare-function ns-set-pasteboard "ns-win" (string))
-
-(defun x-select-text (text)
- "Select TEXT, a string, according to the window system.
-
-On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the
-clipboard. If `x-select-enable-primary' is non-nil, put TEXT in
-the primary selection.
-
-On MS-Windows, make TEXT the current selection. If
-`x-select-enable-clipboard' is non-nil, copy the text to the
-clipboard as well.
-
-On Nextstep, put TEXT in the pasteboard (`x-select-enable-clipboard'
-is not used)."
- (cond ((eq system-type 'windows-nt)
- (if x-select-enable-clipboard
- (w32-set-clipboard-data text))
- (setq x-last-selected-text text))
- ((featurep 'ns)
- ;; Don't send the pasteboard too much text.
- ;; It becomes slow, and if really big it causes errors.
- (ns-set-pasteboard text)
- (setq ns-last-selected-text text))
- (t
- ;; With multi-tty, this function may be called from a tty frame.
- (when (eq (framep (selected-frame)) 'x)
- (when x-select-enable-primary
- (x-set-selection 'PRIMARY text)
- (setq x-last-selected-text-primary text))
- (when x-select-enable-clipboard
- (x-set-selection 'CLIPBOARD text)
- (setq x-last-selected-text-clipboard text))))))
-
;;;; Function keys
(defvar x-alternatives-map
(set-keymap-parent map (keymap-parent local-function-key-map))
(set-keymap-parent local-function-key-map map))
(when (featurep 'ns)
- (setq interprogram-cut-function 'x-select-text
- interprogram-paste-function 'x-selection-value
- system-key-alist
+ (setq system-key-alist
(list
;; These are special "keys" used to pass events from C to lisp.
(cons (logior (lsh 0 16) 1) 'ns-power-off)
initial-frame-alist)))))
;; Make -iconic apply only to the initial frame!
-(defun x-handle-iconic (switch)
+(defun x-handle-iconic (_switch)
(setq initial-frame-alist
(cons '(visibility . icon) initial-frame-alist)))
(declare-function x-parse-geometry "frame.c" (string))
;; Handle the geometry option
-(defun x-handle-geometry (switch)
+(defun x-handle-geometry (_switch)
(let* ((geo (x-parse-geometry (pop x-invocation-args)))
(left (assq 'left geo))
(top (assq 'top geo))
On X, the display name of individual X frames is recorded in the
`display' frame parameter.")
-(defun x-handle-display (switch)
+(defun x-handle-display (_switch)
"Handle -display DISPLAY option."
(setq x-display-name (pop x-invocation-args))
;; Make subshell programs see the same DISPLAY value Emacs really uses.