From 330cf1a71787946b9fd4c74bad0e66c1bad7fa7f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 17 Mar 2015 20:29:55 +0200 Subject: [PATCH] Resurrect the lost optional fixed font menu on w32 lisp/mouse.el (mouse-appearance-menu): If w32-use-w32-font-dialog is nil, construct a menu of fixed fonts. This resurrects a feature lost in Emacs 23. lisp/w32-vars.el (w32-use-w32-font-dialog): Add a ':set' function to reset mouse-appearance-menu-map, so the font dialog is recomputed the next time the menu is requested. (w32-fixed-font-alist): Fix to use correct names of Courier fonts. --- lisp/ChangeLog | 11 +++++++++++ lisp/mouse.el | 11 ++++++++--- lisp/w32-vars.el | 17 ++++++++++++----- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 96478223d49..b29694be0d0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2015-03-17 Eli Zaretskii + + * mouse.el (mouse-appearance-menu): If w32-use-w32-font-dialog is + nil, construct a menu of fixed fonts. This resurrects a feature + lost in Emacs 23. + + * w32-vars.el (w32-use-w32-font-dialog): Add a ':set' function to + reset mouse-appearance-menu-map, so the font dialog is recomputed + the next time the menu is requested. + (w32-fixed-font-alist): Fix to use correct names of Courier fonts. + 2015-03-17 Michael Albinus * net/tramp-sh.el (tramp-ssh-controlmaster-options): Change test diff --git a/lisp/mouse.el b/lisp/mouse.el index e78eca40bc5..be9562c8d77 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1820,13 +1820,18 @@ choose a font." (define-key mouse-appearance-menu-map [text-scale-increase] '(menu-item "Increase Buffer Text Size" text-scale-increase)) ;; Font selector - (if (functionp 'x-select-font) + (if (and (functionp 'x-select-font) + (or (not (boundp 'w32-use-w32-font-dialog)) + w32-use-w32-font-dialog)) (define-key mouse-appearance-menu-map [x-select-font] '(menu-item "Change Buffer Font..." x-select-font)) ;; If the select-font is unavailable, construct a menu. (let ((font-submenu (make-sparse-keymap "Change Text Font")) - (font-alist (cdr (append x-fixed-font-alist - (list (generate-fontset-menu)))))) + (font-alist (cdr (append + (if (eq system-type 'windows-nt) + w32-fixed-font-alist + x-fixed-font-alist) + (list (generate-fontset-menu)))))) (dolist (family font-alist) (let* ((submenu-name (car family)) (submenu-map (make-sparse-keymap submenu-name))) diff --git a/lisp/w32-vars.el b/lisp/w32-vars.el index ae42ee7ecda..f9212be406c 100644 --- a/lisp/w32-vars.el +++ b/lisp/w32-vars.el @@ -34,10 +34,17 @@ ;; Redefine the font selection to use the standard W32 dialog (defcustom w32-use-w32-font-dialog t - "Use the standard font dialog. + "If non-nil, use the standard Windows font dialog for font selection. If nil, pop up a menu of a fixed set of fonts including fontsets, like -X does. See `w32-fixed-font-alist' for the font menu definition." +X does. See `w32-fixed-font-alist' for the fonts to appear in the menu. + +Setting this variable directly does not have any effect; +use either \\[customize] or set `mouse-appearance-menu-map' to nil +after changing the value of this variable." :type 'boolean + :set (lambda (symbol value) + (set symbol value) + (setq mouse-appearance-menu-map nil)) :group 'w32) (defvar w32-list-proportional-fonts nil @@ -104,11 +111,11 @@ X does. See `w32-fixed-font-alist' for the font menu definition." "-*-Lucida Sans Typewriter-semibold-r-*-*-16-*-*-*-c-*-iso8859-1")) ("Courier" ("Courier 10x8" - "-*-Courier-*normal-r-*-*-*-97-*-*-c-80-iso8859-1") + "-*-Courier New-normal-r-*-*-*-97-*-*-c-80-iso8859-1") ("Courier 12x9" - "-*-Courier-*normal-r-*-*-*-120-*-*-c-90-iso8859-1") + "-*-Courier New-normal-r-*-*-*-120-*-*-c-90-iso8859-1") ("Courier 15x12" - "-*-Courier-*normal-r-*-*-*-150-*-*-c-120-iso8859-1") + "-*-Courier New-normal-r-*-*-*-150-*-*-c-120-iso8859-1") ;; For these, we specify the point height. ("") ("8" "-*-Courier New-normal-r-*-*-11-*-*-*-c-*-iso8859-1") -- 2.39.2