From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: bug with org-mode-hook and text-scale-set Date: Wed, 14 Mar 2012 06:41:09 +0100 Message-ID: <87r4wveo3u.wl%dmaus@ictsoc.de> References: Mime-Version: 1.0 (generated by SEMI-EPG 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Wed_Mar_14_06:41:07_2012-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7gxX-0005rQ-3b for emacs-orgmode@gnu.org; Wed, 14 Mar 2012 01:41:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7gxV-0001de-23 for emacs-orgmode@gnu.org; Wed, 14 Mar 2012 01:41:14 -0400 Received: from app1a.xlhost.de ([213.202.242.161]:43145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7gxU-0001dQ-RF for emacs-orgmode@gnu.org; Wed, 14 Mar 2012 01:41:12 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Du Yanning Cc: emacs-orgmode --pgp-sign-Multipart_Wed_Mar_14_06:41:07_2012-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, At Tue, 13 Mar 2012 14:49:41 +0800, Du Yanning wrote: > org-mode 7.8.03 > emacs 23.3, 23.4, 24.0.94 >=20 > steps to recreate: >=20 > emacs -q >=20 > copy the following code and paste it into the *scratch* buffer: > (add-to-list 'auto-mode-alist '("\\.txt\\'" . org-mode)) > (add-hook 'org-mode-hook '(lambda () (text-scale-set 4)))=C2=A0 >=20 > M-x eval-buffer >=20 > then C-x C-f to open a .txt file, and then C-x C-f to open another .txt f= ile. > Every time a .txt is opened, the font size become larger and larger. > However, the indicator in the mode line remains +4. I can confirm this behaviour but I don't think this is an error. The description of `text-scale-set' reads: C-h f text-scale-set RET ,---- | text-scale-set is an interactive autoloaded Lisp function in | `face-remap.el'. |=20 | (text-scale-set LEVEL) |=20 | Set the scale factor of the default face in the current buffer to LEVEL. | If LEVEL is non-zero, `text-scale-mode' is enabled, otherwise it is disab= led. |=20 | LEVEL is a number of steps, with 0 representing the default size. | Each step scales the height of the default face by the variable | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | `text-scale-mode-step' (a negative number decreases the height by | the same amount). `---- The first time `org-mode-hook' is run the height of default font is scaled by 4 levels, i.e. the height of default font is set to a new value. The second time `org-mode-hook' is run the height is scaled again, this time based on the new value. And so on. If you want to set the face height you might use: (set-face-attribute 'default nil :height 100) Here `100' means 100% of the font size in pt (afaik). Best, -- David --=20 OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Wed_Mar_14_06:41:07_2012-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit Content-Description: OpenPGP Digital Signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAk9gL3MACgkQDMLgk1Evc4XzYgEArUMlKC8s6Fmx2/Mh2m1pwJtL mB1HGmdZG2nPheMZIigA/0G78v5QD+rnwd7CCcHmh9TESjyMzpfVC0WONFntrRb+ =JzlG -----END PGP SIGNATURE----- --pgp-sign-Multipart_Wed_Mar_14_06:41:07_2012-1--