From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: My read-buffer-function doesn't work when called by switch-to-buffer Date: Thu, 16 Mar 2023 17:59:44 +0100 Message-ID: <87h6uk8wb1.fsf@gnu.org> References: <875yb8nvvk.fsf@gnu.org> <87y1o486wo.fsf@web.de> <87fsabslcj.fsf@gnu.org> <874jqq63vn.fsf@web.de> <87h6upyenm.fsf@gnu.org> <87sfe9bien.fsf@web.de> <874jqms6s2.fsf@gnu.org> <87mt4dn8qi.fsf@web.de> <87ttylhwyd.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="22329"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.22; emacs 30.0.50 Cc: Michael Heerdegen , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 16 18:02:24 2023 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 1pcqze-0005X3-7i for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 16 Mar 2023 18:02:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcqz9-00020F-Rg; Thu, 16 Mar 2023 13:01:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcqz5-0001zn-FH for help-gnu-emacs@gnu.org; Thu, 16 Mar 2023 13:01:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcqz4-0000bw-HF; Thu, 16 Mar 2023 13:01:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:From:References: to; bh=puJ0kWDlEMNRabF4f9gDZKU5B10XrLY0AcbM7C1OhYU=; b=HKK/4LUSTOpRA292rvgmOQ si5iSRCW1Pk78NK/dZh3wwkDLadz9Oe2rigQ0UY0HaLDAWHYg+kvHGTz/9mUeXQd16hWdJAu6NfW+ H4107yt0w580wO36UUd0+HSgLGFBZGwb2lPe+S6N3ywg+oLEyNV/4aJV70TCBSeeu0/KPHpIN1foL ZlYhvyYWy6yVcUeCZVSacslj74aqwnCR5xkNDNAA3Mxsi1ErXVKCwi4JPFjYD+HpHT62aqHnkjqow Eq0HME+d+5n8msTrObfNFTpisLzUixm5dNujX1m3ieYHJO8+taYmkrbef1GRiSzYNmUDOtUWYOzI4 IjSTYYkQRR3w==; Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcqyy-0002Gf-Ow; Thu, 16 Mar 2023 13:01:46 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 9A91427C0054; Thu, 16 Mar 2023 13:01:40 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 16 Mar 2023 13:01:40 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeftddgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne hmihhsshhinhhgucfvqfcufhhivghlugculdeftddmnecujfgurhepfhgfhfevufffjgfk gggtsehttdertddtredtnecuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshguhh esghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhephfdvtdethfeuvdevvdelfedtjedt ffduvedvveeivdefueegheeuudeuieevleffnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhs ohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdroh hrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Mar 2023 13:01:39 -0400 (EDT) In-reply-to: <87ttylhwyd.fsf@gnu.org> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143045 Archived-At: Tassilo Horn writes: >> Depends on what you want of course. It doesn't make sense for >> everything (not for `kill-buffer' for example). > > Good point (although it doesn't really hurt). I now made my function a > bit customizable depending on `this-command'. > > (defconst th/read-buffer-or-recentf-command-alist > "Alist with entries of the form (CMD . COMPLETES). > COMPLETES is a list defining what's completed where entries can > be: > > - `buffers': completion for all buffers > - `buffers-except': completion for all buffers except the current one > - `recentf': completion for recent files which will be found on demand" > '((kill-buffer buffers) > (switch-to-buffer buffers-except recentf) > (pop-to-buffer buffers-except recentf))) Gosh, that's what you get when adding a docstring before posting! Of course, you put it at the wrong location. So here it is fixed. --8<---------------cut here---------------start------------->8--- (defconst th/read-buffer-or-recentf-command-alist '((kill-buffer buffers) (switch-to-buffer buffers-except recentf) (pop-to-buffer buffers-except recentf)) "Alist with entries of the form (CMD . COMPLETES). COMPLETES is a list defining what's completed where entries can be: - `buffers': completion for all buffers - `buffers-except': completion for all buffers except the current one - `recentf': completion for recent files which will be found on demand") --8<---------------cut here---------------end--------------->8--- Bye, Tassilo