From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marius Hofert Newsgroups: gmane.emacs.help Subject: Re: How to suppress/avoid *Async Shell Command* buffer? Date: Sat, 18 May 2013 20:52:14 +0200 Message-ID: <87r4h4azoh.fsf@math.ethz.ch> References: <5197784A.1020500@easy-emacs.de> <87sj1ktmnq.fsf@math.ethz.ch> <87li7c1he8.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1368903165 7490 80.91.229.3 (18 May 2013 18:52:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 May 2013 18:52:45 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Hongxu Chen" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 18 20:52:45 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UdmFI-0006R1-Ro for geh-help-gnu-emacs@m.gmane.org; Sat, 18 May 2013 20:52:45 +0200 Original-Received: from localhost ([::1]:34926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdmFI-0001V8-Gm for geh-help-gnu-emacs@m.gmane.org; Sat, 18 May 2013 14:52:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdmF0-0001Ut-5L for help-gnu-emacs@gnu.org; Sat, 18 May 2013 14:52:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UdmEt-0006FV-9u for help-gnu-emacs@gnu.org; Sat, 18 May 2013 14:52:26 -0400 Original-Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:47846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdmEt-0006FR-3E for help-gnu-emacs@gnu.org; Sat, 18 May 2013 14:52:19 -0400 Original-Received: by mail-wg0-f52.google.com with SMTP id z11so711266wgg.7 for ; Sat, 18 May 2013 11:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:user-agent :in-reply-to:date:message-id:mime-version:content-type :content-transfer-encoding; bh=1XhqVd7y9LAfyc3VeJo3uXXwhpoclrF1mK3ABg1J6As=; b=UUd1P7uvMVvJfxjCXqlcbgbHOO2T1Yzrr7t8ULnrVmUMUhFUC96QHj2ejwWZsKaspJ yh6TpTuwWrUQZOUru/+ZjkolWM1UQYVC+zrtVAhFYylqXD5x0A0GPOmnj7UC38R9jTOc CZ1Bvf6VVk0XkRYqR8CKR18JynSNjY2ZJ0U+hzi8ocZ4DhxzNdj3/KjwXbUc0jAsOxnf wfBhwC7liW++Nu8uDtT7IlcAmhT10Js2D5O8I0dP9iMhzMtyWdVEqGUVcxfay0nIGoCY hf8sovsoiVz6JX73vMrI/xERyJjub0XDCsNJcYPSIdnoXKMjmv7rQ9RnFPuFIWclmpnr a1tw== X-Received: by 10.180.90.43 with SMTP id bt11mr3359427wib.30.1368903138182; Sat, 18 May 2013 11:52:18 -0700 (PDT) Original-Received: from sklar (178-83-94-113.dynamic.hispeed.ch. [178.83.94.113]) by mx.google.com with ESMTPSA id e5sm4370957wiy.5.2013.05.18.11.52.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 18 May 2013 11:52:17 -0700 (PDT) User-agent: mu4e 0.9.9.5; emacs 24.3.50.1 In-reply-to: <87li7c1he8.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::234 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90907 Archived-At: Hongxu Chen writes: > There is a tool called `openwith' that might meet your needs; you might > see this page for details: > http://www.emacswiki.org/emacs/OpenWith > It is available in elpa but I recommend that you customize the external > apps yourself. > > Also Lee Xah has written a snippet for this issue, and you can just map > some key. > http://ergoemacs.org/emacs/emacs_dired_open_file_in_ext_apps.html This is indeed interesting, thanks a lot. Both approaches use 'start-process' (which seems good). The approach by Lee seems to be fine. It calls xdg-open. I tried with "!" -> "xdg-open ?" and it opens foo.pdf externally (in a persistent way), but emacs is blocked. However, when I use 'xdg-open ? &' then *Messages* says "xdg-open rank.pdf: finished." but nothing is opened. ... Do you know why? Was just wondering... > > Hope these would be helpful. Indeed, many thanks! Cheers, Marius > > > Marius Hofert writes: > >> Andreas Röhler writes: >> >>> Am 18.05.2013 12:05, schrieb Marius Hofert: >>>> Hi Andreas, >>>> >>>> Thanks a lot for helping. >>>> >>>> The purpose is simply for opening them (asynchronously), viewing the pdf >>> >>> Hmm, probably don't understand yet, what is the difference WRT RET --dired-find-file-- ? >> >> dired-find-file opens it *in Emacs*. I can't edit it then and it's also >> a bit slow. >> >> I would like to open the file with *Okular* from Emacs. >> >>> >>>> (continuing to work in Emacs), (maybe add annotations to the pdf and save >>>> it). >>>> >>> >>> which would mean edit, not just view the pdf(?) >> >> yes. >> >> Maybe I wasn't clear. You can use "!" in dired mode to execute commands >> on the file at point. I use that to call Okular to open the file >> (in Okular; standalone). The same happens when I cd in the terminal to >> the directory containing the pdf file, then type 'okular foo.pdf &', but >> that's more tedious of course (also, it exits Okular if I quit the >> terminal -- which does not happen if I start it from dired-mode). >> >>> >>> >>> >>>> I use 'dired-mode' as 'file manager' and often would like to open and view >>>> pdfs in Okular. I also have other 'dired-guess-shell-alist-user' settings >>>> like opening pngs in eog or mp3s in VLC. But everytime I open a file, I get >>>> this annoying *Async Shell Command* buffer (either empty or with debug >>>> output) and I have to manually close it via C-x 0 etc. to get rid of it. >>> >>> >>> Please give an example of the shell-command used than. >> >> Due to my settings for dired-guess-shell-alist-user (as posted), I >> receive the suggestion 'okular ? &' when hitting '!' with the point on >> the pdf file. This executes "okular foo.pdf &" in the background (as far >> as I know), where 'foo.pdf' is the pdf file at point. Hitting RET starts >> Okular, opens foo.pdf (great), but also opens the *Async Shell Command* >> buffer in Emacs (as described; not so great). >> >> Cheers, >> >> Marius >> >>> >>> I >>>> know that it might contain useful information sometimes and I wouldn't be >>>> against it appearing hidden (in the buffer list). But being distracted by >>>> this buffer in dired-mode is really unpleasant. If I only knew more emacs >>>> lisp... >>>> >>> >>> >>> Let's see how it comes out in this case. >>> >>> Andreas >>> >>>> Cheers, >>>> >>>> Marius >>>> >> >>