From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: emacs init and mode-maps Date: Thu, 22 Jun 2006 11:22:11 +0200 Organization: Organization?!? Message-ID: <85d5d1sfy4.fsf@lola.goethe.zz> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1150969373 31856 80.91.229.2 (22 Jun 2006 09:42:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Jun 2006 09:42:53 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 22 11:42:50 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FtLhv-0003vI-8U for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Jun 2006 11:42:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FtLht-0002dZ-Vm for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Jun 2006 05:42:38 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.isc.org!news.glorb.com!proxad.net!proxad.net!newsfeed.arcor.de!news.arcor.de!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:EUJ4dGBZGXVkkViyQR8SZBd0L9o= Original-Lines: 30 Original-NNTP-Posting-Date: 22 Jun 2006 11:22:45 MEST Original-NNTP-Posting-Host: aae1ec79.newsread2.arcor-online.net Original-X-Trace: DXC=GdMbfHAZ=WLndh]; 1CKbgLQ5U85hF6f; DjW\KbG]kaMHVA=iV<7g:2EZ:d?A`PX9KLQ1Yo0:e7@PKc[Wn>\JAZH@1\F@YcEWMRLCOZTGL=7[PM Original-X-Complaints-To: usenet-abuse@arcor.de Original-Xref: shelby.stanford.edu gnu.emacs.help:139969 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35593 Archived-At: Reiner Steib 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