From: Matt Simmons <simmonmt@acm.org>
Subject: Evaluate local variables in buffer
Date: 17 Aug 1997 22:49:55 -0700 [thread overview]
Message-ID: <yfqk9hkrqf0.fsf@acm.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]
I wrote a perl script that turns rdist output into a format suitable
for emacs outline-mode. However, to kick XEmacs into outline-mode, I
had to add Local Variables stuff to the end of the output. Much to my
surprise, Gnus didn't eval the local variables stuff by default, so I
set about making it do so.
I had to make a modification to hack-one-local-variable in
prim/files.el, since the default hack-one-local-variable is coded to
expect a buffer associated with a file. This is obviously not the
case with *Article*, so I added an if to check for buffers without
files.
I also had to add hack-local-variables to
gnus-article-display-hook. My question is this: Does GNU Emacs use a
different function for local variables evaluation? If so, could
something like gnus-article-eval-local-variables be created that would
call the appropriate function? I would write it myself, but I'm out
of easy range of Emacs sources for the next week or so.
Thanks
Matt
--
The difference between a bug and |
a feature is documentation. | Matt Simmons
-- Ben Duncan | simmonmt@acm.org
bend@ali.intop.net |
[-- Attachment #2: files.diff --]
[-- Type: application/octet-stream, Size: 1051 bytes --]
*** /p/local/xemacs-20.2/lib/xemacs-20.2/lisp/prim/files.el Wed Apr 23 23:00:09 1997
--- files.el Mon Aug 18 00:47:31 1997
***************
*** 1550,1557 ****
(beginning-of-line)
(set-window-start (selected-window) (point)))
(setq enable-local-eval
! (y-or-n-p (format "Process `eval' or hook local variables in file %s? "
! (file-name-nondirectory buffer-file-name))))))))
(if (eq var 'eval)
(save-excursion (eval val))
(make-local-variable var)
--- 1550,1560 ----
(beginning-of-line)
(set-window-start (selected-window) (point)))
(setq enable-local-eval
! (if buffer-file-name
! (y-or-n-p (format "Process `eval' or hook local variables in file %s? "
! (file-name-nondirectory buffer-file-name)))
! (y-or-n-p (format "Process `eval' or hook local variables in buffer %s? "
! (buffer-name)))))))))
(if (eq var 'eval)
(save-excursion (eval val))
(make-local-variable var)
next reply other threads:[~1997-08-18 5:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-08-18 5:49 Matt Simmons [this message]
1997-08-18 21:43 ` Colin Rafferty
1997-08-20 6:25 ` Matt Simmons
1997-08-20 18:25 ` Mark Eichin
1997-08-21 7:13 ` Matt Simmons
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yfqk9hkrqf0.fsf@acm.org \
--to=simmonmt@acm.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 NNTP newsgroup(s).