aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Reitter2009-03-29 00:00:30 +0000
committerDavid Reitter2009-03-29 00:00:30 +0000
commit4c785fa701951252a30a2849ff220b8a30aca8cf (patch)
tree46d889ed37d64e72ac9ba5568ce73bf9443cb3b0
parent5848d13016fcdd196ac696335c6534037e3f46c2 (diff)
downloademacs-4c785fa701951252a30a2849ff220b8a30aca8cf.tar.gz
emacs-4c785fa701951252a30a2849ff220b8a30aca8cf.zip
(ns-expand-space): remove defvar.
(S-,): bind to `customize' in line with menu item. ([global-map windows]): remove (in line with other platforms). (menu-bar-update-frames, force-menu-bar-update-buffers,force-menu-bar-update-buffers,force-menu-bar-update-buffers): remove, not needed. (menu-bar-update-hook): do not alter. (generate-fontset-menu,mouse-set-font): amend doc string of these defaliases to point out their altered meaning in NS.
-rw-r--r--lisp/term/ns-win.el68
1 files changed, 9 insertions, 59 deletions
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 0786714c538..1cc97aed78f 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -65,7 +65,6 @@
65 65
66;; nsterm.m 66;; nsterm.m
67(defvar ns-version-string) 67(defvar ns-version-string)
68(defvar ns-expand-space)
69(defvar ns-alternate-modifier) 68(defvar ns-alternate-modifier)
70 69
71;;;; Command line argument handling. 70;;;; Command line argument handling.
@@ -224,7 +223,7 @@ The properties returned may include `top', `left', `height', and `width'."
224 "Keymap of alternative meanings for some keys under NS.") 223 "Keymap of alternative meanings for some keys under NS.")
225 224
226;; Here are some Nextstep-like bindings for command key sequences. 225;; Here are some Nextstep-like bindings for command key sequences.
227(define-key global-map [?\s-,] 'ns-popup-prefs-panel) 226(define-key global-map [?\s-,] 'customize)
228(define-key global-map [?\s-'] 'next-multiframe-window) 227(define-key global-map [?\s-'] 'next-multiframe-window)
229(define-key global-map [?\s-`] 'other-frame) 228(define-key global-map [?\s-`] 'other-frame)
230(define-key global-map [?\s--] 'center-line) 229(define-key global-map [?\s--] 'center-line)
@@ -403,10 +402,10 @@ this defaults to \"printenv\"."
403; (cons (logior (lsh 0 16) 9) 'ns-insert-working-text) 402; (cons (logior (lsh 0 16) 9) 'ns-insert-working-text)
404; (cons (logior (lsh 0 16) 10) 'ns-delete-working-text) 403; (cons (logior (lsh 0 16) 10) 'ns-delete-working-text)
405 (cons (logior (lsh 0 16) 11) 'ns-spi-service-call) 404 (cons (logior (lsh 0 16) 11) 'ns-spi-service-call)
406 (cons (logior (lsh 0 16) 12) 'ns-new-frame) 405 (cons (logior (lsh 0 16) 12) 'ns-new-frame)
407 (cons (logior (lsh 0 16) 13) 'ns-toggle-toolbar) 406 (cons (logior (lsh 0 16) 13) 'ns-toggle-toolbar)
408 (cons (logior (lsh 0 16) 14) 'ns-show-prefs) 407 (cons (logior (lsh 0 16) 14) 'ns-show-prefs)
409 (cons (logior (lsh 1 16) 32) 'f1) 408 (cons (logior (lsh 1 16) 32) 'f1)
410 (cons (logior (lsh 1 16) 33) 'f2) 409 (cons (logior (lsh 1 16) 33) 'f2)
411 (cons (logior (lsh 1 16) 34) 'f3) 410 (cons (logior (lsh 1 16) 34) 'f3)
412 (cons (logior (lsh 1 16) 35) 'f4) 411 (cons (logior (lsh 1 16) 35) 'f4)
@@ -516,7 +515,6 @@ this defaults to \"printenv\"."
516 515
517(define-key global-map [menu-bar services] 516(define-key global-map [menu-bar services]
518 (cons "Services" (make-sparse-keymap "Services"))) 517 (cons "Services" (make-sparse-keymap "Services")))
519(define-key global-map [menu-bar windows] (make-sparse-keymap "Windows"))
520(define-key global-map [menu-bar buffer] 518(define-key global-map [menu-bar buffer]
521 (cons "Buffers" global-buffers-menu-map)) 519 (cons "Buffers" global-buffers-menu-map))
522;; (cons "Buffers" (make-sparse-keymap "Buffers"))) 520;; (cons "Buffers" (make-sparse-keymap "Buffers")))
@@ -626,56 +624,6 @@ this defaults to \"printenv\"."
626(define-key-after menu-bar-edit-menu [separator-undo] '("--") 'undo) 624(define-key-after menu-bar-edit-menu [separator-undo] '("--") 'undo)
627(define-key-after menu-bar-edit-menu [spell] '("Spell" . ispell-menu-map) 'fill) 625(define-key-after menu-bar-edit-menu [spell] '("Spell" . ispell-menu-map) 'fill)
628 626
629(defun menu-bar-update-frames ()
630 ;; If user discards the Windows item, play along.
631 (when (lookup-key (current-global-map) [menu-bar windows])
632 (let ((frames (frame-list))
633 (frames-menu (make-sparse-keymap "Select Frame")))
634 (setcdr frames-menu
635 (nconc
636 (mapcar (lambda (frame)
637 (list*
638 (frame-parameter frame 'window-id)
639 (frame-parameter frame 'name)
640 `(lambda ()
641 (interactive) (menu-bar-select-frame ,frame))))
642 frames)
643 (cdr frames-menu)))
644 (define-key frames-menu [separator-frames] '("--"))
645 (define-key frames-menu [popup-color-panel]
646 '("Colors..." . ns-popup-color-panel))
647 (define-key frames-menu [popup-font-panel]
648 '("Font Panel..." . ns-popup-font-panel))
649 (define-key frames-menu [separator-arrange] '("--"))
650 (define-key frames-menu [arrange-all-frames]
651 '("Arrange All Frames" . ns-arrange-all-frames))
652 (define-key frames-menu [arrange-visible-frames]
653 '("Arrange Visible Frames" . ns-arrange-visible-frames))
654 ;; Don't use delete-frame as event name
655 ;; because that is a special event.
656 (define-key (current-global-map) [menu-bar windows]
657 (cons "Windows" frames-menu)))))
658
659(defun force-menu-bar-update-buffers ()
660 ;; This is a hack to get around fact that we already checked
661 ;; frame-or-buffer-changed-p and reset it, so menu-bar-update-buffers
662 ;; does not pick up any change.
663 (menu-bar-update-buffers t))
664
665(add-hook 'menu-bar-update-fab-hook 'menu-bar-update-frames)
666(add-hook 'menu-bar-update-fab-hook 'force-menu-bar-update-buffers)
667
668(defun menu-bar-update-frames-and-buffers ()
669 (if (frame-or-buffer-changed-p)
670 (run-hooks 'menu-bar-update-fab-hook)))
671
672(setq menu-bar-update-hook
673 (delq 'menu-bar-update-buffers menu-bar-update-hook))
674(add-hook 'menu-bar-update-hook 'menu-bar-update-frames-and-buffers)
675
676(menu-bar-update-frames-and-buffers)
677
678
679;; ns-arrange functions contributed 627;; ns-arrange functions contributed
680;; by Eberhard Mandler <mandler@dbag.ulm.DaimlerBenz.COM> 628;; by Eberhard Mandler <mandler@dbag.ulm.DaimlerBenz.COM>
681(defun ns-arrange-all-frames () 629(defun ns-arrange-all-frames ()
@@ -1141,8 +1089,10 @@ unless the current buffer is a scratch buffer.")
1141 1089
1142;; Set to use font panel instead 1090;; Set to use font panel instead
1143(declare-function ns-popup-font-panel "nsfns.m" (&optional frame)) 1091(declare-function ns-popup-font-panel "nsfns.m" (&optional frame))
1144(defalias 'generate-fontset-menu 'ns-popup-font-panel) 1092(defalias 'generate-fontset-menu 'ns-popup-font-panel "Pop up the font panel.
1145(defalias 'mouse-set-font 'ns-popup-font-panel) 1093This function has been overloaded in NS.")
1094(defalias 'mouse-set-font 'ns-popup-font-panel "Pop up the font panel.
1095This function has been overloaded in NS.")
1146 1096
1147;; nsterm.m 1097;; nsterm.m
1148(defvar ns-input-font) 1098(defvar ns-input-font)