From: Samuel Wales <samologist@gmail.com>
To: Max Nikulin <manikulin@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Emacs launched from Firefox
Date: Wed, 25 May 2022 17:25:20 -0700 [thread overview]
Message-ID: <CAJcAo8t2+uB4YqSEjd3PbjYmw740RE4jWv-bMmQTaWKfYS6Oww@mail.gmail.com> (raw)
In-Reply-To: <62673cdd-14da-8526-c1eb-ca4c74592476@gmail.com>
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:
https://thekafkapandemic.blogspot.com
next prev parent reply other threads:[~2022-05-26 0:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-01 3:03 [PATCH] Add make target to ease creating reproducers and testing them Ihor Radchenko
2022-05-01 3:47 ` Samuel Wales
2022-05-01 4:20 ` Ihor Radchenko
2022-05-01 4:53 ` Samuel Wales
2022-05-01 5:01 ` Samuel Wales
2022-05-01 11:36 ` Emacs launched from Firefox Max Nikulin
2022-05-02 2:03 ` Samuel Wales
2022-05-02 8:26 ` Max Nikulin
2022-05-26 0:25 ` Samuel Wales [this message]
2022-05-26 2:59 ` Ihor Radchenko
2022-06-01 12:26 ` Max Nikulin
2022-05-01 14:03 ` [PATCH] Add make target to ease creating reproducers and testing them Christopher M. Miles
2022-07-22 13:37 ` Ihor Radchenko
2023-04-22 8:37 ` Max Nikulin
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.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJcAo8t2+uB4YqSEjd3PbjYmw740RE4jWv-bMmQTaWKfYS6Oww@mail.gmail.com \
--to=samologist@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=manikulin@gmail.com \
/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/org-mode.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).