[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GUI X-FreeDesktop integration
From: |
Boruch Baum |
Subject: |
GUI X-FreeDesktop integration |
Date: |
Thu, 13 May 2021 23:18:25 -0400 |
User-agent: |
NeoMutt/20180716 |
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