comparison lisp/mouse.el @ 96043:a678c02d0c40

Use buffer-face-mode for mouse font menu Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1252
author Miles Bader <miles@gnu.org>
date Tue, 17 Jun 2008 11:28:06 +0000
parents 6600c6bbfa93
children 585941e8f7bc
comparison
equal deleted inserted replaced
96042:dfc9ab5fbea5 96043:a678c02d0c40
2519 (text-scale-increase 1)) 2519 (text-scale-increase 1))
2520 ((eq choice 'text-scale-decrease) 2520 ((eq choice 'text-scale-decrease)
2521 (text-scale-increase -1)) 2521 (text-scale-increase -1))
2522 ((eq choice 'face-remap-reset-base) 2522 ((eq choice 'face-remap-reset-base)
2523 (text-scale-mode 0) 2523 (text-scale-mode 0)
2524 (let ((entry (assq 'default face-remapping-alist))) 2524 (buffer-face-mode 0))
2525 (when entry
2526 (setq face-remapping-alist
2527 (remq entry face-remapping-alist))
2528 (force-window-update (current-buffer)))))
2529 (t 2525 (t
2530 ;; Either choice == 'x-select-font, or choice is a 2526 ;; Either choice == 'x-select-font, or choice is a
2531 ;; symbol whose name is a font. 2527 ;; symbol whose name is a font.
2532 (make-local-variable 'face-remapping-alist) 2528 (buffer-face-mode-invoke (font-face-attributes
2533 (apply 'face-remap-add-relative 2529 (if (eq choice 'x-select-font)
2534 'default 2530 (x-select-font)
2535 (font-face-attributes 2531 (symbol-name choice)))
2536 (if (eq choice 'x-select-font) 2532 t (interactive-p))))))))
2537 (x-select-font)
2538 (symbol-name choice))))
2539 (force-window-update (current-buffer))))))))
2540 2533
2541 2534
2542 ;;; Bindings for mouse commands. 2535 ;;; Bindings for mouse commands.
2543 2536
2544 (define-key global-map [down-mouse-1] 'mouse-drag-region) 2537 (define-key global-map [down-mouse-1] 'mouse-drag-region)