🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #189108

Re: Trouble with find-file-hooks

#189108
From: Barry Margolin
Date: Thu, 02 May 1991 16:29
21 lines
1391 bytes
In article <BROWNING.91Apr27231818@ew10.nas.nasa.gov> browning@nas.nasa.gov (David S. Browning) writes:
>What am I doing wrong here?  I'm a novice elisp programmer, I've
>studied the manual, and I'm stuck.
...
>(setq find-file-hooks '(lambda () ...))
...
>Symbol's function definition is void: lambda

The key is that the variable's name is plural, "hooks", so it expects the
value to be a list of functions, and you set it to a single function.  It
tried to use lambda as the name of the first hook, and got this error.

You should use defun to define the function you want (I'll assume you call
it "fix-mode-line"), and then do

(setq find-file-hooks (cons 'fix-mode-line find-file-hooks))
--
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar
Technical Details
Message-ID: <1991May2.162944.15241@Think.COM>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!samsung!think.com!barmar
References: <BROWNING.91Apr27231818@ew10.nas.nasa.gov>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,b30da067b3069980
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-05-02 19:23:59 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!samsung!think.com!barmar
From: barmar@think.com (Barry Margolin)
Newsgroups: gnu.emacs.help
Subject: Re: Trouble with find-file-hooks
Message-ID: <1991May2.162944.15241@Think.COM>
Date: 2 May 91 16:29:44 GMT
References: <BROWNING.91Apr27231818@ew10.nas.nasa.gov>
Sender: news@Think.COM
Distribution: gnu
Organization: Thinking Machines Corporation, Cambridge MA, USA
Lines: 21