From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.help Subject: Re: Finding last *Async Shell Command* buffer? Date: Sat, 27 Mar 2021 00:17:18 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11495"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) To: Help GNU Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 26 22:18:29 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 1lPtqf-0002rl-AV for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 22:18:29 +0100 Original-Received: from localhost ([::1]:51940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPtqe-0003OW-Aj for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 17:18:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPtpe-0003KN-VZ for help-gnu-emacs@gnu.org; Fri, 26 Mar 2021 17:17:27 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:53337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPtpd-0006sx-62 for help-gnu-emacs@gnu.org; Fri, 26 Mar 2021 17:17:26 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 36FB916FF for ; Fri, 26 Mar 2021 17:17:23 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 26 Mar 2021 17:17:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=jP0EE//S0SlAB0QaV9jW4aKQJd HZ8iUNs4qyTt3GgDU=; b=VqbXApBkUCzm/nKGrOg2i3x8AG9XZi7vwGrJd/1kSn XcEfNzo71K/sqBrNNAR2rc0oejzLRDAGxCWLGghvNk9kQH0wQXR7xEbQmBtgIaYs tla5TDi9C2Y9UgNsQ3ZS8I+QbT/8F1I9+pRrY2/Hvu/sbCUpWIsfXd8BOdxGkAjF QTSdmbuMeFEGM+OAn0nMgT3993mb4Q1sdPxDm9OsI66Z1ym3s+C2AEXxjEXwrKAy iu7lAyD8ngk0hlzPqgGg/pBO/YCt1oI80qonZWPuCirgPTteJwBiJ3efDRxUCVKH rFvVqw8rKiFbInihqFGy3zI6KXgmMYzjp4wn67i9to/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=jP0EE/ /S0SlAB0QaV9jW4aKQJdHZ8iUNs4qyTt3GgDU=; b=TGj/r3FboSRMb4ixoDF8Xl omxexg7mHaRldfB+52Pb2Ot4ARjQ8SrsYPMPa5X3esQRG+mWOBMYjjiiPIebYCNz q0lR1gilXjkwepeu3z9IwJ8ARUCr4Ccf0Tq8Ac7s6xBfJQDiWQCNkQFfroxd8ZKD rKkR4GF8VHtbeooUzERfrHoBq5eOBpdINSIVXZ+Iq9muRKfmIVOjoadOB+pjyLLj 1d3a/5LvyveC/ya+WlwHIg7+vqxezDpTT4gDrFZd51IkpPzHPV7nN9w5QndI5ezf 08DbBZv44jOM7CDphUeUzYy4H9RqosSwBdxMku/rSYdYk2tPqrhNZtepCc9ZXzyA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehvddgudehudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffujghffgffkfggtgesthdtredttdertdenucfhrhhomhephfhilhhi phhpucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhmrghilhdrfhhmqeenucggtf frrghtthgvrhhnpedvveekffdvueevhfdutdejheekvdeufeevtedttdevuddugfeiffei veeivefhtdenucfkphepkeegrddvtdegrdduleefrddutdeinecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepfhhguhhnsghinhesfhgrshhtmhgr ihhlrdhfmh X-ME-Proxy: Original-Received: from fgunbin.local (unknown [84.204.193.106]) by mail.messagingengine.com (Postfix) with ESMTPA id 3FC5D24005C for ; Fri, 26 Mar 2021 17:17:22 -0400 (EDT) In-Reply-To: (Jean Louis's message of "Fri, 26 Mar 2021 23:06:56 +0300") Mail-Followup-To: Help GNU Emacs Received-SPF: pass client-ip=64.147.123.25; envelope-from=fgunbin@fastmail.fm; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:128667 Archived-At: On 26/03/2021 23:06 +0300, Jean Louis wrote: > I have tried it, but error: > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > get-buffer(nil) > display-buffer(nil) ... Forgot to add non-nil check: (defun my-find-latest-async-buf (pos) (interactive "p") (or pos (setq pos 0)) (let ((b (nth pos (seq-filter (lambda (buf) (string-match (regexp-quote shell-command-buffer-name-async) (buffer-name buf))) (buffer-list))))) (if b (display-buffer b) (message "No %dth async-shell buffer to display" pos)))) Filipp