From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Chandan Babu R Newsgroups: gmane.emacs.help Subject: Re: xdg-open and start-process-shell-command: Unable to open files in external apps Date: Sat, 28 Aug 2021 19:12:54 +0530 Message-ID: <87o89h1y8x.fsf@debian-BULLSEYE-live-builder-AMD64> References: <87k0k6p1dw.fsf@debian-BULLSEYE-live-builder-AMD64> <831r6eowra.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10207"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 27.1 Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 28 15:43:42 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJycY-0002UO-BK for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 28 Aug 2021 15:43:42 +0200 Original-Received: from localhost ([::1]:34574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJycW-0000T0-Gx for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 28 Aug 2021 09:43:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJybu-0000QE-0f for help-gnu-emacs@gnu.org; Sat, 28 Aug 2021 09:43:02 -0400 Original-Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:34557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJybs-00039s-Ac; Sat, 28 Aug 2021 09:43:01 -0400 Original-Received: by mail-pf1-x432.google.com with SMTP id g14so8326228pfm.1; Sat, 28 Aug 2021 06:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:message-id :date:mime-version; bh=xCBPc5BF5lSsi16eFgjA8naUJEpIobOrJ5a7Xbt302M=; b=JS38Y0fy66ANapR3tefABAOczlHS5nF1380hQUwyiJpctLZAnt87wnTfWO28Jwy926 3hST3EETGTbQNAwAExn52LJVko2kbBvhlp3Elbdpp3C7h3eQ/EyNa+DbCFztnaAFyxFz 9Beeqbn8/Dms3EzG8HvkX0wr5ftUuxQvACExaoFRlKjFqODmxqycpdMtvWg5nWjg952q 4AqQyRrZMwaOTMD7rUjPsc/Qa19FYffRt64bXEMyadZodkjGqroQLBCM54ISeecF2Hp1 +oUm1agBuC7VyaOd34bCpQASMgUzX2FN18nE0Oyxp16bNd05rODRp/pe0QpUZlYZBAd5 iS4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=xCBPc5BF5lSsi16eFgjA8naUJEpIobOrJ5a7Xbt302M=; b=qRK0qRZ6pJFwClE4VhpTIHQZzmh0xhqxb+OYAj1VrRzAe8WSZ6iwN4xekzLk6oCEhd U91+QyyXHHvDtD3Alqz/vnu0n1EszhLSNJcIh4rzRQMX6/PwERNdxu3hgnhK/6FtsVw1 sd6mSMpq/6V5uxeSKFZMljkTpQAf3ZRSohHAebPXS3awG1sqaPi0goOfvthF2nHkbIeV +P3HWfUmKZ8gQgNsGQnJy2OpYKe2VN5vLaTmZ/JAaiqVRfAiSb/hg/nJnODBqVOBYMm6 xhWrO3v5i9trI9iH101wv6lKpHHnesCFHfYqnwUamBMvP0oYSPjWGGJlq6FUlIuxxtqc KaTg== X-Gm-Message-State: AOAM532wJmP6JCpO7a8KFvO7D4E0of9u6sORJ4LLxiqS51p5dDWs7/lf Rrr9hJapqTBH4bE/q9b+Rajoyz5d0rw= X-Google-Smtp-Source: ABdhPJze48fjyBqw9KDa4VvkJAt/aAHneT9jVmFwrIflSE5GMhaNi3cqmxFyhd6ScqS9ze2DtXlSag== X-Received: by 2002:a63:70b:: with SMTP id 11mr12557458pgh.75.1630158178169; Sat, 28 Aug 2021 06:42:58 -0700 (PDT) Original-Received: from garuda ([122.179.4.232]) by smtp.gmail.com with ESMTPSA id t12sm11184202pgo.56.2021.08.28.06.42.56 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Aug 2021 06:42:57 -0700 (PDT) In-reply-to: <831r6eowra.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=chandanrlinux@gmail.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132793 Archived-At: On 28 Aug 2021 at 12:56, Eli Zaretskii wrote: >> From: Chandan Babu R >> Date: Sat, 28 Aug 2021 11:16:35 +0530 >> >> The above code was originally obtained from >> http://ergoemacs.org/emacs/emacs_dired_open_file_in_ext_apps.html. >> >> After moving to (via a fresh install) Debian 11 (which ships Emacs 27.1) the >> code snippet has stopped working. >> >> However, the command "xdg-open /home/chandan/2016-2017.pdf" when invoked from the >> shell command line opens the pdf application viewer (i.e. Okular) >> correctly. >> >> The failure occurs only when start-process-shell-command procedure is invoked >> from within Emacs. The failure can also be recreated when >> start-process-shell-command is invoked from ielm buffer as shown below, >> >> (start-process-shell-command >> "Opening file" >> "sjihs async processes" >> (concat "xdg-open " >> (shell-quote-argument "/home/chandan/2016-2017.pdf"))) >> >> I wrote the following trivial script ... >> >> #!/usr/bin/zsh -f >> >> echo "\$0 = $0; \$1 = $1" > /tmp/debug.log >> >> and associated the script with application/pdf MIME type. >> >> debug.log file contains the following string, >> $0 = /home/chandan/bin/open-pdf.sh; $1 = /home/chandan/2016-2017.pdf >> ... when xdg-open is invoked either from the command line or through Emacs' >> start-process-shell-command procedure. However, Okular does not get spawned >> only when trying to open the pdf file from within Emacs. >> >> Any solutions or pointers to debugging this problem is very much appreciated. > > I believe the reason for this was recently found and resolved in Git > on the master branch. Thanks for the response. I built the code present in the master branch. The topmost commit was, commit 55e77a811a6f137b02eb786fb00c43f0f14bb028 Author: Juri Linkov * lisp/progmodes/flymake.el: Bind mouse-3 to flymake-menu on mode-line. * lisp/progmodes/flymake.el (flymake--mode-line-title): Bind [mode-line down-mouse-3] to flymake-menu (bug#50067) The problem described above is still recreatable. -- chandan