From 4271b4248d5e0add806a41ddbd6b0c99574eea8e Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 17 Jun 2008 11:28:06 +0000 Subject: [PATCH] Use buffer-face-mode for mouse font menu Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1252 --- lisp/ChangeLog | 2 ++ lisp/mouse.el | 19 ++++++------------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b225c8f8964..e51c22ad9fb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2008-06-17 Miles Bader + * mouse.el (mouse-appearance-menu): Use buffer-face-mode. + * face-remap.el (buffer-face-mode-face) (buffer-face-mode-remapping): New variables. (buffer-face-mode, buffer-face-set, buffer-face-toggle) diff --git a/lisp/mouse.el b/lisp/mouse.el index 44303ebade9..a67390fc0e4 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -2521,22 +2521,15 @@ choose a font." (text-scale-increase -1)) ((eq choice 'face-remap-reset-base) (text-scale-mode 0) - (let ((entry (assq 'default face-remapping-alist))) - (when entry - (setq face-remapping-alist - (remq entry face-remapping-alist)) - (force-window-update (current-buffer))))) + (buffer-face-mode 0)) (t ;; Either choice == 'x-select-font, or choice is a ;; symbol whose name is a font. - (make-local-variable 'face-remapping-alist) - (apply 'face-remap-add-relative - 'default - (font-face-attributes - (if (eq choice 'x-select-font) - (x-select-font) - (symbol-name choice)))) - (force-window-update (current-buffer)))))))) + (buffer-face-mode-invoke (font-face-attributes + (if (eq choice 'x-select-font) + (x-select-font) + (symbol-name choice))) + t (interactive-p)))))))) ;;; Bindings for mouse commands. -- 2.39.2