;;; cycle-font.el ;;; ;;; Copyright (C) 2006, 2007, 2008 Thien-Thi Nguyen ;;; ;;; This file is part of ttn's personal elisp library, released under ;;; the terms of the GNU General Public License as published by the ;;; Free Software Foundation; either version 3, or (at your option) any ;;; later version. There is NO WARRANTY. See file COPYING for details. ;;; ;;; Description: Cycle through a ring of preferred fonts. (defvar my-font-ring (let ((ls '("fixed" "lucidasanstypewriter-18" "lucidasanstypewriter-12" "lucidasanstypewriter-14" "9x15" "10x20" "lucidasanstypewriter-24"))) (setcdr (last ls) ls) ls) "A ring of fonts used by `cycle-font'.") ;;;###autoload (defun cycle-font (&optional peek-only) "Set font for the current frame to the first of `my-font-ring'. Display the new font name in the echo area, and rotate the ring. Prefix arg PEEK-ONLY means skip the setting and the rotation." (interactive "P") (let ((new (car my-font-ring))) (unless peek-only (set-default-font new) (setq my-font-ring (cdr my-font-ring))) (message "%s" new))) ;;; cycle-font.el ends here