From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ivan Kanis Newsgroups: gmane.emacs.help Subject: Re: Toggle Fonts without font-menue Date: 25 Sep 2002 19:45:49 +0200 Organization: Wanadoo, l'internet avec France Telecom Sender: help-gnu-emacs-admin@gnu.org Message-ID: <87elbi55f6.fsf@juliva.com> References: <32cc3ecd.0209230650.47e8633f@posting.google.com> <32cc3ecd.0209250004.7f15c144@posting.google.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1032977779 7550 127.0.0.1 (25 Sep 2002 18:16:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 25 Sep 2002 18:16:19 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17uGhu-0001xX-00 for ; Wed, 25 Sep 2002 20:16:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17uGi0-0003GZ-00; Wed, 25 Sep 2002 14:16:24 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!wanadoo.fr!127.0.0.1!nobody Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: mix-limoges-102-1-109.abo.wanadoo.fr Original-X-Trace: wanadoo.fr 1032977362 27382 193.248.147.109 (25 Sep 2002 18:09:22 GMT) Original-X-Complaints-To: abuse@wanadoo.fr Original-NNTP-Posting-Date: 25 Sep 2002 18:09:22 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Xref: nntp.stanford.edu gnu.emacs.help:105313 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1865 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1865 David> Well yes, the fontset solution is probably more elegant! David> But I'm not really an expert in these things and simply David> switching the default is an easy way of obtaining my David> goal. Well I am embarassed to post this code here because it is butt ugly. It seems to do what you want. You just need to replace "fixed" and "adobe-...." with the fonts you need. It is bound to C-c j but you can bind to whatever key combination you want. Hope you find it useful. (global-set-key "\C-cj" 'my-toggle-font) ; Toggle between large and small font, the large font is useful for reading ; Japanese (setq ivan-fixed-font t) (defun my-toggle-font() (interactive) (if (eval 'ivan-fixed-font) (progn (set-frame-font "-adobe-courier-medium-r-normal--*-240-*-*-m-*-iso8859-1") ;; TBD remove hard coded value! (set-frame-height (selected-frame) 47) (setq ivan-fixed-font nil)) (progn (set-frame-font "fixed") ;; TBD remove hard coded value! (set-frame-height (selected-frame) 87) (setq ivan-fixed-font t))))