LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-24-2010, 01:13 PM   #1
evaristegalois
Member
 
Registered: Sep 2006
Distribution: Ubuntu 14.04
Posts: 33

Rep: Reputation: 15
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?
 
Old 02-24-2010, 02:14 PM   #2
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Debian, SL
Posts: 5,318

Rep: Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141
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.

Last edited by evo2; 02-24-2010 at 02:16 PM.
 
Old 02-24-2010, 08:14 PM   #3
evaristegalois
Member
 
Registered: Sep 2006
Distribution: Ubuntu 14.04
Posts: 33

Original Poster
Rep: Reputation: 15
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.
 
Old 02-25-2010, 08:21 AM   #4
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Debian, SL
Posts: 5,318

Rep: Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141Reputation: 1141
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.
 
Old 02-25-2010, 10:06 AM   #5
evaristegalois
Member
 
Registered: Sep 2006
Distribution: Ubuntu 14.04
Posts: 33

Original Poster
Rep: Reputation: 15
You are right. If I change everything back to emacs22 it works. I guess I'll have to work around that somehow.
 
Old 06-30-2010, 04:28 AM   #6
mashdot
LQ Newbie
 
Registered: Nov 2004
Posts: 4

Rep: Reputation: 0
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
 
  


Reply

Tags
emacs, mutt


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to customize emacs22-gtk in hardy?? vlyamtse Linux - Newbie 1 08-31-2009 11:10 AM
launching emacs-snapshot with the emacs command pamparana Linux - Newbie 1 07-21-2009 01:05 PM
Alt no longer META key when using in-terminal option of Emacs (emacs -nw) frznchckn Linux - Software 1 06-02-2007 02:41 AM
Vim/Emacs on Gnome/Gtk ernesto_cgf Linux - Desktop 0 01-23-2007 10:03 AM
Suse 10.0 opens Just Opens In Console ? bluesky2_1986 Linux - Newbie 2 07-24-2006 07:17 AM


All times are GMT -5. The time now is 05:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration