]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix GNUStep specific menu items.
authorJan Djärv <jan.h.d@swipnet.se>
Sun, 20 Oct 2013 08:50:34 +0000 (10:50 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Sun, 20 Oct 2013 08:50:34 +0000 (10:50 +0200)
* 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.

lisp/ChangeLog
lisp/menu-bar.el
lisp/term/ns-win.el
src/ChangeLog
src/nsterm.m

index 3b220f875e4d6f9107e90e71f5e4d0df26a074e4..708986f52208642c2ed5d80bf067728f4ebb098d 100644 (file)
@@ -1,3 +1,9 @@
+2013-10-20  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * menu-bar.el: Move GNUStep specific menus...
+
+       * term/ns-win.el (ns-initialize-window-system): ... to here.
+
 2013-10-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * simple.el (newline): Only run post-self-insert-hook when
index da80db00910cdd337a5f8930511d49f0c083b5b0..7c648df36fd41c4bda251c0c885c43e595cbb228 100644 (file)
     ;; 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.
index bc9cab375bf5e521850b101b67e3295f23d9b089..fc15d2dff123a854dd74bfa79aefee68b5d7502c 100644 (file)
@@ -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))
index b973b5b8d04b97b6b473a1ffa79331efa4d87527..c229c50b663f0a4d67fbe585ca22b2b22e13e937 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-20  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsterm.m (Qcocoa, Qgnustep): New variables.
+       (syms_of_nsterm): Defsym Qcocoa, Qgnustep.  Fprovide appropriate one.
+
 2013-10-18  Eli Zaretskii  <eliz@gnu.org>
 
        * keyboard.c (make_lispy_event): Remove GPM-specific code that
index 5b2c6a3f6865cc2bfe34236baa574036d7141574..11aba4edd4a2b6b46c08ee6b156a6f792faa77b6 100644 (file)
@@ -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
   
 }