home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!news.u.washington.edu!news.u.washington.edu!ethanb
- From: ethanb@ptolemy.astro.washington.edu (Ethan Bradford)
- Newsgroups: comp.emacs
- Subject: Setting file-hooks (was Re: ELISP help needed)
- Message-ID: <ETHANB.92Nov11213926@ptolemy.astro.washington.edu>
- Date: 12 Nov 92 05:39:26 GMT
- Article-I.D.: ptolemy.ETHANB.92Nov11213926
- References: <1992Nov10.213638.11986@ims.com>
- Sender: news@u.washington.edu (USENET News System)
- Organization: U. of Washington
- Lines: 48
- In-Reply-To: gerdh@ims.com's message of 10 Nov 92 21:36:38 GMT
- To: gerdh@ims.com (Gerd Hoeren)
-
- The variables find-file-hooks and write-file-hooks expect their values
- to be *lists* of functions. Thus,
-
- (defun xyzzy ()
- (message "hello"))
-
- (setq find-file-hooks '(xyzzy))
-
- Will do what you were attempting, except that it will eliminate any
- other functions you already had in that variable. It is better to do
-
- (setq find-file-hooks (cons 'xyzzy find-file-hooks))
-
- to add your new function.
-
- In article <1992Nov10.213638.11986@ims.com> gerdh@ims.com (Gerd Hoeren) wrote:
-
- I'd like to connect an elisp function to the find-file-hooks and
- write-file-hooks. I seem to be missing something in my elisp syntax
- though.
-
- Suppose my function is just:
-
- (defun xyzzy ()
- (message "hello"))
-
- And I do an:
-
- (setq find-file-hooks 'xyzzy)
-
- Then, the next find-file will complain about:
-
- Wrong type argument: sequencep, xyzzy
-
- If I do the same with the write-file-hooks, I get:
-
- Wrong type argument: listp, xyzzy
-
- I've tried a number of variations on this syntax, but I'm not winning.
- Thanks in advance for the help!
-
- --------------------------------------
- Gerd Hoeren
- Integrated Measurement Systems, Inc.
- Voice: (503) 626-7117
- Fax: (503) 644-6969
- Email: gerdh@ims.com
- --------------------------------------
-