Dear Ubuntu Community,
my goal is it, to use emacsclient (version 24.5.1) as a default editor in Ubuntu 16.04. If I double click on a text file, emacsclient opens new frame quickly. If the the the daemon is not running, it will start one.
If I run my emacsclient command (emacsclient -c -a="") in the terminal, everything works fine. If I start emacs the first time, it will start emacs-server even though I do not run emacs-server in my .emacs/.init file. If the daemon is already running emacs opens a new frame. But I want to use emacsclient in my GUI (Unity) as well. According to this I added the following text to ~/.local/share/application/emacsclient.desktop:
[Desktop Entry]
Name=Emacs (Client)
GenericName=Text Editor
Comment=Edit text
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=emacsclient -с -a "emacs" %F
Icon=emacs
Type=Application
Terminal=false
Categories=Development;TextEditor;Utility;
StartupWMClass=Emacs
And also added:
export ALTERNATE_EDITOR=""
export EDITOR="emacsclient -c"
export VISUAL="emacsclient -c -a emacs"
to my ~/.bashrc
When I now right-click on a text file in can choose to open it with "Emacs (Client)". The launcher symbol appears, but no frame opens. After like 10 seconds the symbols disappears again. If I go back to emacsclient.desktop and change the Execline to:
Exec=emacsclient -a "emacs" %F
it will open the file accordingly; meaning if no daemon is running, it starts emacs. If an emacsclient is already open, it will open the file in the already existing frame similar to this post.
What am I doing wrong, or is the -c option not compatible with desktop applications?
Greetings, Andi