From: Jan Djärv Date: Sun, 20 Oct 2013 08:50:34 +0000 (+0200) Subject: Fix GNUStep specific menu items. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1208 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=aca5fcdc4c8f4d77d1408adec856356257cdaf19;p=emacs.git Fix GNUStep specific menu items. * lisp/menu-bar.el: Move GNUStep specific menus... * lisp/term/ns-win.el (ns-initialize-window-system): ... to here. * src/nsterm.m (Qcocoa, Qgnustep): New variables. (syms_of_nsterm): Defsym Qcocoa, Qgnustep. Fprovide appropriate one. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3b220f875e4..708986f5220 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-10-20 Jan Djärv + + * menu-bar.el: Move GNUStep specific menus... + + * term/ns-win.el (ns-initialize-window-system): ... to here. + 2013-10-19 Stefan Monnier * simple.el (newline): Only run post-self-insert-hook when diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index da80db00910..7c648df36fd 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -44,17 +44,7 @@ ;; Force Help item to come last, after the major mode's own items. ;; The symbol used to be called `help', but that gets confused with the ;; help key. - (setq menu-bar-final-items '(help-menu)) - (if (eq system-type 'darwin) - (setq menu-bar-final-items '(buffer services help-menu)) - (setq menu-bar-final-items '(buffer services hide-app quit)) - ;; Add standard top-level items to GNUstep menu. - (bindings--define-key global-map [menu-bar quit] - '(menu-item "Quit" save-buffers-kill-emacs - :help "Save unsaved buffers, then exit")) - (bindings--define-key global-map [menu-bar hide-app] - '(menu-item "Hide" ns-do-hide-emacs - :help "Hide Emacs")))) + (setq menu-bar-final-items '(help-menu))) ;; This definition is just to show what this looks like. ;; It gets modified in place when menu-bar-update-buffers is called. diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index bc9cab375bf..fc15d2dff12 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -899,6 +899,20 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (x-open-connection (system-name) nil t) + ;; Add GNUStep menu items Services, Hide and Quit. + (if (featurep 'gnustep) + (progn + (setq menu-bar-final-items '(buffer services hide-app quit)) + (bindings--define-key global-map [menu-bar quit] + '(menu-item "Quit" save-buffers-kill-emacs + :help "Save unsaved buffers, then exit")) + (bindings--define-key global-map [menu-bar hide-app] + '(menu-item "Hide" ns-do-hide-emacs + :help "Hide Emacs")) + (bindings--define-key global-map [menu-bar services] + (cons "Services" (make-sparse-keymap "Services"))))) + + (dolist (service (ns-list-services)) (if (eq (car service) 'undefined) (ns-define-service (cdr service)) diff --git a/src/ChangeLog b/src/ChangeLog index b973b5b8d04..c229c50b663 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-10-20 Jan Djärv + + * nsterm.m (Qcocoa, Qgnustep): New variables. + (syms_of_nsterm): Defsym Qcocoa, Qgnustep. Fprovide appropriate one. + 2013-10-18 Eli Zaretskii * keyboard.c (make_lispy_event): Remove GPM-specific code that diff --git a/src/nsterm.m b/src/nsterm.m index 5b2c6a3f686..11aba4edd4a 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -173,6 +173,7 @@ Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qsuper; extern Lisp_Object Qcursor_color, Qcursor_type, Qns, Qleft; static Lisp_Object QUTF8_STRING; +static Lisp_Object Qcocoa, Qgnustep; /* On OS X picks up the default NSGlobalDomain AppleAntiAliasingThreshold, the maximum font size to NOT antialias. On GNUstep there is currently @@ -7501,11 +7502,17 @@ baseline level. The default value is nil. */); /* Tell Emacs about this window system. */ Fprovide (Qns, Qnil); + DEFSYM (Qcocoa, "cocoa"); + DEFSYM (Qgnustep, "gnustep"); + syms_of_nsfont (); #ifdef NS_IMPL_COCOA + Fprovide (Qcocoa, Qnil); #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 syms_of_macfont (); #endif +#else + Fprovide (Qgnustep, Qnil); #endif }