Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!rpi!rpi.edu!tale From: tale@pawl.rpi.edu (David C Lawrence) Newsgroups: comp.emacs Subject: Re: GNUemacs server/client mode Message-ID: Date: 8 Mar 89 15:19:44 GMT References: Sender: usenet@rpi.edu Reply-To: tale@pawl.rpi.edu Organization: The Octagon Room Lines: 47 In-reply-to: karl@triceratops.cis.ohio-state.edu's message of 8 Mar 89 13:36:03 GMT In article karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) writes: Karl> In your .emacs, put this line: Karl> (server-edit) That's peculiar. I have to do server-start, not -edit, it GNU Emacs 18.50.2. What version is server-edit from? Regardless, Joe Wells posted something useful a few moths ago. It seems as though there is a problem with changing the mode of a file you are editing via the server. kill-all-local-variables, called by most major modes, trashes server-buffer-clients, making the C-x # effectively disabled. In order to circumvent this problem, kill-all-local-variables was slightly modified to preserve variables which have a "preserved" property. After you start the server you should immediately execute: (put 'server-buffer-clients 'preserved t) and add have the following short segment of code loaded however you like, probably in your .emacs. Good luck with it. Dave --- Cutline --- ;; 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))))) --- CUtline --- -- tale@rpitsmts.bitnet, tale%mts@rpitsgw.rpi.edu, tale@pawl.rpi.edu