diff options
author | Chong Yidong <cyd@gnu.org> | 2012-08-17 17:10:31 +0800 |
---|---|---|
committer | Chong Yidong <cyd@gnu.org> | 2012-08-17 17:10:31 +0800 |
commit | 383dcbf97748f1a4ef57f8af4f5780501ba78216 (patch) | |
tree | d21e24ab76f120c7f47cb6fc42b23f828a1fd902 /lisp/mouse.el | |
parent | 0df648f9869d11681df46502f7eef2bee1c7ae39 (diff) | |
download | emacs-383dcbf97748f1a4ef57f8af4f5780501ba78216.tar.gz |
Allow face-remapping using :font, and use it in mouse-appearance-menu.
* mouse.el (mouse-appearance-menu): If x-select-font returns a
font spec, set the font directly.
* xfaces.c (merge_face_vectors): If the target font specfies a
font spec, make the font's attributes take precedence over
directly-specified attributes.
(merge_face_ref): Recognize :font.
Fixes: debbugs:3228
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r-- | lisp/mouse.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 589bbd67b1b..4ea84288f69 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1951,12 +1951,14 @@ choose a font." (choice ;; Either choice == 'x-select-font, or choice is a ;; symbol whose name is a font. - (buffer-face-mode-invoke (font-face-attributes - (if (eq choice 'x-select-font) - (x-select-font) - (symbol-name choice))) - t - (called-interactively-p 'interactive)))))))) + (let ((font (if (eq choice 'x-select-font) + (x-select-font) + (symbol-name choice)))) + (buffer-face-mode-invoke + (if (fontp font 'font-spec) + (list :font font) + (font-face-attributes font)) + t (called-interactively-p 'interactive))))))))) ;;; Bindings for mouse commands. |