Gnus development mailing list
 help / color / mirror / Atom feed
* Evaluate local variables in buffer
@ 1997-08-18  5:49 Matt Simmons
  1997-08-18 21:43 ` Colin Rafferty
  1997-08-20 18:25 ` Mark Eichin
  0 siblings, 2 replies; 5+ messages in thread
From: Matt Simmons @ 1997-08-18  5:49 UTC (permalink / 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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-08-21  7:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-18  5:49 Evaluate local variables in buffer Matt Simmons
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

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).