Path: utzoo!mnetor!uunet!mcvax!ukc!warwick!cudcv From: cudcv@daisy.warwick.ac.uk (Rob McMahon) Newsgroups: comp.emacs Subject: Changing major mode in server mode Message-ID: <480@sol.warwick.ac.uk> Date: 15 Mar 88 09:12:15 GMT Reply-To: cudcv@cu.warwick.ac.uk (Rob McMahon) Organization: Computing Services, Warwick University, UK Lines: 39 I've just installed emacs 18.50, and have a couple of problems with M-x server-start/emacsclient. The first is more a comment than a problem. In an NFS environment, you can't have a server running on more than one machine, because each uses the same rendezvous point, and each new invocation of the server removes the socket the other machine had created. Maybe it should be using something like ("%s/.emacsclient.%s", getenv("HOME"), gethostname()) ? This isn't much of a problem for me, since I do most of the things I'd want a server for on the same machine. The second problem is if I change major mode in the buffer created in the server emacs, it calls kill-all-local-variables, which includes server-buffer-clients, which means C-x# doesn't work any more. I know I can usually end up in the right mode by tacking things onto auto-mode-alist, or by setting default-major-mode, but often I want to switch modes: I'm replying to someone's mail, and I want to include a bit of C, so I switch to c-mode for a while: I'm writing a C program and I want to insert a block comment, so I switch to text-mode for a while. Is there any way round this ? Can I protect server-buffer-clients for a while, or can I 'push' a mode and then exit it leaving all my variables the way they were before ? Or do I have to write my own alternatives to c-mode and text-mode (and tex-mode, and ...) that don't call kill-all-local-variables ? Thanks, Rob -- UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick.cu ARPA: cudcv@cu.warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England