[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs init and mode-maps
From: |
David Kastrup |
Subject: |
Re: emacs init and mode-maps |
Date: |
Thu, 22 Jun 2006 11:22:11 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Reiner Steib <reinersteib+gmane@imap.cc> writes:
> On Thu, Jun 22 2006, Andreas Roehler wrote:
>
>> After defining a key in my emacs init file
>>
>> (define-key sh-mode-map "\M-#" 'variable-anlegen)
>>
>> emacs refused further loading and I got the following error
>>
>> "Symbol's value as variable is void: sh-mode-map".
>>
>> Meanwhile I know, that
>> (require 'sh-script)
>>
>> in the init file before will solve the problem.
>>
>> Nonetheless, I consider this error as not appropriate,
>> as defining mode-keys in init files is a common task.
>
> Use `eval-after-load' or a mode hook.
(add-hook 'sh-mode-hook (lambda nil
(define-key sh-mode-map "\M-#" 'variable-anlegen)))
Would be sort of the usual way to do this. eval-after-load is rather
an emergency measure and not desirable here.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
- emacs init and mode-maps, Andreas Roehler, 2006/06/22
- Re: emacs init and mode-maps, Reiner Steib, 2006/06/22
- Re: emacs init and mode-maps,
David Kastrup <=
- Re: emacs init and mode-maps, Reiner Steib, 2006/06/22
- Re: emacs init and mode-maps, Andreas Roehler, 2006/06/22
- Re: emacs init and mode-maps, David Kastrup, 2006/06/22
- Re: emacs init and mode-maps, Andreas Roehler, 2006/06/23
- Re: emacs init and mode-maps, David Kastrup, 2006/06/23
- Re: emacs init and mode-maps, Kevin Rodgers, 2006/06/23
- Re: emacs init and mode-maps, Slawomir Nowaczyk, 2006/06/23
- Re: emacs init and mode-maps, Kevin Rodgers, 2006/06/26
- Re: emacs init and mode-maps, Slawomir Nowaczyk, 2006/06/27
- Re: emacs init and mode-maps, Andreas Roehler, 2006/06/24