unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* abbrev again
@ 2009-07-20 14:04 harven
  2009-07-20 23:11 ` A.Politz
  0 siblings, 1 reply; 3+ messages in thread
From: harven @ 2009-07-20 14:04 UTC (permalink / raw)
  To: help-gnu-emacs

I would like to use some abbrev table for one file only.
The table is defined in my .emacs. I tried to put in the file
-*- abbrev-mode: t; local-abbrev-table: my-abbrev-table -*-

When the file is loaded, abbreviation mode is activated, 
but my table is not recognized. If I then evaluate 
(setq local-abbrev-table my-abbrev-table)
then it works.

How can I specify which abbrev table should be loaded in the file itself ?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: abbrev again
  2009-07-20 14:04 abbrev again harven
@ 2009-07-20 23:11 ` A.Politz
  2009-07-21 12:04   ` harven
  0 siblings, 1 reply; 3+ messages in thread
From: A.Politz @ 2009-07-20 23:11 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 20, 4:04 pm, harven <har...@free.fr> wrote:
> I would like to use some abbrev table for one file only.
> The table is defined in my .emacs. I tried to put in the file
> -*- abbrev-mode: t; local-abbrev-table: my-abbrev-table -*-
>
> When the file is loaded, abbreviation mode is activated,
> but my table is not recognized. If I then evaluate
> (setq local-abbrev-table my-abbrev-table)
> then it works.
>
> How can I specify which abbrev table should be loaded in the file itself ?


I think the problem is, that the values of file-local-variables
are not evaluated. This in effect assigns the symbol `my-abbrev-table'
to the variable `local-abbrev-table' rather than its value
(the actual table).

One way of fixing it is using the special eval form

-*- eval: (setq local-abbrev-table my-abbrev-table); abbrev-mode: t -
*-

and adding this form (and forms for other table-symbols you plan to
use in this way) to `safe-local-eval-forms'.

(push '(setq local-abbrev-table my-abbrev-table) safe-local-eval-
forms)

-ap


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: abbrev again
  2009-07-20 23:11 ` A.Politz
@ 2009-07-21 12:04   ` harven
  0 siblings, 0 replies; 3+ messages in thread
From: harven @ 2009-07-21 12:04 UTC (permalink / raw)
  To: help-gnu-emacs

"A.Politz" <politza@googlemail.com> writes:

> On Jul 20, 4:04 pm, harven <har...@free.fr> wrote:
>> I would like to use some abbrev table for one file only.
>> The table is defined in my .emacs. I tried to put in the file
>> -*- abbrev-mode: t; local-abbrev-table: my-abbrev-table -*-
>>
>> When the file is loaded, abbreviation mode is activated,
>> but my table is not recognized. If I then evaluate
>> (setq local-abbrev-table my-abbrev-table)
>> then it works.
>>
>> How can I specify which abbrev table should be loaded in the file itself ?
>
>
> I think the problem is, that the values of file-local-variables
> are not evaluated. This in effect assigns the symbol `my-abbrev-table'
> to the variable `local-abbrev-table' rather than its value
> (the actual table).
>
> One way of fixing it is using the special eval form
>
> -*- eval: (setq local-abbrev-table my-abbrev-table); abbrev-mode: t -
> *-
>
> and adding this form (and forms for other table-symbols you plan to
> use in this way) to `safe-local-eval-forms'.
>
> (push '(setq local-abbrev-table my-abbrev-table) safe-local-eval-
> forms)
>
> -ap

That works, thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-21 12:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-20 14:04 abbrev again harven
2009-07-20 23:11 ` A.Politz
2009-07-21 12:04   ` harven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).