unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
Subject: Re: emacs init and mode-maps
Date: Thu, 22 Jun 2006 11:22:11 +0200	[thread overview]
Message-ID: <85d5d1sfy4.fsf@lola.goethe.zz> (raw)
In-Reply-To: v9u06d8t3s.fsf@marauder.physik.uni-ulm.de

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

  reply	other threads:[~2006-06-22  9:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-22  7:17 emacs init and mode-maps Andreas Roehler
2006-06-22  8:58 ` Reiner Steib
2006-06-22  9:22   ` David Kastrup [this message]
2006-06-22 10:02     ` Reiner Steib
2006-06-22 13:58       ` Andreas Roehler
2006-06-22 14:44         ` David Kastrup
2006-06-23 10:38           ` Andreas Roehler
2006-06-23 10:54             ` David Kastrup
2006-06-23 20:51               ` Kevin Rodgers
2006-06-23 22:08                 ` Slawomir Nowaczyk
2006-06-26 16:12                   ` Kevin Rodgers
2006-06-27 12:03                     ` Slawomir Nowaczyk
2006-06-24  6:04               ` Andreas Roehler
2006-06-23 10:38           ` Andreas Roehler
2006-06-24 11:01             ` Peter Dyballa
     [not found]             ` <mailman.3284.1151146887.9609.help-gnu-emacs@gnu.org>
2006-06-25  7:14               ` Andreas Roehler
2006-06-25  9:54                 ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85d5d1sfy4.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).