[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs launched from Firefox

From: Samuel Wales
Subject: Re: Emacs launched from Firefox
Date: Wed, 25 May 2022 17:25:20 -0700

thank you for that /very/ useful information.  cannot seem to
reproduce at this time as i'd have to narrow down the dialog box in
which this occurs [i think on a save link in gmail with some
extensions or so is one place] for haelth reasons but i think part of
the problem is that .emacs is not called, and/or that a tiny little
unreadable xterm is launched and emacs is run in it.  why firefox
would do that, idk.

i will quite likely need the information in your post if the .emacs
and/or xterm thing gets solved.  but it turns out that with
/usr/bin/emacs in normal use [no personal script needed] everything is
accessible.  my path doesn't override that.

so idk why ff makes emacs not load .emacs or does an xterm.
/usr/bin/emacs results in indeed emacs25 atm.

gnome and kde are too heavy for my computer, and they can't do
everything fluxbox can, and fluxbox mostly wfm.  i don't get what
things de's do that i need, but perhaps setting default fonts/colors
for various toolkits is one of them.

On 5/2/22, Max Nikulin <manikulin@gmail.com> wrote:
> I am not sure from which site you downloaded that attachment, MIME type
> may vary depending on the HTTP server configuration. You yay check
> Content-Type response header in the browser development tools or using
>      curl -I '<URL>'
> command. It may be "text/plain", "text/x-patch", "application/x-patch",
> etc.
> In Firefox settings (about:preferences page) check that "Applications"
> section either does not contain an entry for the MIME type (is unlikely
> in your case since you already opened a file) or its handler is
> configured to "Always ask" till you select your new handler.
> System-wide .desktop file may reside e.g. in
> "/usr/share/applications/emacs.desktop". You can put your customized
> file in e.g. "~/.local/share/applications/" directory
> ("$XDG_DATA_HOME/applications/") or into "applications" subdirectory of
> "$XDG_DATA_DIRS" entry. For details see
> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
> Customize "Exec" entry in the .desktop file to add your options, e.g.
> create "emacs-a11y.desktop"
> ---- >8 ----
> [Desktop Entry]
> Version=1.0
> Name=Accessible Emacs (GUI)
> GenericName=Text Editor
> Comment=GNU Emacs is an extensible, customizable text editor - and more
> 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++;
> TryExec=/usr/bin/emacs
> Exec=/usr/bin/emacs %F
> Icon=emacs
> Type=Application
> Terminal=false
> Categories=Utility;Development;TextEditor;
> StartupWMClass=Emacs
> Keywords=Text;Editor;
> ---- 8< ----
> It is better to set unique "Name" to distinguish it from the default
> Emacs launcher. Desktop file format reference:
> https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
> Notice that browser launcher script may reset PATH environment to some
> safe value, so executables from custom directories may be unavailable
> without specifying of the full path.
> MIME type should be among the values of the MimeType field inside the
> ".desktop" file or in the "mimeapps.list" file. In the former case run
> (with proper directory)
>      update-desktop-database ~/.local/share/applications
> In the latter case add to "~/config/mimeapps.list" mapping from the MIME
> type to your .desktop file
> ---- >8 ----
> [Added Associations]
> text/plain=emacs-a11y.desktop;
> ---- 8< ----
> And maybe
> ---- >8 ----
> [Default Applications]
> text/plain=emacs-a11y.desktop;
> ---- 8< ----
> With such recipe a new instance of Emacs will be launched for each
> downloaded file. Likely you would prefer to use you main Emacs session
> or a special session of Emacs for untrusted content fetched from web. In
> such case you can use "emacsclient" command in the ".desktop" file and
> maybe systemd user socket+service units pair to run Emacs on demand.
> If you are still using emacs-25 then e.g. "--fg-daemon" option is
> unavailable and related files are not included in the package. For
> inspiration you may check
> http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/emacsclient.desktop
> http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/emacs.service
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html
> Finally a rather unrelated question. Do you find accessibility tools in
> Gnome or KDE inconvenient? I believed that it should be more difficult
> to arrange setup from scratch for fluxbox. However I never tried any of
> these options.
>> On 5/1/22, Max Nikulin wrote:
>>> On 01/05/2022 11:53, Samuel Wales wrote:
>>>> [firefox did not offer to allow a command line to run my shell script
>>>> which sets up emacs correctly, and idk if it even ran with my .emacs.
>>>> does it do -q?  not sure because emacs is too unusable to even find
>>>> that out.  so firefox fails to be accessible in that dialog box.
>>> Samuel, I think, firefox does exactly what it can find in MIME
>>> associations (e.g. ~/.config/mimeapps.list) and in the .desktop file of
>>> the selected application.
>>> There is an emacsclient.desktop file in Emacs git master that tries to
>>> connect to the existing Emacs session. It is a relatively new addition,
>>> so packages for Linux distributions may miss it.
>>> You can either use standard Emacs initialization to get all your
>>> customization available through default emacs.desktop or create a custom
>>> .desktop file that contain all CLI options specific to your setup.

The Kafka Pandemic

A blog about science, health, human rights, and misopathy:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]