aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Pluim2024-12-10 09:42:11 +0100
committerRobert Pluim2024-12-10 16:03:39 +0100
commitebd8feef1491907ebf4648a3aa38ddaa7fbf1dd2 (patch)
treece46d0c94fe811da37367792a8e1965cbe1f29d4
parentbe51f13491ddb5eb4f281a79fa7e76ef30147cb1 (diff)
downloademacs-ebd8feef1491907ebf4648a3aa38ddaa7fbf1dd2.tar.gz
emacs-ebd8feef1491907ebf4648a3aa38ddaa7fbf1dd2.zip
Move ns-specific event setup to term/ns-win.el (Bug#74619)
* lisp/term/ns-win.el (ns-setup-special-keys): New function, contains event setup code previously in term/common-win.el. Call it at top-level. * lisp/term/common-win.el (x-setup-function-keys): Call 'ns-setup-special-keys'.
-rw-r--r--lisp/term/common-win.el19
-rw-r--r--lisp/term/ns-win.el21
2 files changed, 24 insertions, 16 deletions
diff --git a/lisp/term/common-win.el b/lisp/term/common-win.el
index 181dcc8e6d9..68c3b2d56e3 100644
--- a/lisp/term/common-win.el
+++ b/lisp/term/common-win.el
@@ -45,6 +45,8 @@
45 map) 45 map)
46 "Keymap of possible alternative meanings for some keys.") 46 "Keymap of possible alternative meanings for some keys.")
47 47
48(declare-function ns-setup-special-keys "term/ns-win" ())
49
48(defun x-setup-function-keys (frame) 50(defun x-setup-function-keys (frame)
49 "Set up `function-key-map' on the graphical frame FRAME." 51 "Set up `function-key-map' on the graphical frame FRAME."
50 ;; Don't do this twice on the same display, or it would break 52 ;; Don't do this twice on the same display, or it would break
@@ -56,22 +58,7 @@
56 (set-keymap-parent map (keymap-parent local-function-key-map)) 58 (set-keymap-parent map (keymap-parent local-function-key-map))
57 (set-keymap-parent local-function-key-map map)) 59 (set-keymap-parent local-function-key-map map))
58 (when (featurep 'ns) 60 (when (featurep 'ns)
59 (setq system-key-alist 61 (ns-setup-special-keys)))
60 (list
61 ;; These are special "keys" used to pass events from C to lisp.
62 (cons 1 (make-non-key-event 'ns-power-off))
63 (cons 2 (make-non-key-event 'ns-open-file))
64 (cons 3 (make-non-key-event 'ns-open-temp-file))
65 (cons 4 (make-non-key-event 'ns-drag-file))
66 (cons 5 (make-non-key-event 'ns-drag-color))
67 (cons 6 (make-non-key-event 'ns-drag-text))
68 (cons 8 (make-non-key-event 'ns-open-file-line))
69;;; (cons 9 (make-non-key-event 'ns-insert-working-text))
70;;; (cons 10 (make-non-key-event 'ns-delete-working-text))
71 (cons 11 (make-non-key-event 'ns-spi-service-call))
72 (cons 12 (make-non-key-event 'ns-new-frame))
73 (cons 13 (make-non-key-event 'ns-toggle-toolbar))
74 (cons 14 (make-non-key-event 'ns-show-prefs))))))
75 (set-terminal-parameter frame 'x-setup-function-keys t))) 62 (set-terminal-parameter frame 'x-setup-function-keys t)))
76 63
77(defvar x-invocation-args) 64(defvar x-invocation-args)
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 2a29457133e..2188aa67e54 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -168,6 +168,27 @@ The properties returned may include `top', `left', `height', and `width'."
168(define-key global-map [S-mouse-1] 'mouse-save-then-kill) 168(define-key global-map [S-mouse-1] 'mouse-save-then-kill)
169(global-unset-key [S-down-mouse-1]) 169(global-unset-key [S-down-mouse-1])
170 170
171;; Moved here from common-win.el because they need to work in a -nw
172;; invocation of a (featurep 'ns) => true build (Bug#74619).
173(defun ns-setup-special-keys ()
174 (setq system-key-alist
175 (list
176 ;; These are special "keys" used to pass events from C to lisp.
177 (cons 1 (make-non-key-event 'ns-power-off))
178 (cons 2 (make-non-key-event 'ns-open-file))
179 (cons 3 (make-non-key-event 'ns-open-temp-file))
180 (cons 4 (make-non-key-event 'ns-drag-file))
181 (cons 5 (make-non-key-event 'ns-drag-color))
182 (cons 6 (make-non-key-event 'ns-drag-text))
183 (cons 8 (make-non-key-event 'ns-open-file-line))
184;;; (cons 9 (make-non-key-event 'ns-insert-working-text))
185;;; (cons 10 (make-non-key-event 'ns-delete-working-text))
186 (cons 11 (make-non-key-event 'ns-spi-service-call))
187 (cons 12 (make-non-key-event 'ns-new-frame))
188 (cons 13 (make-non-key-event 'ns-toggle-toolbar))
189 (cons 14 (make-non-key-event 'ns-show-prefs)))))
190(ns-setup-special-keys)
191
171;; Special Nextstep-generated events are converted to function keys. Here 192;; Special Nextstep-generated events are converted to function keys. Here
172;; are the bindings for them. Note, these keys are actually declared in 193;; are the bindings for them. Note, these keys are actually declared in
173;; x-setup-function-keys in common-win. 194;; x-setup-function-keys in common-win.