unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49986: Valid .desktop files
@ 2021-08-10 20:13 Peter Oliver
       [not found] ` <87wnotj949.fsf@a16n.net>
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Oliver @ 2021-08-10 20:13 UTC (permalink / raw)
  To: 49986

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

Here are three patches related to our .desktop files.  Two improve adherence to the Freedesktop.org Desktop Entry Specification, and one improves convenience for users.

Thanks.

-- 
Peter Oliver

[-- Attachment #2: Type: text/plain, Size: 2346 bytes --]

From 8331d2286265452dbf557e46d21da3a4c611bb2b Mon Sep 17 00:00:00 2001
From: Peter Oliver <git@mavit.org.uk>
Date: Wed, 7 Jul 2021 22:04:01 +0100
Subject: [PATCH 1/3] Valid quoting in .desktop files

* etc/emacsclient.desktop, emacsclient-mail.desktop (Exec): Quote
according to the rules in the Freedesktop.org Desktop Entry
Specification.
---
 etc/emacsclient-mail.desktop | 4 ++--
 etc/emacsclient.desktop      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/etc/emacsclient-mail.desktop b/etc/emacsclient-mail.desktop
index 8d51dcdd2f..bd48291d39 100644
--- a/etc/emacsclient-mail.desktop
+++ b/etc/emacsclient-mail.desktop
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Categories=Network;Email;
 Comment=GNU Emacs is an extensible, customizable text editor - and more
-Exec=sh -c 'exec emacsclient --alternate-editor= --display="$DISPLAY" --eval "(message-mailto \"%u\")"'
+Exec=sh -c "echo exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" --eval \\\\(message-mailto\\\\ \\\\\\"%u\\\\\\"\\\\)"
 Icon=emacs
 Name=Emacs (Mail, Client)
 MimeType=x-scheme-handler/mailto;
@@ -12,7 +12,7 @@ Actions=new-window;new-instance;
 
 [Desktop Action new-window]
 Name=New Window
-Exec=emacsclient --alternate-editor= --create-frame --eval '(message-mailto "%u")'
+Exec=emacsclient --alternate-editor= --create-frame --eval "(message-mailto \\"%u\\")"
 
 [Desktop Action new-instance]
 Name=New Instance
diff --git a/etc/emacsclient.desktop b/etc/emacsclient.desktop
index cd45463093..0feec67da5 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=sh -c 'if [ -n "$*" ]; then exec emacsclient --alternate-editor= --display="$DISPLAY" "$@"; else exec emacsclient --alternate-editor= --create-frame; fi' placeholder %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
-- 
2.31.1


[-- Attachment #3: Type: text/plain, Size: 1539 bytes --]

From 43f603771383a62fc873e932b351d4f04d50cf1d Mon Sep 17 00:00:00 2001
From: Peter Oliver <git@mavit.org.uk>
Date: Sat, 10 Jul 2021 12:01:09 +0100
Subject: [PATCH 2/3] =?UTF-8?q?Hint=20that=20emacsclient.desktop=20should?=
 =?UTF-8?q?=20match=20a=20search=20for=20=E2=80=9Cemacsclient=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is necessary to get the Gnome desktop to show “Emacs (Client)”
when the user searches for “emacsclient”.

* etc/emacsclient.desktop, emacsclient-mail.desktop (Keywords): Add
“emacsclient”.
---
 etc/emacsclient-mail.desktop | 1 +
 etc/emacsclient.desktop      | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/etc/emacsclient-mail.desktop b/etc/emacsclient-mail.desktop
index bd48291d39..2922239385 100644
--- a/etc/emacsclient-mail.desktop
+++ b/etc/emacsclient-mail.desktop
@@ -8,6 +8,7 @@ MimeType=x-scheme-handler/mailto;
 NoDisplay=true
 Terminal=false
 Type=Application
+Keywords=emacsclient;
 Actions=new-window;new-instance;
 
 [Desktop Action new-window]
diff --git a/etc/emacsclient.desktop b/etc/emacsclient.desktop
index 0feec67da5..4e4870730e 100644
--- a/etc/emacsclient.desktop
+++ b/etc/emacsclient.desktop
@@ -10,7 +10,7 @@ Terminal=false
 Categories=Development;TextEditor;
 StartupNotify=true
 StartupWMClass=Emacs
-Keywords=Text;Editor;
+Keywords=Text;Editor;emacsclient;
 Actions=new-window;new-instance;
 
 [Desktop Action new-window]
-- 
2.31.1


[-- Attachment #4: Type: text/plain, Size: 1402 bytes --]

From 1ff1d7910cf9c850c6d6f75136af0d1352e697bf Mon Sep 17 00:00:00 2001
From: Peter Oliver <git@mavit.org.uk>
Date: Sat, 10 Jul 2021 12:01:57 +0100
Subject: [PATCH 3/3] Drop redundant keywords in .desktop files.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The Freedesktop.org Desktop Entry spec says, “The values [of
Keywords]… should not be redundant with the values of Name or
GenericName”.

* etc/emacs.desktop, etc/emacsclient.desktop (Keywords): Remove
keywords that are duplicated from the GenericName field.
---
 etc/emacs.desktop       | 1 -
 etc/emacsclient.desktop | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/etc/emacs.desktop b/etc/emacs.desktop
index 81c53c6121..0d7cac14da 100644
--- a/etc/emacs.desktop
+++ b/etc/emacs.desktop
@@ -10,4 +10,3 @@ Terminal=false
 Categories=Development;TextEditor;
 StartupNotify=true
 StartupWMClass=Emacs
-Keywords=Text;Editor;
diff --git a/etc/emacsclient.desktop b/etc/emacsclient.desktop
index 4e4870730e..1ecdecffaf 100644
--- a/etc/emacsclient.desktop
+++ b/etc/emacsclient.desktop
@@ -10,7 +10,7 @@ Terminal=false
 Categories=Development;TextEditor;
 StartupNotify=true
 StartupWMClass=Emacs
-Keywords=Text;Editor;emacsclient;
+Keywords=emacsclient;
 Actions=new-window;new-instance;
 
 [Desktop Action new-window]
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#49986: Valid .desktop files
       [not found] ` <87wnotj949.fsf@a16n.net>
@ 2021-08-10 21:30   ` Peter Oliver
  2021-08-11 12:05     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Oliver @ 2021-08-10 21:30 UTC (permalink / raw)
  To: Peter Münster, 49986

[-- Attachment #1: Type: text/plain, Size: 160 bytes --]

On Tue, 10 Aug 2021, Peter Münster wrote:

> "echo"?
>
> I guess, that was for testing... ;)

Thanks, indeed so.  A fixed version is attached.

-- 
Peter Oliver

[-- Attachment #2: Type: text/plain, Size: 2341 bytes --]

From a301cae39f82ceb4af4d9c174cd6b7b8b6342326 Mon Sep 17 00:00:00 2001
From: Peter Oliver <git@mavit.org.uk>
Date: Wed, 7 Jul 2021 22:04:01 +0100
Subject: [PATCH 1/3] Valid quoting in .desktop files

* etc/emacsclient.desktop, emacsclient-mail.desktop (Exec): Quote
according to the rules in the Freedesktop.org Desktop Entry
Specification.
---
 etc/emacsclient-mail.desktop | 4 ++--
 etc/emacsclient.desktop      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/etc/emacsclient-mail.desktop b/etc/emacsclient-mail.desktop
index 8d51dcdd2f..f96e8a3c97 100644
--- a/etc/emacsclient-mail.desktop
+++ b/etc/emacsclient-mail.desktop
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Categories=Network;Email;
 Comment=GNU Emacs is an extensible, customizable text editor - and more
-Exec=sh -c 'exec emacsclient --alternate-editor= --display="$DISPLAY" --eval "(message-mailto \"%u\")"'
+Exec=sh -c "exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" --eval \\\\(message-mailto\\\\ \\\\\\"%u\\\\\\"\\\\)"
 Icon=emacs
 Name=Emacs (Mail, Client)
 MimeType=x-scheme-handler/mailto;
@@ -12,7 +12,7 @@ Actions=new-window;new-instance;
 
 [Desktop Action new-window]
 Name=New Window
-Exec=emacsclient --alternate-editor= --create-frame --eval '(message-mailto "%u")'
+Exec=emacsclient --alternate-editor= --create-frame --eval "(message-mailto \\"%u\\")"
 
 [Desktop Action new-instance]
 Name=New Instance
diff --git a/etc/emacsclient.desktop b/etc/emacsclient.desktop
index cd45463093..0feec67da5 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=sh -c 'if [ -n "$*" ]; then exec emacsclient --alternate-editor= --display="$DISPLAY" "$@"; else exec emacsclient --alternate-editor= --create-frame; fi' placeholder %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
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#49986: Valid .desktop files
  2021-08-10 21:30   ` Peter Oliver
@ 2021-08-11 12:05     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-11 12:05 UTC (permalink / raw)
  To: Peter Oliver; +Cc: Peter Münster, 49986

Peter Oliver <p.d.oliver@mavit.org.uk> writes:

> On Tue, 10 Aug 2021, Peter Münster wrote:
>
>> "echo"?
>>
>> I guess, that was for testing... ;)
>
> Thanks, indeed so.  A fixed version is attached.

Thanks; all three patches applied to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-11 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 20:13 bug#49986: Valid .desktop files Peter Oliver
     [not found] ` <87wnotj949.fsf@a16n.net>
2021-08-10 21:30   ` Peter Oliver
2021-08-11 12:05     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).