summaryrefslogtreecommitdiff
path: root/etc/emacsclient.desktop
diff options
context:
space:
mode:
authorPeter Oliver <git@mavit.org.uk>2021-06-30 15:11:21 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-06-30 15:11:21 +0200
commitcbf220bc31c0a00c45b22c140eda7854d81d991b (patch)
treec187d6e041a6c59836076c66c0a5796653a7b12a /etc/emacsclient.desktop
parentf355f32e69b1389f7d51b8a50c0a9c064dc2cb32 (diff)
downloademacs-cbf220bc31c0a00c45b22c140eda7854d81d991b.tar.gz
From .desktop files, reuse a frame or start a new Emacs as required
* doc/emacs/misc.texi: (Using Emacs as a Server) Explain emacsclient.desktop. * etc/NEWS: (Emacs Server): Explain emacsclient.desktop. * emacs-mail.desktop, etc/emacsclient.desktop: Automatically try to reuse an existing frame, open a new frame, or start a new Emacs daemon. Add actions for specific behaviours (bug#49195).
Diffstat (limited to 'etc/emacsclient.desktop')
-rw-r--r--etc/emacsclient.desktop11
1 files changed, 10 insertions, 1 deletions
diff --git a/etc/emacsclient.desktop b/etc/emacsclient.desktop
index f76fb2f..361051e 100644
--- a/etc/emacsclient.desktop
+++ b/etc/emacsclient.desktop
@@ -3,7 +3,7 @@ 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 -c %F
+Exec=sh -c 'if [ -n "$*" ]; then exec emacsclient --alternate-editor= --display="$DISPLAY" "$@"; else exec emacsclient --alternate-editor= --create-frame; fi' placeholder %F
Icon=emacs
Type=Application
Terminal=false
@@ -11,3 +11,12 @@ Categories=Development;TextEditor;
StartupNotify=true
StartupWMClass=Emacs
Keywords=Text;Editor;
+Actions=new-window;new-instance;
+
+[Desktop Action new-instance]
+Name=New Window
+Exec=emacsclient --alternate-editor= --create-frame %F
+
+[Desktop Action new-instance]
+Name=New Instance
+Exec=emacs %F