LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   emacsclient opens emacs22 instead of emacs-snapshot-gtk (https://www.linuxquestions.org/questions/linux-newbie-8/emacsclient-opens-emacs22-instead-of-emacs-snapshot-gtk-791315/)

evaristegalois 02-24-2010 01:13 PM

emacsclient opens emacs22 instead of emacs-snapshot-gtk
 
I am trying to set up mutt on ubuntu. I put set editor="emacsclient" in my muttrc, but I use emacs 23 (in ubuntu that would be emacs-snapshot-gtk). In mutt, when I try to write a message, it tries to open emacs 22. How can I tell either emacsclient or mutt that it needs to take me to emacs-snapshot-gtk and not to emacs?

evo2 02-24-2010 02:14 PM

All the below assumes that emacs is not already running with a server: ie emacsclient has nothing to connect to.

If emacs is not already running I think emacsclient will just try to start emacs, which it will probably find in /usr/bin/emacs. If you have more than one version of emacs install on your system /usr/bin/emacs will be a symlink to one of them. That link is controlled by the "alternatives" system. To change it run:

Code:

sudo update-alternatives --config emacs
and select the version of emacs you want.

If you don't want to use update alternatives (for example becuase there are other users who expect to get emacs22 when they run emacs), you can pass a flag to emacsclient to specify which emacs to use if there is not already a emacs running to connect to.
In mut set:
Code:

editor="emacsclient -a /usr/bin/emacs-snapshot-gtk"
or whatever the executable is.

HTH,

Evo2.

PS. I too use mutt and emacs. However I find that using a simple terminal based "emacs like" editor such as jed or zile to be better options as editors for mutt.

evaristegalois 02-24-2010 08:14 PM

I am just using mutt on my personal computer, so I am not worried about other users. Here is the line from my .muttrc:

Quote:

set editor="emacsclient"
This, after I did update-alternatives (which worked well) and changed 'emacs' to refer to 'emacs-snapshot-gtk', gives me the following mutt error:

Quote:

-error Unknown&_command:&_/tmp/mutt&-dudley&-1000&-16899&-0
(dudley is the name of my computer). If I change the line to

Quote:

set editor="emacs"
mutt (not surprisingly) opens a new instance of emacs and complains:

Warning (server): Unable to start the Emacs server. There is an existing Emacs server, named "server". To start the server in this Emacs process, stop the existing server or call `M-x server-force-delete' to forcibly disconnect it.

because emacs is already running somewhere else.

evo2 02-25-2010 08:21 AM

Quote:

I am just using mutt on my personal computer, so I am not worried about other users. Here is the line from my .muttrc:

Code:

set editor="emacsclient"

That looks good.

Quote:

This, after I did update-alternatives (which worked well) and changed 'emacs' to refer to 'emacs-snapshot-gtk', gives me the following mutt error:

Code:

-error Unknown&_command:&_/tmp/mutt&-dudley&-1000&-16899&-0

I have no idea what that error means. Does the above work if you use update-alternatives to swich back to emacs22, then start an instance of emacs22, and then try to edit a message in mutt? I just want to rule out the possibility that it is a problem with emacs-snapshot-gtk.

Evo2.

evaristegalois 02-25-2010 10:06 AM

You are right. If I change everything back to emacs22 it works. I guess I'll have to work around that somehow.

mashdot 06-30-2010 04:28 AM

Just so there is a record. I recently dist-upgraded which included emacs-snapshot. Had the very same error with mutt and emacsclient.

fix:

Code:

mash@specialk:~$ sudo update-alternatives --config emacsclient

There are 2 alternatives which provide `emacsclient'.

  Selection    Alternative
-----------------------------------------------
 +        1    /usr/bin/emacsclient.emacs22
*        2    /usr/bin/emacsclient.emacs-snapshot

Press enter to keep the default[*], or type selection number: 2



All times are GMT -5. The time now is 08:27 AM.