]> code.delx.au - gnu-emacs/blobdiff - lisp/menu-bar.el
(pop-up-frame-function): Remove choice nil since it
[gnu-emacs] / lisp / menu-bar.el
index 93dd551fdd80531b699838d77c3399ec75067d5c..24fd88e6819b1e65161e4b7a03f8331dd1faaa59 100644 (file)
@@ -1,7 +1,7 @@
 ;;; menu-bar.el --- define a default menu bar
 
 ;; Copyright (C) 1993, 1994, 1995, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: RMS
 ;; Maintainer: FSF
@@ -64,8 +64,7 @@
 \f
 ;; The "File" menu items
 (define-key menu-bar-file-menu [exit-emacs]
-  '(menu-item "Exit Emacs" save-buffers-kill-emacs
-             :keys "C-x C-c"
+  '(menu-item "Quit" save-buffers-kill-terminal
              :help "Save unsaved buffers, then exit"))
 
 (define-key menu-bar-file-menu [separator-exit]
 
 (define-key menu-bar-edit-menu [mark-whole-buffer]
   '(menu-item "Select All" mark-whole-buffer
-             :help "Mark the whole buffer for a subsequent cut/copy."))
+             :help "Mark the whole buffer for a subsequent cut/copy"))
 (define-key menu-bar-edit-menu [clear]
   '(menu-item "Clear" delete-region
              :enable (and mark-active
 (defvar yank-menu (cons "Select Yank" nil))
 (fset 'yank-menu (cons 'keymap yank-menu))
 (define-key menu-bar-edit-menu [paste-from-menu]
-  '(menu-item "Paste from kill menu" yank-menu
+  '(menu-item "Paste from Kill Menu" yank-menu
              :enable (and (cdr yank-menu) (not buffer-read-only))
              :help "Choose a string from the kill ring and paste it"))
 (define-key menu-bar-edit-menu [paste]
   '(menu-item "Paste" yank
-             :enable (and
-                      ;; Emacs compiled --without-x doesn't have
-                      ;; x-selection-exists-p.
-                      (fboundp 'x-selection-exists-p)
-                      (x-selection-exists-p) (not buffer-read-only))
+             :enable (and (or
+                           ;; Emacs compiled --without-x doesn't have
+                           ;; x-selection-exists-p.
+                           (and (fboundp 'x-selection-exists-p)
+                                (x-selection-exists-p))
+                           kill-ring)
+                          (not buffer-read-only))
              :help "Paste (yank) text most recently cut/copied"))
 (define-key menu-bar-edit-menu [copy]
   '(menu-item "Copy" menu-bar-kill-ring-save
      '(and mark-active (not buffer-read-only)))
 (put 'clipboard-kill-ring-save 'menu-enable 'mark-active)
 (put 'clipboard-yank 'menu-enable
-     '(and (or (and (fboundp 'x-selection-exists-p)
-                   (x-selection-exists-p))
+     '(and (or (not (fboundp 'x-selection-exists-p))
+              (x-selection-exists-p)
               (x-selection-exists-p 'CLIPBOARD))
-          (not buffer-read-only)))
+          (not buffer-read-only)))
 
 (defun clipboard-yank ()
   "Insert the clipboard contents, or the last stretch of killed text."
@@ -638,7 +639,20 @@ by \"Save Options\" in Custom buffers.")
                (mouse-select-font)))
        spec)
     (when font
-      (set-face-attribute 'default nil :font font)
+      ;; Be careful here: when set-face-attribute is called for the
+      ;; :font attribute, Emacs tries to guess the best matching font
+      ;; by examining the other face attributes (Bug#2476).
+      (set-face-attribute 'default (selected-frame)
+                         :width 'normal
+                         :weight 'normal
+                         :slant 'normal
+                         :font font)
+      (let ((font-object (face-attribute 'default :font)))
+       (dolist (f (frame-list))
+         (and (not (eq f (selected-frame)))
+              (display-graphic-p f)
+              (set-face-attribute 'default f :font font-object)))
+       (set-face-attribute 'default t :font font-object))
       (setq spec (list (list t (face-attr-construct 'default))))
       (put 'default 'customized-face spec)
       (custom-push-theme 'theme-face 'default 'user 'set spec)
@@ -951,7 +965,7 @@ mail status in mode line"))
 
 (define-key menu-bar-showhide-menu [showhide-tool-bar]
   (list 'menu-item "Tool-bar" 'toggle-tool-bar-mode-from-frame
-       :help "Toggle tool-bar on/off"
+       :help "Turn tool-bar on/off"
        :visible `(display-graphic-p)
        :button `(:toggle . (> (frame-parameter nil 'tool-bar-lines) 0))))
 
@@ -1050,7 +1064,7 @@ mail status in mode line"))
 (define-key menu-bar-options-menu [auto-fill-mode]
   '(menu-item "Auto Fill in Text Modes"
               menu-bar-text-mode-auto-fill
-             :help "Automatically fill text while typing (Auto Fill Mode)"
+             :help "Automatically fill text while typing (Auto Fill mode)"
               :button (:toggle . (if (listp text-mode-hook)
                                     (member 'turn-on-auto-fill text-mode-hook)
                                   (eq 'turn-on-auto-fill text-mode-hook)))))
@@ -1362,7 +1376,7 @@ mail status in mode line"))
 
 (define-key menu-bar-describe-menu [list-keybindings]
   '(menu-item "List Key Bindings" describe-bindings
-             :help "Display all current keybindings (keyboard shortcuts)"))
+             :help "Display all current key bindings (keyboard shortcuts)"))
 (define-key menu-bar-describe-menu [describe-current-display-table]
   '(menu-item "Describe Display Table" describe-current-display-table
              :help "Describe the current display table"))
@@ -1458,7 +1472,7 @@ key, a click, or a menu-item"))
   '(menu-item "Ordering Manuals" view-order-manuals
              :help "How to order manuals from the Free Software Foundation"))
 (define-key menu-bar-manuals-menu [lookup-subject-in-all-manuals]
-  '(menu-item "Lookup Subject in all manuals..." info-apropos
+  '(menu-item "Lookup Subject in all Manuals..." info-apropos
              :help "Find description of a subject in all installed manuals"))
 (define-key menu-bar-manuals-menu [other-manuals]
   '(menu-item "All Other Manuals (Info)" Info-directory
@@ -1486,14 +1500,14 @@ key, a click, or a menu-item"))
              :help "Show the Emacs license (GPL)"))
 (define-key menu-bar-help-menu [getting-new-versions]
   '(menu-item "Getting New Versions" describe-distribution
-             :help "How to get latest versions of Emacs"))
+             :help "How to get the latest version of Emacs"))
 (defun menu-bar-help-extra-packages ()
   "Display help about some additional packages available for Emacs."
   (interactive)
   (let (enable-local-variables)
     (view-file (expand-file-name "MORE.STUFF"
                                 data-directory))
-    (goto-address)))
+    (goto-address-mode 1)))
 (define-key menu-bar-help-menu [sep2]
   '("--"))
 (define-key menu-bar-help-menu [external-packages]
@@ -1590,7 +1604,7 @@ using `abort-recursive-edit'."
     (> count 1)))
 
 (defcustom yank-menu-length 20
-  "*Maximum length to display in the yank-menu."
+  "Maximum length to display in the yank-menu."
   :type 'integer
   :group 'menu)
 
@@ -1632,7 +1646,7 @@ The menu shows all the killed text sequences stored in `kill-ring'."
 ;;; Buffers Menu
 
 (defcustom buffers-menu-max-size 10
-  "*Maximum number of entries which may appear on the Buffers menu.
+  "Maximum number of entries which may appear on the Buffers menu.
 If this is 10, then only the ten most-recently-selected buffers are shown.
 If this is nil, then all buffers are shown.
 A large number or nil slows down menu responsiveness."
@@ -1641,7 +1655,7 @@ A large number or nil slows down menu responsiveness."
   :group 'menu)
 
 (defcustom buffers-menu-buffer-name-length 30
-  "*Maximum length of the buffer name on the Buffers menu.
+  "Maximum length of the buffer name on the Buffers menu.
 If this is a number, then buffer names are truncated to this length.
 If this is nil, then buffer names are shown in full.
 A large number or nil makes the menu too wide."