From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Colin S. Miller" Newsgroups: gmane.emacs.help Subject: Re: increasing font size Date: Sat, 18 Feb 2006 17:47:14 +0000 Organization: SunSITE.dk - Supporting Open source Message-ID: <43f75d8b$0$15791$14726298@news.sunsite.dk> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1140297654 28282 80.91.229.2 (18 Feb 2006 21:20:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 18 Feb 2006 21:20:54 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 18 22:20:50 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FAZVZ-0000vA-1A for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Feb 2006 22:20:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FAZVY-0006fG-De for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Feb 2006 16:20:48 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news3.google.com!news.glorb.com!dotsrc.org!news.dotsrc.org!not-for-mail User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) X-Accept-Language: en-us, en Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 120 Original-NNTP-Posting-Host: 62.56.37.31 Original-X-Trace: news.sunsite.dk DXC=5f??`6Toe6=YSB=nbEKnk; 85kNb41G1[Bg<0aH50\VT\m5_SIb6U_42Df:PaK8TcL2h5ahoT?kF_>m>CYcV?[a\`18CK[_66LP4JZJU@X>BI8B>[i0M\; Original-X-Complaints-To: staff@sunsite.dk Original-Xref: shelby.stanford.edu gnu.emacs.help:137665 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:33290 Archived-At: Senthil wrote: > how do i increase the size of font appearing in emacs > should i edit something in my .emacs file > > -- > --------S.Senthil Kumaran------- > blog : http://sskganesan.blogspot.com > > Senthl, I've written this module which will do this, assuming you are not running in a console. However it only changes the base-font; if an emacs face sets the font size, then it won't be changed. This code was written for XEmacs, I haven't tested it on Emacs. You might need to tweek the list of font sizes, depending on which font face you use. However, if don't want to dynmically change the font size, you can use Options/Font Size to set the default and Options/Advanced (Customize)/Face to overide this for some faces. HTH, Colin S. Miller (defvar csm-base-font-sizes [14 16 17 19 20 22 25 26 27 29 31 32 33 35 38 40] "* Font list") (defun csm-base-font-inc () "Increases the default font" (interactive) (let ((curr-val) (index) (elem) (num-elems)) (progn (setq curr-val (string-to-number (custom-face-font-size 'default))) (setq index 0) (setq num-elems (length csm-base-font-sizes)) (while (progn (setq elem (elt csm-base-font-sizes index)) (setq index (+ index 1)) (and (< index num-elems) (< elem curr-val) ) ; or ) ; progn ) (progn (if (< index num-elems) (progn (setq new-val (elt csm-base-font-sizes index)) (if new-val (progn (custom-set-face-font-size 'default new-val) (display-message 'command (concat "New font size is " (number-to-string new-val) " points"))))) (display-message 'command "Font already at largest size") ) ; if ) ; progn ) ; progn ) ; let ) ; defun (defun csm-base-font-dec () "Decreases the default font" (interactive) (let ((curr-val) (index) (elem) (num-elems)) (progn (setq curr-val (string-to-number (custom-face-font-size 'default))) (setq index 0) (setq num-elems (length csm-base-font-sizes)) (while (progn (setq elem (elt csm-base-font-sizes index)) (setq index (+ index 1)) (and (< index num-elems) (< elem curr-val) ) ; or ) ; progn ) (progn (if (> index 1) (progn (setq index (- index 2)) (setq new-val (elt csm-base-font-sizes index)) (if new-val (progn (custom-set-face-font-size 'default new-val) (display-message 'command (concat "New font size is " (number-to-string new-val) " points"))))) (display-message 'command "Font already at smallest size") ) ; if ) ; progn ) ; progn ) ; let ) ; defun (define-key global-map [(control kp-subtract)] 'csm-base-font-dec ) (define-key global-map [(control kp-add)] 'csm-base-font-inc ) -- Replace the obvious in my email address with the first three letters of the hostname to reply.