emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [BUG] org-open-file immediately termininates when calling xdg-open that calls emacsclient
Date: Fri, 27 May 2022 19:03:55 +0700	[thread overview]
Message-ID: <t6qep1$mfp$1@ciao.gmane.io> (raw)
In-Reply-To: <87czfzwl8k.fsf@localhost>

On 27/05/2022 13:19, Ihor Radchenko wrote:
> 
> I managed to narrow down the reproducer with the following minimal
> configuration:
> 
> ~/.emacs.d/init.el
> -----------------------
> (require 'server)
> (unless (server-running-p) (server-start))
> (setenv "DISPLAY" ":0.0")
> (define-key input-decode-map (kbd "C-[") [C-\[])
> ------------------------------
> 
> With this exact init.el, trying to run
> (let ((process-connection-type nil))
>    (start-process-shell-command "1" nil "xdg-open ~/.bashrc"))

Does it mean that you can not reproduce it with emacsclient instead of 
xdg-open? Anyway I can not reproduce it with Emacs-27.1 from 
Ubuntu-20.04. You may try to add before emacsclient command something like

     strace -s64 -f -t -o /tmp/emacsclient.strace

or attach strace to the running emacs using -p PID option just before 
executing `start-process-shell-command' and kill strace just after.

My attempt:
- Minimal LXC container, so I had to install xdg-utils and file packages
- Notice
       file --mime-type ~/.bashrc
       /home/ubuntu/.bashrc: text/plain
   so I tried with ~/.bashrc and with a script that is really recognized
   as text/x-shellscript
- ~/.local/share/applications/emacsclient-local.desktop
   from your previous message
- ~/.config/mimeapps.list
      [Added Associations]
      text/x-shellscript=emacsclient-local.desktop
      [Default Applications]
      text/x-shellscript=emacsclient-local.desktop
    without such file xdg-open can not find a handler despite I believed
    that it scans ~/.local/share/applications/ for .desktop files.
    Maybe that part of code works only for x-scheme-handler/...
    MIME types.
- emacs &
- switch from some info buffer specific to Debian
- execute the command you provided.

New frame is open and it seems reliable.

P.S. Likely it is unrelated to your problem:
emacs -Q --daemon

Warning: due to a long standing Gtk+ bug
https://gitlab.gnome.org/GNOME/gtk/issues/221
Emacs might crash when run in daemon mode and the X11 connection is 
unexpectedly lost.
Using an Emacs configured with --with-x-toolkit=lucid does not have this 
problem.
Starting Emacs daemon.



  reply	other threads:[~2022-05-27 12:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22  4:37 [BUG] org-open-file immediately termininates when calling xdg-open that calls emacsclient [9.5.3 (release_9.5.3-508-ge268e4 @ /home/yantar92/.emacs.d/straight/build/org/)] Ihor Radchenko
2022-05-22  8:13 ` [BUG] org-open-file immediately termininates when calling xdg-open that calls emacsclient Max Nikulin
2022-05-26 14:24   ` Ihor Radchenko
2022-05-26 16:14     ` Max Nikulin
2022-05-27  6:19       ` Ihor Radchenko
2022-05-27 12:03         ` Max Nikulin [this message]
2022-05-27 15:18           ` Ihor Radchenko
2022-06-02 17:04             ` [PATCH] org.el: Use `call-process' to launch external viewers (was: Re: [BUG] org-open-file immediately termininates when calling xdg-open that calls emacsclient) Max Nikulin
2022-07-24  5:51               ` Ihor Radchenko

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='t6qep1$mfp$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@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/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).