[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add hook for one mode only
From: |
henry atting |
Subject: |
Re: Add hook for one mode only |
Date: |
Sun, 28 Dec 2008 12:41:37 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Zitat - Teemu Likonen * So Dez 28 2008 um 11:30 -
> henry atting (2008-12-28 10:00 +0100) wrote:
>
>> I want to change the tab-stop-list for ledger-mode only, so I thougt
>> this way would be a good idea:
>>
>> (add-hook 'ledger-mode-hook
>> (function (lambda ()
>> (setq tab-stop-list (quote (4 56)))
>> )))
>>
>> It is but only partially, because after leaving ledger-mode this setting
>> is kept for all other modes as well.
>
> "tab-stop-list" is a variable which does not automatically became
> buffer-local. This means that normally you only define the global value.
> Fortunately you can make it buffer-local for the current buffer with
> function "make-local-variable", so this is likely what you want:
>
> (add-hook 'ledger-mode-hook
> '(lambda ()
> (make-local-variable 'tab-stop-list)
> (setq tab-stop-list '(4 56))))
Yes, it works well, thanks!
henry