]> code.delx.au - gnu-emacs/blobdiff - lisp/menu-bar.el
(Default Coding Systems): Document find-auto-coding, set-auto-coding, and
[gnu-emacs] / lisp / menu-bar.el
index 877a5b5de9e7ac86c8085be70a6d954ca523b651..24fd88e6819b1e65161e4b7a03f8331dd1faaa59 100644 (file)
              :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."
@@ -637,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)