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: Wed, 15 Mar 2023 10:06:23 +0100 Message-ID: <874jqms6s2.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4854"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.22; emacs 30.0.50 Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 15 10:28:53 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 1pcNRE-0000zC-Qx for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 15 Mar 2023 10:28:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcNQh-0004u4-DW; Wed, 15 Mar 2023 05:28:19 -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 1pcNQf-0004tk-VV for help-gnu-emacs@gnu.org; Wed, 15 Mar 2023 05:28:18 -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 1pcNQf-0003aa-HO; Wed, 15 Mar 2023 05:28:17 -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:To:From: References; bh=Eby87rBgIJpzzgL2HePSju79bfVyXCAVdWRDKluWrf0=; b=QLSktp2bSM6PgB g2HpJfvo45RFHkNWOqkKE+JHtO2TOb0/3d+eb703ns/B2pdG8I/gJ5yx7jiZEmTseGFYtK/lnGIlA 0toc3BjQBjjLJnYw/chfjmemy6/aGA5LP/fHvw9MhkNK1IBTGMVJ4E5/IFB36kSk/vnIhRBoVvol/ 4opFOhPnuQ8c+Y/5pK6XSZYztXz9xnrFcBIdTTQ0awBQYrDZWVaCXtcFVRhzczVta8Fv7bClMB5kI daa4x81Te9atx4YPgTAj4QpKTgMBY+IBOIfHtit6FkDnlBYJHs/MQavet6w0ksxhC0YUtR2p7VQaI g+P+cFtMwflJ3rrb8kNQ==; 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 1pcNQf-0001LP-6C; Wed, 15 Mar 2023 05:28:17 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id ADA3227C0054; Wed, 15 Mar 2023 05:28:16 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 15 Mar 2023 05:28:16 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddvkedgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvvefuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe dujedtheduvdelffejkeetgedvheelhedvueefhfeukeekkeehvdfggeegffevgfenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedv leekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 15 Mar 2023 05:28:15 -0400 (EDT) In-reply-to: <87sfe9bien.fsf@web.de> 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:143025 Archived-At: Michael Heerdegen writes: Hi Michael, >> > Maybe an advice of a higher level function would better fit your >> > wished-for behavior. >> >> Do you have one in mind? > > `read-buffer-to-switch'. Hm, but then it would be pretty specific to `switch-to-buffer' instead of a general `read-buffer-function'. E.g., I just found out it's quite convienient to be able to use `append-to-buffer' to append to a buffer whose file I haven't found already but is in recentf-list. >> I haven't checked their implementation but completion-extra-properties >> is nil and the metadata completion requests also don't return an >> annotation-function or affixation-function. Nevertheless, all standard >> completions are annotated. I'll have a look how marginalia does it. > > They do this: > > (advice-add #'completion-metadata-get > :before-until #'marginalia--completion-metadata-get) > > Looks like this is how they install their annotation-function. Yes, thanks for the pointer. >> Anyway, I've played a bit with responding to metadata requests and it >> looks like it's not really suited for my goal because it seems to >> assume that the metadata won't change (e.g., category from buffer to >> file) during a single completion which is obviously a reasonable >> assumption. > > Hmm, yes, that's a problem. Seems a completion table can only provide > one kind of metadata for all completions and what you want doesn't fit > at all into that approach. See the comment in > `completion-table-in-turn'. Agreed. Bye, Tassilo