aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/term
diff options
context:
space:
mode:
authorGlenn Morris2010-10-26 20:48:28 -0700
committerGlenn Morris2010-10-26 20:48:28 -0700
commite925113b0c29b8bf2b2a67b5c88ce812fcfa1ede (patch)
treefd91af8539281a38e5ca46f686c17bc3362b09c9 /lisp/term
parente617ab0651ea5bfb03692eac5976c7e61257aa6b (diff)
downloademacs-e925113b0c29b8bf2b2a67b5c88ce812fcfa1ede.tar.gz
emacs-e925113b0c29b8bf2b2a67b5c88ce812fcfa1ede.zip
* lisp/term/ns-win.el: Restore require of cl when compiling.
(menu-bar-final-items): Remove non-existent `windows' menu.
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/ns-win.el70
1 files changed, 27 insertions, 43 deletions
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index cfed4903cb1..a70def2fa5e 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -41,11 +41,12 @@
41 41
42;;; Code: 42;;; Code:
43 43
44
45(or (featurep 'ns) 44(or (featurep 'ns)
46 (error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS" 45 (error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS"
47 (invocation-name))) 46 (invocation-name)))
48 47
48(eval-when-compile (require 'cl)) ; lexical-let
49
49;; Documentation-purposes only: actually loaded in loadup.el 50;; Documentation-purposes only: actually loaded in loadup.el
50(require 'frame) 51(require 'frame)
51(require 'mouse) 52(require 'mouse)
@@ -57,10 +58,6 @@
57 "GNUstep/Mac OS X specific features." 58 "GNUstep/Mac OS X specific features."
58 :group 'environment) 59 :group 'environment)
59 60
60;; nsterm.m
61(defvar ns-alternate-modifier)
62(defvar ns-right-alternate-modifier)
63
64;;;; Command line argument handling. 61;;;; Command line argument handling.
65 62
66(defvar x-invocation-args) 63(defvar x-invocation-args)
@@ -161,7 +158,6 @@ The properties returned may include `top', `left', `height', and `width'."
161(define-key global-map [S-mouse-1] 'mouse-save-then-kill) 158(define-key global-map [S-mouse-1] 'mouse-save-then-kill)
162(global-unset-key [S-down-mouse-1]) 159(global-unset-key [S-down-mouse-1])
163 160
164
165;; Special Nextstep-generated events are converted to function keys. Here 161;; Special Nextstep-generated events are converted to function keys. Here
166;; are the bindings for them. Note, these keys are actually declared in 162;; are the bindings for them. Note, these keys are actually declared in
167;; x-setup-function-keys in common-win. 163;; x-setup-function-keys in common-win.
@@ -196,10 +192,10 @@ The properties returned may include `top', `left', `height', and `width'."
196 192
197(setq menu-bar-final-items 193(setq menu-bar-final-items
198 (cond ((eq system-type 'darwin) 194 (cond ((eq system-type 'darwin)
199 '(buffer windows services help-menu)) 195 '(buffer services help-menu))
200 ;; Otherwise, GNUstep. 196 ;; Otherwise, GNUstep.
201 (t 197 (t
202 '(buffer windows services hide-app quit)))) 198 '(buffer services hide-app quit))))
203 199
204;; Add standard top-level items to GNUstep menu. 200;; Add standard top-level items to GNUstep menu.
205(unless (eq system-type 'darwin) 201(unless (eq system-type 'darwin)
@@ -295,10 +291,6 @@ The properties returned may include `top', `left', `height', and `width'."
295 (t (error (concat "Service " ns-input-spi-name " not recognized"))))) 291 (t (error (concat "Service " ns-input-spi-name " not recognized")))))
296 292
297 293
298;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
299
300
301
302;; Composed key sequence handling for Nextstep system input methods. 294;; Composed key sequence handling for Nextstep system input methods.
303;; (On Nextstep systems, input methods are provided for CJK 295;; (On Nextstep systems, input methods are provided for CJK
304;; characters, etc. which require multiple keystrokes, and during 296;; characters, etc. which require multiple keystrokes, and during
@@ -395,29 +387,25 @@ See `ns-insert-working-text'."
395;;;; OS X file system Unicode UTF-8 NFD (decomposed form) support 387;;;; OS X file system Unicode UTF-8 NFD (decomposed form) support
396;; Lisp code based on utf-8m.el, by Seiji Zenitani, Eiji Honjoh, and 388;; Lisp code based on utf-8m.el, by Seiji Zenitani, Eiji Honjoh, and
397;; Carsten Bormann. 389;; Carsten Bormann.
398(if (eq system-type 'darwin) 390(when (eq system-type 'darwin)
399 (progn 391 (defun ns-utf8-nfd-post-read-conversion (length)
400 392 "Calls `ns-convert-utf8-nfd-to-nfc' to compose char sequences."
401 (defun ns-utf8-nfd-post-read-conversion (length) 393 (save-excursion
402 "Calls `ns-convert-utf8-nfd-to-nfc' to compose char sequences." 394 (save-restriction
403 (save-excursion 395 (narrow-to-region (point) (+ (point) length))
404 (save-restriction 396 (let ((str (buffer-string)))
405 (narrow-to-region (point) (+ (point) length)) 397 (delete-region (point-min) (point-max))
406 (let ((str (buffer-string))) 398 (insert (ns-convert-utf8-nfd-to-nfc str))
407 (delete-region (point-min) (point-max)) 399 (- (point-max) (point-min))
408 (insert (ns-convert-utf8-nfd-to-nfc str)) 400 ))))
409 (- (point-max) (point-min)) 401
410 )))) 402 (define-coding-system 'utf-8-nfd
411 403 "UTF-8 NFD (decomposed) encoding."
412 (define-coding-system 'utf-8-nfd 404 :coding-type 'utf-8
413 "UTF-8 NFD (decomposed) encoding." 405 :mnemonic ?U
414 :coding-type 'utf-8 406 :charset-list '(unicode)
415 :mnemonic ?U 407 :post-read-conversion 'ns-utf8-nfd-post-read-conversion)
416 :charset-list '(unicode) 408 (set-file-name-coding-system 'utf-8-nfd))
417 :post-read-conversion 'ns-utf8-nfd-post-read-conversion)
418 (set-file-name-coding-system 'utf-8-nfd)))
419
420
421 409
422;;;; Inter-app communications support. 410;;;; Inter-app communications support.
423 411
@@ -492,7 +480,6 @@ Lines are highlighted according to `ns-input-line'."
492(add-hook 'first-change-hook 'ns-unselect-line) 480(add-hook 'first-change-hook 'ns-unselect-line)
493 481
494 482
495
496;;;; Preferences handling. 483;;;; Preferences handling.
497(declare-function ns-get-resource "nsfns.m" (owner name)) 484(declare-function ns-get-resource "nsfns.m" (owner name))
498 485
@@ -567,13 +554,15 @@ unless the current buffer is a scratch buffer."
567 (ns-hide-emacs 'activate) 554 (ns-hide-emacs 'activate)
568 (find-file f))))) 555 (find-file f)))))
569 556
570
571
572;;;; Frame-related functions. 557;;;; Frame-related functions.
573 558
574;; Don't show the frame name; that's redundant with Nextstep. 559;; Don't show the frame name; that's redundant with Nextstep.
575(setq-default mode-line-frame-identification '(" ")) 560(setq-default mode-line-frame-identification '(" "))
576 561
562;; nsterm.m
563(defvar ns-alternate-modifier)
564(defvar ns-right-alternate-modifier)
565
577;; You say tomAYto, I say tomAHto.. 566;; You say tomAYto, I say tomAHto..
578(defvaralias 'ns-option-modifier 'ns-alternate-modifier) 567(defvaralias 'ns-option-modifier 'ns-alternate-modifier)
579(defvaralias 'ns-right-option-modifier 'ns-right-alternate-modifier) 568(defvaralias 'ns-right-option-modifier 'ns-right-alternate-modifier)
@@ -640,10 +629,8 @@ unless the current buffer is a scratch buffer."
640 (if (not tool-bar-mode) (tool-bar-mode t))) 629 (if (not tool-bar-mode) (tool-bar-mode t)))
641 630
642 631
643
644;;;; Dialog-related functions. 632;;;; Dialog-related functions.
645 633
646
647;; Ask user for confirm before printing. Due to Kevin Rodgers. 634;; Ask user for confirm before printing. Due to Kevin Rodgers.
648(defun ns-print-buffer () 635(defun ns-print-buffer ()
649 "Interactive front-end to `print-buffer': asks for user confirmation first." 636 "Interactive front-end to `print-buffer': asks for user confirmation first."
@@ -784,11 +771,9 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
784;; buffer 0 before retrieving the value of the primary selection. 771;; buffer 0 before retrieving the value of the primary selection.
785(defun x-selection-value () 772(defun x-selection-value ()
786 (let (text) 773 (let (text)
787
788 ;; Consult the selection. Treat empty strings as if they were unset. 774 ;; Consult the selection. Treat empty strings as if they were unset.
789 (or text (setq text (ns-get-pasteboard))) 775 (or text (setq text (ns-get-pasteboard)))
790 (if (string= text "") (setq text nil)) 776 (if (string= text "") (setq text nil))
791
792 (cond 777 (cond
793 ((not text) nil) 778 ((not text) nil)
794 ((eq text ns-last-selected-text) nil) 779 ((eq text ns-last-selected-text) nil)
@@ -809,7 +794,6 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
809 (insert (ns-get-cut-buffer-internal 'SECONDARY))) 794 (insert (ns-get-cut-buffer-internal 'SECONDARY)))
810 795
811 796
812
813;;;; Scrollbar handling. 797;;;; Scrollbar handling.
814 798
815(global-set-key [vertical-scroll-bar down-mouse-1] 'ns-handle-scroll-bar-event) 799(global-set-key [vertical-scroll-bar down-mouse-1] 'ns-handle-scroll-bar-event)