diff options
| author | Chong Yidong | 2008-06-10 19:57:09 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-06-10 19:57:09 +0000 |
| commit | ecb044e1356900661a6ae8c6be5afd16b78c0aa8 (patch) | |
| tree | 71830dad8fd08ace6db37c04a29d806f5bd40077 | |
| parent | 7ecc4011370164dfea614c338a6732b3074d688c (diff) | |
| download | emacs-ecb044e1356900661a6ae8c6be5afd16b78c0aa8.tar.gz emacs-ecb044e1356900661a6ae8c6be5afd16b78c0aa8.zip | |
(mouse-select-font): New function.
| -rw-r--r-- | lisp/mouse.el | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 63bb5b9051c..8565e62edfe 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -2425,8 +2425,25 @@ and selects that window." | |||
| 2425 | ) | 2425 | ) |
| 2426 | "X fonts suitable for use in Emacs.") | 2426 | "X fonts suitable for use in Emacs.") |
| 2427 | 2427 | ||
| 2428 | (defun mouse-select-font () | ||
| 2429 | "Prompt for a font name, using `x-popup-menu', and return it." | ||
| 2430 | (interactive) | ||
| 2431 | (unless (display-multi-font-p) | ||
| 2432 | (error "Cannot change fonts on this display")) | ||
| 2433 | (x-popup-menu | ||
| 2434 | (if (listp last-nonmenu-event) | ||
| 2435 | last-nonmenu-event | ||
| 2436 | (list '(0 0) (selected-window))) | ||
| 2437 | (append x-fixed-font-alist | ||
| 2438 | (list (generate-fontset-menu))))) | ||
| 2439 | |||
| 2428 | (defun mouse-set-font (&rest fonts) | 2440 | (defun mouse-set-font (&rest fonts) |
| 2429 | "Select an Emacs font from a list of known good fonts and fontsets." | 2441 | "Set the default font for the selected frame. |
| 2442 | The argument FONTS is a list of font names; the first valid font | ||
| 2443 | in this list is used. | ||
| 2444 | |||
| 2445 | When called interactively, pop up a menu and allow the user to | ||
| 2446 | choose a font." | ||
| 2430 | (interactive | 2447 | (interactive |
| 2431 | (progn (unless (display-multi-font-p) | 2448 | (progn (unless (display-multi-font-p) |
| 2432 | (error "Cannot change fonts on this display")) | 2449 | (error "Cannot change fonts on this display")) |