emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] bug with org-mode-hook and text-scale-set


From: David Maus
Subject: Re: [O] bug with org-mode-hook and text-scale-set
Date: Wed, 14 Mar 2012 06:41:09 +0100
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/24.0.94 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

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
> 
> steps to recreate:
> 
> emacs -q
> 
> 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))) 
> 
> M-x eval-buffer
> 
> then C-x C-f to open a .txt file, and then C-x C-f to open another .txt file.
> 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'.
| 
| (text-scale-set LEVEL)
| 
| 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 disabled.
| 
| 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
-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden

Attachment: pgpUvsHeNQDOS.pgp
Description: OpenPGP Digital Signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]