commit:     861907399599cf20e263e33eae98a1652e4dfc12
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 20 18:38:05 2025 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Jul 21 16:22:06 2025 +0000
URL:        https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=86190739

Handle empty %F in emacsclient.desktop

* emacsclient.desktop (Exec): Add a shell wrapper, in order to
pass the "-c" option when called with an empty list of files.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog           | 3 +++
 emacsclient.desktop | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index f01beae..acb29a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2025-07-20  Ulrich Müller  <[email protected]>
 
+       * emacsclient.desktop (Exec): Add a shell wrapper, in order to
+       pass the "-c" option when called with an empty list of files.
+
        * emacs.desktop (Comment):
        * emacsclient.desktop (Name, Comment): Update.
 

diff --git a/emacsclient.desktop b/emacsclient.desktop
index 9dc9172..40e96cc 100644
--- a/emacsclient.desktop
+++ b/emacsclient.desktop
@@ -8,7 +8,7 @@ Comment[es]=Abrir un archivo en un Emacs en ejecución
 Comment[fr]=Ouvre un fichier dans une instance d'Emacs qui est déjà lancée
 Icon=emacs
 TryExec=/usr/bin/emacsclient
-Exec=/usr/bin/emacsclient %F
+Exec=/bin/sh -c "exec /usr/bin/emacsclient \\"\\${@:--c}\\"" sh %F
 Terminal=false
 
MimeType=text/css;text/english;text/html;text/plain;text/x-c;text/x-chdr;text/x-csrc;text/x-c++;text/x-c++hdr;text/x-c++src;text/x-java;text/x-makefile;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;x-scheme-handler/org-protocol;
 Categories=Development;TextEditor;

Reply via email to