unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Boruch Baum <boruch_baum@gmx.com>
To: Emacs-Devel List <emacs-devel@gnu.org>
Subject: GUI X-FreeDesktop integration
Date: Thu, 13 May 2021 23:18:25 -0400	[thread overview]
Message-ID: <20210514031825.zcgswqzuxrkktrgs@E15-2016.optimum.net> (raw)

I found myself today using GUI emacs 27.1, and was surprised that it
wasn't at all integrated with the (debian) linux desktop. It doesn't
seem like a big deal to make part of a standard install, but in the
context of 'trying to make emacs easier' it would go a long way. I never
know when I post on this list whether something has already been either
done or flat-out rejected sometime in the past, oh, 30 years?, but
here's a simple two-step proposal to accomplish the type of integration
I think *ALL* newcomers would expect when installing GUI emacs (ie. when
one selects file(s) in a file manager, they are opened in Emacs).

Step 1: New file: /usr/share/applications/emacsclient.desktop
#+begin_src conf
[Desktop Entry]
Name=Emacsclient
GenericName=Connect to an Emacs server
X-GNOME-FullName=Connect to an Emacs server
Encoding=UTF-8
Version=1.0
Comment=Connect to an Emacs server using emacsclient
NoDisplay=false
Exec=\emacsclient -c --alternate-editor="" --eval "(pick-a-suitable-name \"%F\")"
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=emacs
Categories=Office;Development
StartupWMClass=Emacs
StartupNotify=true
# MimeType=
#+end_src

Step 2: New function: pick-a-suitable-name
#+BEGIN_SRC emacs-lisp
  (defun pick-a-suitable-name (&optional files)
    "Integrate GUI Emacs with XFreeDesktop"
    ;; Do optional 'stuff'
    ;; Do other optional 'stuff'
    (dolist (file (split-string (substring files 1 -1) "' '"))
      (find-file file))
    ;; Do more optional 'stuff'
    )
#+END_SRC

I'll cross-post this on the debian list for their own independent consideration.
--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0



             reply	other threads:[~2021-05-14  3:18 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14  3:18 Boruch Baum [this message]
2021-05-14  3:46 ` GUI X-FreeDesktop integration Stefan Monnier
2021-05-16  3:26   ` Boruch Baum
2021-05-14  6:45 ` Eli Zaretskii
2021-05-14  7:20   ` Joost Kremers
2021-05-14  7:41     ` Eli Zaretskii
2021-05-14  7:53       ` Joost Kremers
2021-05-14 11:29         ` Yuri Khan
2021-05-14 13:51         ` Stefan Monnier
2021-05-16  3:33   ` Boruch Baum
2021-05-16  4:25     ` Eli Zaretskii
2021-05-16  4:36       ` Boruch Baum
2021-05-16 10:46         ` Robin Tarsiger
2021-05-16 20:07           ` Matthias Meulien
  -- strict thread matches above, loose matches on Subject: below --
2021-05-25 21:34 Peter Oliver
2021-05-26  8:49 ` Robert Pluim
2021-05-26 12:14 ` Peter Oliver
2021-05-26 12:19 ` Eli Zaretskii
2021-05-28 12:54   ` Peter Oliver
2021-05-28 13:03     ` Eli Zaretskii
2021-05-28 18:49       ` chad
2021-05-28 19:16         ` Eli Zaretskii
2021-05-28 20:05           ` chad
2021-05-29  6:01             ` Eli Zaretskii
2021-08-12 12:42 Manuel Uberti
2021-08-12 12:51 ` Eli Zaretskii
2021-08-12 12:58   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210514031825.zcgswqzuxrkktrgs@E15-2016.optimum.net \
    --to=boruch_baum@gmx.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).