diff options
| author | Richard M. Stallman | 1994-04-14 02:55:13 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-14 02:55:13 +0000 |
| commit | 1900a92b1d8253defda737db0b857028aae46b3d (patch) | |
| tree | d968afd611f5031188311b051b977d439989e900 | |
| parent | d49ab5a0e7d0052023d7fae17ff124edc4bb5eac (diff) | |
| download | emacs-1900a92b1d8253defda737db0b857028aae46b3d.tar.gz emacs-1900a92b1d8253defda737db0b857028aae46b3d.zip | |
(x-fixed-font-alist): Give multiple names for try for certain fonts.
(mouse-set-font): Handle these.
| -rw-r--r-- | lisp/mouse.el | 78 |
1 files changed, 44 insertions, 34 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 9de9fe535ac..3528280edb9 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -1242,14 +1242,14 @@ and selects that window." | |||
| 1242 | (defvar x-fixed-font-alist | 1242 | (defvar x-fixed-font-alist |
| 1243 | '("Font menu" | 1243 | '("Font menu" |
| 1244 | ("Misc" | 1244 | ("Misc" |
| 1245 | ("6x10" "-misc-fixed-medium-r-normal--10-100-75-75-c-60-*-1") | 1245 | ("6x10" "-misc-fixed-medium-r-normal--10-100-75-75-c-60-*-1" "6x10") |
| 1246 | ("6x12" "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-*-1") | 1246 | ("6x12" "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-*-1" "6x12") |
| 1247 | ("6x13" "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-1") | 1247 | ("6x13" "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-1" "6x13") |
| 1248 | ("lucida 13" | 1248 | ("lucida 13" |
| 1249 | "-b&h-lucidatypewriter-medium-r-normal-sans-0-0-0-0-m-0-*-1") | 1249 | "-b&h-lucidatypewriter-medium-r-normal-sans-0-0-0-0-m-0-*-1") |
| 1250 | ("7x13" "-misc-fixed-medium-r-normal--13-120-75-75-c-70-*-1") | 1250 | ("7x13" "-misc-fixed-medium-r-normal--13-120-75-75-c-70-*-1" "7x13") |
| 1251 | ("7x14" "-misc-fixed-medium-r-normal--14-130-75-75-c-70-*-1") | 1251 | ("7x14" "-misc-fixed-medium-r-normal--14-130-75-75-c-70-*-1" "7x14") |
| 1252 | ("9x15" "-misc-fixed-medium-r-normal--15-140-*-*-c-*-*-1") | 1252 | ("9x15" "-misc-fixed-medium-r-normal--15-140-*-*-c-*-*-1" "9x15") |
| 1253 | ("") | 1253 | ("") |
| 1254 | ("clean 8x8" "-schumacher-clean-medium-r-normal--*-80-*-*-c-*-*-1") | 1254 | ("clean 8x8" "-schumacher-clean-medium-r-normal--*-80-*-*-c-*-*-1") |
| 1255 | ("clean 8x14" "-schumacher-clean-medium-r-normal--*-140-*-*-c-*-*-1") | 1255 | ("clean 8x14" "-schumacher-clean-medium-r-normal--*-140-*-*-c-*-*-1") |
| @@ -1298,37 +1298,47 @@ and selects that window." | |||
| 1298 | ) | 1298 | ) |
| 1299 | "X fonts suitable for use in Emacs.") | 1299 | "X fonts suitable for use in Emacs.") |
| 1300 | 1300 | ||
| 1301 | (defun mouse-set-font (&optional font) | 1301 | (defun mouse-set-font (&rest fonts) |
| 1302 | "Select an emacs font from a list of known good fonts" | 1302 | "Select an emacs font from a list of known good fonts" |
| 1303 | (interactive | 1303 | (interactive |
| 1304 | (x-popup-menu last-nonmenu-event x-fixed-font-alist)) | 1304 | (x-popup-menu last-nonmenu-event x-fixed-font-alist)) |
| 1305 | (if font | 1305 | (let (font) |
| 1306 | (progn (modify-frame-parameters (selected-frame) | 1306 | (setq foo font bar fonts) |
| 1307 | (list (cons 'font font))) | 1307 | (while fonts |
| 1308 | ;; Update some standard faces too. | 1308 | (condition-case nil |
| 1309 | (set-face-font 'bold nil (selected-frame)) | 1309 | (progn |
| 1310 | (make-face-bold 'bold (selected-frame) t) | 1310 | (modify-frame-parameters (selected-frame) |
| 1311 | (set-face-font 'italic nil (selected-frame)) | 1311 | (list (cons 'font (car fonts)))) |
| 1312 | (make-face-italic 'italic (selected-frame) t) | 1312 | (setq font (car fonts)) |
| 1313 | (set-face-font 'bold-italic nil (selected-frame)) | 1313 | (setq fonts nil)) |
| 1314 | (make-face-bold-italic 'bold-italic (selected-frame) t) | 1314 | (error (setq fonts (cdr fonts))))) |
| 1315 | ;; Update any nonstandard faces whose definition is | 1315 | (if font |
| 1316 | ;; "a bold/italic/bold&italic version of the frame's font". | 1316 | (progn |
| 1317 | (let ((rest global-face-data)) | 1317 | ;; Update some standard faces too. |
| 1318 | (while rest | 1318 | (set-face-font 'bold nil (selected-frame)) |
| 1319 | (condition-case nil | 1319 | (make-face-bold 'bold (selected-frame) t) |
| 1320 | (if (listp (face-font (cdr (car rest)))) | 1320 | (set-face-font 'italic nil (selected-frame)) |
| 1321 | (let ((bold (memq 'bold (face-font (cdr (car rest))))) | 1321 | (make-face-italic 'italic (selected-frame) t) |
| 1322 | (italic (memq 'italic (face-font (cdr (car rest)))))) | 1322 | (set-face-font 'bold-italic nil (selected-frame)) |
| 1323 | (if (and bold italic) | 1323 | (make-face-bold-italic 'bold-italic (selected-frame) t) |
| 1324 | (make-face-bold-italic (car (car rest)) (selected-frame)) | 1324 | ;; Update any nonstandard faces whose definition is |
| 1325 | (if bold | 1325 | ;; "a bold/italic/bold&italic version of the frame's font". |
| 1326 | (make-face-bold (car (car rest)) (selected-frame)) | 1326 | (let ((rest global-face-data)) |
| 1327 | (if italic | 1327 | (while rest |
| 1328 | (make-face-italic (car (car rest)) (selected-frame))))))) | 1328 | (condition-case nil |
| 1329 | (error nil)) | 1329 | (if (listp (face-font (cdr (car rest)))) |
| 1330 | (setq rest (cdr rest)))) | 1330 | (let ((bold (memq 'bold (face-font (cdr (car rest))))) |
| 1331 | ))) | 1331 | (italic (memq 'italic (face-font (cdr (car rest)))))) |
| 1332 | (if (and bold italic) | ||
| 1333 | (make-face-bold-italic (car (car rest)) (selected-frame)) | ||
| 1334 | (if bold | ||
| 1335 | (make-face-bold (car (car rest)) (selected-frame)) | ||
| 1336 | (if italic | ||
| 1337 | (make-face-italic (car (car rest)) (selected-frame))))))) | ||
| 1338 | (error nil)) | ||
| 1339 | (setq rest (cdr rest)))) | ||
| 1340 | ) | ||
| 1341 | (error "Font not found")))) | ||
| 1332 | 1342 | ||
| 1333 | ;;; Bindings for mouse commands. | 1343 | ;;; Bindings for mouse commands. |
| 1334 | 1344 | ||