From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Problem with 'M-x shell' with (setq process-connection-type nil) Date: Mon, 24 Sep 2018 14:28:42 -0400 Message-ID: References: <23464.23313.68491.809659@frac.u-strasbg.fr> <23464.63915.722393.412272@frac.u-strasbg.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1537813634 9634 195.159.176.226 (24 Sep 2018 18:27:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Sep 2018 18:27:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Alain.Cochard@unistra.fr Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 24 20:27:10 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4VZe-0002PM-4j for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Sep 2018 20:27:10 +0200 Original-Received: from localhost ([::1]:46434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4Vbk-0007so-Fp for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Sep 2018 14:29:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4VbD-0007sX-T4 for help-gnu-emacs@gnu.org; Mon, 24 Sep 2018 14:28:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4VbA-0005Un-Ol for help-gnu-emacs@gnu.org; Mon, 24 Sep 2018 14:28:47 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:49380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4VbA-0005UP-JY for help-gnu-emacs@gnu.org; Mon, 24 Sep 2018 14:28:44 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w8OISh44013724; Mon, 24 Sep 2018 14:28:43 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id DF162AE251; Mon, 24 Sep 2018 14:28:42 -0400 (EDT) In-Reply-To: <23464.63915.722393.412272@frac.u-strasbg.fr> (Alain Cochard's message of "Mon, 24 Sep 2018 16:50:19 +0200") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6380=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6380> : inlines <6893> : streams <1799401> : uri <2717242> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117999 Archived-At: > > > 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