From mboxrd@z Thu Jan 1 00:00:00 1970 From: Du Yanning Subject: Re: bug with org-mode-hook and text-scale-set Date: Wed, 14 Mar 2012 15:46:11 +0800 Message-ID: References: <87r4wveo3u.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=00151747bd0c4d7db704bb2f2b18 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7iuW-0007c9-VW for emacs-orgmode@gnu.org; Wed, 14 Mar 2012 03:46:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7iuU-0001ya-DY for emacs-orgmode@gnu.org; Wed, 14 Mar 2012 03:46:16 -0400 Received: from mail-bk0-f41.google.com ([209.85.214.41]:41727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7iuU-0001yS-07 for emacs-orgmode@gnu.org; Wed, 14 Mar 2012 03:46:14 -0400 Received: by bkwq16 with SMTP id q16so1290640bkw.0 for ; Wed, 14 Mar 2012 00:46:11 -0700 (PDT) In-Reply-To: <87r4wveo3u.wl%dmaus@ictsoc.de> 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: David Maus Cc: emacs-orgmode --00151747bd0c4d7db704bb2f2b18 Content-Type: text/plain; charset=ISO-8859-1 text-mode-hook and c-mode-hook do NOT have this bug. and the org-mode-hook of orgmode shipped within emacs 23.3 does NOT have this bug. On Wed, Mar 14, 2012 at 1:41 PM, David Maus wrote: > 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.... dmjena@jabber.org > Email..... dmaus@ictsoc.de --00151747bd0c4d7db704bb2f2b18 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable text-mode-hook and c-mode-hook do NOT have this bug.
and the org-mode-ho= ok of orgmode shipped within emacs 23.3 does NOT have this bug.


=
On Wed, Mar 14, 2012 at 1:41 PM, David Maus <dmaus@ictsoc.de>= ; wrote:
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\\'" . or= g-mode))
> (add-hook 'org-mode-hook '(lambda () (text-scale-set 4)))=A0 >
> M-x eval-buffer
>
> then C-x C-f to open a .txt file, and then C-x C-f to open another .tx= t 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 e= rror. 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.<= br> | If LEVEL is non-zero, `text-scale-mode' is enabled, otherwise it is d= isabled.
|
| LEVEL is a number of steps, with 0 representing the default size.
| Each step scales the height of the default face by the variable
| =A0 =A0 =A0 =A0 =A0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| `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,
=A0-- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

--00151747bd0c4d7db704bb2f2b18--