From: Chong Yidong Date: Tue, 10 Jun 2008 19:57:09 +0000 (+0000) Subject: (mouse-select-font): New function. X-Git-Tag: emacs-pretest-23.0.90~4910 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ecb044e1356900661a6ae8c6be5afd16b78c0aa8;p=emacs.git (mouse-select-font): New function. --- 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." ) "X fonts suitable for use in Emacs.") +(defun mouse-select-font () + "Prompt for a font name, using `x-popup-menu', and return it." + (interactive) + (unless (display-multi-font-p) + (error "Cannot change fonts on this display")) + (x-popup-menu + (if (listp last-nonmenu-event) + last-nonmenu-event + (list '(0 0) (selected-window))) + (append x-fixed-font-alist + (list (generate-fontset-menu))))) + (defun mouse-set-font (&rest fonts) - "Select an Emacs font from a list of known good fonts and fontsets." + "Set the default font for the selected frame. +The argument FONTS is a list of font names; the first valid font +in this list is used. + +When called interactively, pop up a menu and allow the user to +choose a font." (interactive (progn (unless (display-multi-font-p) (error "Cannot change fonts on this display"))