[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with 'M-x shell' with (setq process-connection-type nil)
From: |
Stefan Monnier |
Subject: |
Re: Problem with 'M-x shell' with (setq process-connection-type nil) |
Date: |
Mon, 24 Sep 2018 14:28:42 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> > > With 'emacs -Q -l .emacs.debug', where the .emacs.debug file contains
> > > only:
> > >
> > > (setq process-connection-type nil)
> > >
> > > I get [a problem with 'M-x shell']
>
> > Why would you do such a `setq`?
>
> This was to solve a problem with org-mode, for which 'C-c C-e l o' is
> supposed to "Export as LaTeX file and convert it to PDF, then open the
> PDF using the default viewer."
>
> For me it didn't (although the correct pdf file was indeed created).
> Help from the Org mailing list and further googling suggested that the
> problem might be related to 'xdg-open' and that such a setq could
> solve it. Which it did, for me, but with the aforementioned side
> effect with 'M-x shell'...
OK, so it looks like a problem between Org and xdg-open which can be
circumvented with this setting.
> Should I understand from your answer that 'M-x shell' is expected
> /not/ to work with such a setq?
No, indeed not (i.e. I consider it a bug in `shell`):
process-connection-type affects start-process and make-process, but IMO
all uses of start/make-process should either *really* not care what it's
set to, or they should explicitly override locally the default setting.
IOW, setting process-connection-type globally like you did should never
have any visible effect (barring bugs).
Maybe the following will workaround the Org problem without triggering the
shell problem:
(add-advice 'org-export-dispatch :around
(lambda (orig-fun &rest args)
;; Work around a weird problem with xdg-open.
(let ((process-connection-type nil))
(apply orig-fun args))))
-- Stefan