Article View: gnu.emacs.bug
Article #1644Re: revert-buffer in server-edit mode
From: David C Lawrence
Date: Fri, 28 Apr 1989 17:59
Date: Fri, 28 Apr 1989 17:59
38 lines
1987 bytes
1987 bytes
Shucks, dis is one o' dem dere "frequently heard bugs". Maybe we'll
get lucky and have them change it in the distribution for Version 19.
In the meantime, you can avoid the problem by using these handy lisp
segments.
;; Enhancement to kill-all-local-variables, author Joe Wells
;; jbw%bucsf.bu.edu@bu-it.bu.edu (school year)
;; joew%uswest@boulder.colorado.edu (summer)
;; save the original subr function definition of kill-all-local-variables
(or (fboundp 'original-kill-all-local-variables)
(fset 'original-kill-all-local-variables
(symbol-function 'kill-all-local-variables)))
(defun kill-all-local-variables ()
"Eliminate all the buffer-local variable values of the current
buffer. This buffer will then see the default values of all
variables. NOTE: This function has been modified to ignore
buffer-local variables whose preserved property is non-nil."
(let ((oldvars (buffer-local-variables)))
(original-kill-all-local-variables)
(while oldvars
(let ((var (car (car oldvars))))
(cond ((get var 'preserved)
(make-local-variable var)
(set var (cdr (car oldvars))))))
(setq oldvars (cdr oldvars)))))
And when you fire up your server,
(put 'server-buffer-clients 'preserved t)
Not only will revert-buffer stick you normally, but invoking almost
any major mode will because they run (kill-all-local-variables). Dems
de breaks.
Dave
--
tale@rpitsmts.bitnet, tale%mts@itsgw.rpi.edu, tale@pawl.rpi.edu
Technical Details
Message-ID:
<TALE.89Apr28135946@imagine.pawl.rpi.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!rpi!rpi.edu!taleReferences:
<8904281205.AA02231@PIT-MANAGER.MIT.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!rpi!rpi.edu!tale From: tale@pawl.rpi.edu (David C Lawrence) Newsgroups: gnu.emacs.bug Subject: Re: revert-buffer in server-edit mode Message-ID: <TALE.89Apr28135946@imagine.pawl.rpi.edu> Date: 28 Apr 89 17:59:46 GMT References: <8904281205.AA02231@PIT-MANAGER.MIT.EDU> Sender: usenet@rpi.edu Reply-To: tale@pawl.rpi.edu Distribution: gnu Lines: 38 In-reply-to: jik@ATHENA.MIT.EDU's message of 28 Apr 89 12:05:48 GMT