From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: [solved]: Re: Finding last *Async Shell Command* buffer? Date: Fri, 26 Mar 2021 13:34:22 +0300 Message-ID: References: <87k0puihrd.fsf@robertthorpeconsulting.com> <838s6aqtlv.fsf@gnu.org> <8335wiqrek.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6584"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.6 (2021-03-06) 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 Fri Mar 26 11:40:07 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 1lPjss-0001de-Gc for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 11:40:06 +0100 Original-Received: from localhost ([::1]:57534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPjsr-0001px-82 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 06:40:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPjsF-0001pn-G6 for help-gnu-emacs@gnu.org; Fri, 26 Mar 2021 06:39:27 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:52129) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPjsD-0002pE-PH; Fri, 26 Mar 2021 06:39:27 -0400 Original-Received: from localhost ([::ffff:41.210.143.10]) (AUTH: PLAIN securesender, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000027ECE.00000000605DB9BA.0000641F; Fri, 26 Mar 2021 03:38:50 -0700 Mail-Followup-To: Eli Zaretskii , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <8335wiqrek.fsf@gnu.org> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-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:128612 Archived-At: * Eli Zaretskii [2021-03-26 10:57]: > What happens if that buffer was meanwhile killed? > > Personally, I find it un-Emacsy to write a wrapper command each time > you want to manipulate the results of an existing command. Emacs > provides hooks for that very purpose, so it's best to use those > instead of inventing a new command each time you need something like > that. Redefining a key binding each time you run an async command is > also ... inelegant. True. It is temporary like that. Maybe I will be pushing last async buffer names into a list and pull those last buffers by same key bindings as long as: - the buffer still has process running. But the variable `async-current-process' is nil, and has no description. - if buffer exists, I know how to check. Then the key can show last async buffer, and if repeated one before that one, with process still running, and so on. How to discover if async buffer has current process running?