0

I just installed Ubuntu 18.04 and GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) on my Lenovo W541 laptop. Under this new installation, the emacs server & emacsclient functionality no longer works. Invoking "emacsclient" at the command prompt tells me

emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".

But when I try to server-start in emacs,

‘server-start’ is an obsolete command; use ‘gnuserv-start’ instead.
Server subprocess exited
You can run the command ‘server-start’ with M-x ser-s RET
Server subprocess exited

Is the solution just to (as suggested) install gnuserv instead?

UPDATE 1 In response to @waltinator 's suggestion, I enter ^H+f server-start and get the response:

server-start is an interactive autoloaded Lisp function in
‘server.el’.
(server-start &optional LEAVE-DEAD)
This function is obsolete;
use ‘gnuserv-start’ instead.
Use ‘gnuserv-start’ instead of this function.
Allow this Emacs process to be a server for client processes.
This starts a server communications subprocess through which
client "editors" can send your editing commands to this Emacs job.
To use the server, set up the program ‘emacsclient’ in the
Emacs distribution as your standard "editor".
--
Prefix arg means just kill any existing server communications subprocess.

But there is still no match for 'gnuserv-start', nor is it clear online how to install it (pages typically note that it should come installed with Emacs). Thoughts?

  • I'd try M-x gnuserv-start – waltinator Mar 21 '19 at 2:48
  • @waltinator - Yes, but when I try that the minibuffer tells me "[no match]" and refuses to do anything more. – Kreuzfeld Mar 21 '19 at 11:53
  • 1
    Debugging .emacs is hard. Does ^H-f server-start say server-start is an interactive autoloaded compiled Lisp function in 'server.el'.? Do you have a file called /usr/share/emacs/26.1/lisp/server.elc? – waltinator Mar 21 '19 at 17:17
  • @waltinator - I know Meta and I know Ctrl, but what is ^H? The compiled 'server.elc' file does exist. Many thanks. – Kreuzfeld Mar 21 '19 at 20:57
  • ^H means "Hold down the Ctrl key while typing H. – waltinator Mar 21 '19 at 21:34
0

It turned out that the solution was to put the following lines in my .emacs startup file:

(autoload 'gnuserv-start "gnuserv-compat"
         "Allow this Emacs process to be a server for client   processes."
         t)
(gnuserv-start)
(setq gnuserv-frame (selected-frame))

Then 'gnuclient filename &' opens 'filename' right into the main emacs buffer. Strange that 'emacsclient' no longer works, but... there you have it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.