aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-07-21 16:23:55 +0000
committerChong Yidong2008-07-21 16:23:55 +0000
commita5a1b4640f7efadcbfa23b48e9adfe6a90363829 (patch)
treeeb6ec394338ebeddb42af8edb5708707b90eddd7
parentbe5fbff54b308d422df9bca333d3e391df12f29e (diff)
downloademacs-a5a1b4640f7efadcbfa23b48e9adfe6a90363829.tar.gz
emacs-a5a1b4640f7efadcbfa23b48e9adfe6a90363829.zip
Standardize references to "Nextstep" in comments, messages, and docstrings.
(ns-handle-args, x-parse-geometry) (ns-extended-platform-support-mode, x-setup-function-keys) (ns-select-overlay, ns-unselect-line, ns-yes-or-no-p) (ns-set-pasteboard, ns-scroll-bar-move, ns-defined-colors) (ns-initialized, ns-initialize-window-system): Doc fixes.
-rw-r--r--lisp/term/ns-win.el117
1 files changed, 60 insertions, 57 deletions
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 908077d4c4e..7bc5a96e062 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -24,22 +24,23 @@
24 24
25;;; Commentary: 25;;; Commentary:
26 26
27;; ns-win.el: this file is loaded from ../lisp/startup.el when it recognizes 27;; ns-win.el: this file is loaded from ../lisp/startup.el when it
28;; that NS windows are to be used. Command line switches are parsed and those 28;; recognizes that Nextstep windows are to be used. Command line
29;; pertaining to NS are processed and removed from the command line. The 29;; switches are parsed and those pertaining to Nextstep are processed
30;; NS display is opened and hooks are set for popping up the initial window. 30;; and removed from the command line. The Nextstep display is opened
31;; and hooks are set for popping up the initial window.
31 32
32;; startup.el will then examine startup files, and eventually call the hooks 33;; startup.el will then examine startup files, and eventually call the hooks
33;; which create the first window (s). 34;; which create the first window (s).
34 35
35;; A number of other NS convenience functions are defined in this file, 36;; A number of other Nextstep convenience functions are defined in
36;; which works in close coordination with src/nsfns.m. 37;; this file, which works in close coordination with src/nsfns.m.
37 38
38;;; Code: 39;;; Code:
39 40
40 41
41(if (not (featurep 'ns-windowing)) 42(if (not (featurep 'ns-windowing))
42 (error "%s: Loading ns-win.el but not compiled for *Step/OS X" 43 (error "%s: Loading ns-win.el but not compiled for GNUStep/MacOS"
43 (invocation-name))) 44 (invocation-name)))
44 45
45(eval-when-compile (require 'cl)) 46(eval-when-compile (require 'cl))
@@ -98,7 +99,7 @@
98 99
99;; Set (but not used?) in frame.el. 100;; Set (but not used?) in frame.el.
100(defvar ns-display-name nil 101(defvar ns-display-name nil
101 "The name of the NS display on which Emacs was started.") 102 "The name of the Nextstep display on which Emacs was started.")
102 103
103;; nsterm.m. 104;; nsterm.m.
104(defvar ns-input-file) 105(defvar ns-input-file)
@@ -119,12 +120,12 @@
119 (setq ns-invocation-args (cddr ns-invocation-args))) 120 (setq ns-invocation-args (cddr ns-invocation-args)))
120 121
121(defun ns-handle-args (args) 122(defun ns-handle-args (args)
122 "Process NeXTSTEP-related command line options. 123 "Process Nextstep-related command line options.
123This is run before the user's startup file is loaded. 124This is run before the user's startup file is loaded.
124The options in ARGS are copied to `ns-invocation-args'. The 125The options in ARGS are copied to `ns-invocation-args'.
125NeXTSTEP-related settings are then applied using the handlers 126The Nextstep-related settings are then applied using the handlers
126defined in `command-line-ns-option-alist'. 127defined in `command-line-ns-option-alist'.
127The return value is ARGS minus the arguments processed." 128The return value is ARGS minus the number of arguments processed."
128 ;; We use ARGS to accumulate the args that we don't handle here, to return. 129 ;; We use ARGS to accumulate the args that we don't handle here, to return.
129 (setq ns-invocation-args args 130 (setq ns-invocation-args args
130 args nil) 131 args nil)
@@ -163,23 +164,22 @@ The return value is ARGS minus the arguments processed."
163 (nreverse args)) 164 (nreverse args))
164 165
165(defun x-parse-geometry (geom) 166(defun x-parse-geometry (geom)
166 "Parse an NS-style geometry string STRING. 167 "Parse a Nextstep-style geometry string STRING.
167Returns an alist of the form ((top . TOP), (left . LEFT) ... ). 168Returns an alist of the form ((top . TOP), (left . LEFT) ... ).
168The properties returned may include `top', `left', `height', and `width'." 169The properties returned may include `top', `left', `height', and `width'."
169 (if (string-match "\\([0-9]+\\)\\( \\([0-9]+\\)\\( \\([0-9]+\\)\\( \\([0-9]+\\) ?\\)?\\)?\\)?" 170 (when (string-match "\\([0-9]+\\)\\( \\([0-9]+\\)\\( \\([0-9]+\\)\
170 geom) 171\\( \\([0-9]+\\) ?\\)?\\)?\\)?"
171 (apply 'append 172 geom)
172 (list 173 (apply
173 (list (cons 'top (string-to-number (match-string 1 geom)))) 174 'append
174 (if (match-string 3 geom) 175 (list
175 (list (cons 'left (string-to-number (match-string 3 geom))))) 176 (list (cons 'top (string-to-number (match-string 1 geom))))
176 (if (match-string 5 geom) 177 (if (match-string 3 geom)
177 (list (cons 'height (string-to-number (match-string 5 geom))))) 178 (list (cons 'left (string-to-number (match-string 3 geom)))))
178 (if (match-string 7 geom) 179 (if (match-string 5 geom)
179 (list (cons 'width (string-to-number (match-string 7 geom))))))) 180 (list (cons 'height (string-to-number (match-string 5 geom)))))
180 '())) 181 (if (match-string 7 geom)
181 182 (list (cons 'width (string-to-number (match-string 7 geom)))))))))
182
183 183
184;;;; Keyboard mapping. 184;;;; Keyboard mapping.
185 185
@@ -213,7 +213,7 @@ The properties returned may include `top', `left', `height', and `width'."
213(define-key function-key-map [M-escape] [?\M-\e]) 213(define-key function-key-map [M-escape] [?\M-\e])
214 214
215 215
216;; Here are some NeXTSTEP like bindings for command key sequences. 216;; Here are some Nextstep-like bindings for command key sequences.
217(define-key global-map [?\s-,] 'ns-popup-prefs-panel) 217(define-key global-map [?\s-,] 'ns-popup-prefs-panel)
218(define-key global-map [?\s-'] 'next-multiframe-window) 218(define-key global-map [?\s-'] 'next-multiframe-window)
219(define-key global-map [?\s-`] 'other-frame) 219(define-key global-map [?\s-`] 'other-frame)
@@ -267,7 +267,7 @@ The properties returned may include `top', `left', `height', and `width'."
267(define-key global-map [kp-next] 'scroll-up) 267(define-key global-map [kp-next] 'scroll-up)
268 268
269 269
270;; Special NeXTSTEP generated events are converted to function keys. Here 270;; Special Nextstep-generated events are converted to function keys. Here
271;; are the bindings for them. 271;; are the bindings for them.
272(define-key global-map [ns-power-off] 272(define-key global-map [ns-power-off]
273 (lambda () (interactive) (save-buffers-kill-emacs t))) 273 (lambda () (interactive) (save-buffers-kill-emacs t)))
@@ -286,8 +286,8 @@ The properties returned may include `top', `left', `height', and `width'."
286 286
287 287
288;; Functions to set environment variables by running a subshell. 288;; Functions to set environment variables by running a subshell.
289;;; Idea based on NS 4.2 distribution, this version of code based on 289;;; Idea based on Nextstep 4.2 distribution, this version of code
290;;; mac-read-environment-vars-from-shell () by David Reitter. 290;;; based on mac-read-environment-vars-from-shell () by David Reitter.
291;;; Mostly used only under ns-extended-platform-support-mode. 291;;; Mostly used only under ns-extended-platform-support-mode.
292 292
293(defun ns-make-command-string (cmdlist) 293(defun ns-make-command-string (cmdlist)
@@ -332,10 +332,10 @@ this defaults to \"printenv\"."
332 332
333(defvar menu-bar-ns-file-menu) ; below 333(defvar menu-bar-ns-file-menu) ; below
334 334
335;; Toggle some additional NS-like features that may interfere with users' 335;; Toggle some additional Nextstep-like features that may interfere
336;; expectations coming from emacs on other platforms. 336;; with users' expectations coming from emacs on other platforms.
337(define-minor-mode ns-extended-platform-support-mode 337(define-minor-mode ns-extended-platform-support-mode
338 "Toggle NS extended platform support features. 338 "Toggle Nextstep extended platform support features.
339 When this mode is active (no modeline indicator): 339 When this mode is active (no modeline indicator):
340 - File menu is altered slightly in keeping with conventions. 340 - File menu is altered slightly in keeping with conventions.
341 - Meta-up, meta-down are bound to scroll window up and down one line. 341 - Meta-up, meta-down are bound to scroll window up and down one line.
@@ -355,7 +355,8 @@ this defaults to \"printenv\"."
355 (setq scroll-preserve-screen-position t) 355 (setq scroll-preserve-screen-position t)
356 (transient-mark-mode 1) 356 (transient-mark-mode 1)
357 357
358 ;; Change file menu to simplify and add a couple of NS-specific items 358 ;; Change file menu to simplify and add a couple of
359 ;; Nextstep-specific items
359 (easy-menu-remove-item global-map '("menu-bar") 'file) 360 (easy-menu-remove-item global-map '("menu-bar") 'file)
360 (easy-menu-add-item global-map '(menu-bar) 361 (easy-menu-add-item global-map '(menu-bar)
361 (cons "File" menu-bar-ns-file-menu) 'edit)) 362 (cons "File" menu-bar-ns-file-menu) 'edit))
@@ -371,7 +372,7 @@ this defaults to \"printenv\"."
371 372
372 373
373(defun x-setup-function-keys (frame) 374(defun x-setup-function-keys (frame)
374 "Set up function Keys for NS for given FRAME." 375 "Set up function Keys for Nextstep for frame FRAME."
375 (unless (terminal-parameter frame 'x-setup-function-keys) 376 (unless (terminal-parameter frame 'x-setup-function-keys)
376 (with-selected-frame frame 377 (with-selected-frame frame
377 (setq interprogram-cut-function 'ns-select-text 378 (setq interprogram-cut-function 'ns-select-text
@@ -479,7 +480,7 @@ this defaults to \"printenv\"."
479 480
480;;;; Miscellaneous mouse bindings. 481;;;; Miscellaneous mouse bindings.
481 482
482;;; Allow shift-clicks to work just like under NS 483;;; Allow shift-clicks to work just like under Nextstep
483(defun mouse-extend-region (event) 484(defun mouse-extend-region (event)
484 "Move point or mark so as to extend region. 485 "Move point or mark so as to extend region.
485This should be bound to a mouse click event type." 486This should be bound to a mouse click event type."
@@ -802,10 +803,11 @@ This should be bound to a mouse click event type."
802 803
803 804
804 805
805;;;; Composed key sequence handling for NS system input methods. 806;;;; Composed key sequence handling for Nextstep system input methods.
806;;;; (On NS systems, input methods are provided for CJK characters, 807;;;; (On Nextstep systems, input methods are provided for CJK
807;;;; etc. which require multiple keystrokes, and during entry a 808;;;; characters, etc. which require multiple keystrokes, and during
808;;;; partial ("working") result is typically shown in the editing window.) 809;;;; entry a partial ("working") result is typically shown in the
810;;;; editing window.)
809 811
810(defface ns-working-text-face 812(defface ns-working-text-face
811 '((t :underline t)) 813 '((t :underline t))
@@ -914,7 +916,7 @@ See ns-insert-working-text."
914 (set-file-name-coding-system 'utf-8-nfd))) 916 (set-file-name-coding-system 'utf-8-nfd)))
915 917
916;; PENDING: disable composition-based display for Indic scripts as it 918;; PENDING: disable composition-based display for Indic scripts as it
917;; is not working well under NS for some reason 919;; is not working well under Nextstep for some reason
918(set-char-table-range composition-function-table 920(set-char-table-range composition-function-table
919 '(#x0900 . #x0DFF) nil) 921 '(#x0900 . #x0DFF) nil)
920 922
@@ -941,7 +943,7 @@ prompting. If file is a directory perform a find-file on it."
941 (push-mark (+ (point) (car (cdr (insert-file-contents f)))))))) 943 (push-mark (+ (point) (car (cdr (insert-file-contents f))))))))
942 944
943(defvar ns-select-overlay nil 945(defvar ns-select-overlay nil
944 "Overlay used to highlight areas in files requested by NS apps.") 946 "Overlay used to highlight areas in files requested by Nextstep apps.")
945(make-variable-buffer-local 'ns-select-overlay) 947(make-variable-buffer-local 'ns-select-overlay)
946 948
947(defvar ns-input-line) ; nsterm.m 949(defvar ns-input-line) ; nsterm.m
@@ -981,7 +983,7 @@ Lines are highlighted according to `ns-input-line'."
981 (setq ns-select-overlay (delete-overlay ns-select-overlay)))))) 983 (setq ns-select-overlay (delete-overlay ns-select-overlay))))))
982 984
983(defun ns-unselect-line () 985(defun ns-unselect-line ()
984 "Removes any NS highlight a buffer may contain." 986 "Removes any Nextstep highlight a buffer may contain."
985 (if ns-select-overlay 987 (if ns-select-overlay
986 (setq ns-select-overlay (delete-overlay ns-select-overlay)))) 988 (setq ns-select-overlay (delete-overlay ns-select-overlay))))
987 989
@@ -1188,7 +1190,7 @@ unless the current buffer is a scratch buffer.")
1188 1190
1189;;;; Frame-related functions. 1191;;;; Frame-related functions.
1190 1192
1191;; Don't show the frame name; that's redundant with NS. 1193;; Don't show the frame name; that's redundant with Nextstep.
1192(setq-default mode-line-frame-identification '(" ")) 1194(setq-default mode-line-frame-identification '(" "))
1193 1195
1194;; You say tomAYto, I say tomAHto.. 1196;; You say tomAYto, I say tomAHto..
@@ -1301,7 +1303,8 @@ cursor display. On a text-only terminal, this is not implemented."
1301 (print-buffer))) 1303 (print-buffer)))
1302 1304
1303(defun ns-yes-or-no-p (prompt) 1305(defun ns-yes-or-no-p (prompt)
1304 "As yes-or-no-p except that NS panel always used for querying." 1306 "Ask user a \"yes or no\" question using a Nextstep graphical panel.
1307PROMPT is the prompt string."
1305 (interactive) 1308 (interactive)
1306 (setq last-nonmenu-event nil) 1309 (setq last-nonmenu-event nil)
1307 (yes-or-no-p prompt)) 1310 (yes-or-no-p prompt))
@@ -1377,7 +1380,7 @@ See the documentation of `create-fontset-from-fontset-spec for the format.")
1377(declare-function ns-store-cut-buffer-internal "nsselect.m" (buffer string)) 1380(declare-function ns-store-cut-buffer-internal "nsselect.m" (buffer string))
1378 1381
1379(defun ns-set-pasteboard (string) 1382(defun ns-set-pasteboard (string)
1380 "Store STRING into the NS server's pasteboard." 1383 "Store STRING into the pasteboard of the Nextstep display server."
1381 ;; Check the data type of STRING. 1384 ;; Check the data type of STRING.
1382 (if (not (stringp string)) (error "Nonstring given to pasteboard")) 1385 (if (not (stringp string)) (error "Nonstring given to pasteboard"))
1383 (ns-store-cut-buffer-internal 'PRIMARY string)) 1386 (ns-store-cut-buffer-internal 'PRIMARY string))
@@ -1394,9 +1397,9 @@ See the documentation of `create-fontset-from-fontset-spec for the format.")
1394 (ns-set-pasteboard text) 1397 (ns-set-pasteboard text)
1395 (setq ns-last-selected-text text)) 1398 (setq ns-last-selected-text text))
1396 1399
1397;; Return the value of the current NS selection. For compatibility 1400;; Return the value of the current Nextstep selection. For
1398;; with older NS applications, this checks cut buffer 0 before 1401;; compatibility with older Nextstep applications, this checks cut
1399;; retrieving the value of the primary selection. 1402;; buffer 0 before retrieving the value of the primary selection.
1400(defun ns-pasteboard-value () 1403(defun ns-pasteboard-value ()
1401 (let (text) 1404 (let (text)
1402 1405
@@ -1446,7 +1449,7 @@ See the documentation of `create-fontset-from-fontset-spec for the format.")
1446(global-unset-key [vertical-scroll-bar drag-mouse-1]) 1449(global-unset-key [vertical-scroll-bar drag-mouse-1])
1447 1450
1448(defun ns-scroll-bar-move (event) 1451(defun ns-scroll-bar-move (event)
1449 "Scroll the frame according to an NS scroller event." 1452 "Scroll the frame according to an Nextstep scroller event."
1450 (interactive "e") 1453 (interactive "e")
1451 (let* ((pos (event-end event)) 1454 (let* ((pos (event-end event))
1452 (window (nth 0 pos)) 1455 (window (nth 0 pos))
@@ -1508,7 +1511,7 @@ See the documentation of `create-fontset-from-fontset-spec for the format.")
1508(defun ns-defined-colors (&optional frame) 1511(defun ns-defined-colors (&optional frame)
1509 "Return a list of colors supported for a particular frame. 1512 "Return a list of colors supported for a particular frame.
1510The argument FRAME specifies which frame to try. 1513The argument FRAME specifies which frame to try.
1511The value may be different for frames on different NS displays." 1514The value may be different for frames on different Nextstep displays."
1512 (or frame (setq frame (selected-frame))) 1515 (or frame (setq frame (selected-frame)))
1513 (let ((all-colors x-colors) 1516 (let ((all-colors x-colors)
1514 (this-color nil) 1517 (this-color nil)
@@ -1615,7 +1618,7 @@ Note, tranparency works better on Tiger (10.4) and higher."
1615(defalias 'x-display-screens 'ns-display-screens) 1618(defalias 'x-display-screens 'ns-display-screens)
1616(defalias 'x-focus-frame 'ns-focus-frame) 1619(defalias 'x-focus-frame 'ns-focus-frame)
1617 1620
1618;; Set some options to be as NS-like as possible. 1621;; Set some options to be as Nextstep-like as possible.
1619(setq frame-title-format t 1622(setq frame-title-format t
1620 icon-title-format t) 1623 icon-title-format t)
1621 1624
@@ -1630,17 +1633,17 @@ Note, tranparency works better on Tiger (10.4) and higher."
1630 1633
1631 1634
1632(defvar ns-initialized nil 1635(defvar ns-initialized nil
1633 "Non-nil if NS windowing has been initialized.") 1636 "Non-nil if Nextstep windowing has been initialized.")
1634 1637
1635(declare-function ns-open-connection "nsfns.m" 1638(declare-function ns-open-connection "nsfns.m"
1636 (display &optional resource_string must_succeed)) 1639 (display &optional resource_string must_succeed))
1637 1640
1638(declare-function ns-list-services "nsfns.m" ()) 1641(declare-function ns-list-services "nsfns.m" ())
1639 1642
1640;; Do the actual NS Windows setup here; the above code just defines 1643;; Do the actual Nextstep Windows setup here; the above code just
1641;; functions and variables that we use now. 1644;; defines functions and variables that we use now.
1642(defun ns-initialize-window-system () 1645(defun ns-initialize-window-system ()
1643 "Initialize Emacs for NS (Cocoa / GNUstep) windowing." 1646 "Initialize Emacs for Nextstep (Cocoa / GNUstep) windowing."
1644 1647
1645 ;; PENDING: not needed? 1648 ;; PENDING: not needed?
1646 (setq command-line-args (ns-handle-args command-line-args)) 1649 (setq command-line-args (ns-handle-args command-line-args))