From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#34776: Acknowledgement (27.0.50; Some questions about choose-completion-string-functions) Date: Wed, 13 Mar 2019 09:51:11 -0700 Message-ID: <871s3a90qo.fsf@ericabrahamsen.net> References: <871s3jeh8m.fsf@ericabrahamsen.net> <87zhq4zzcz.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="197949"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 34776@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 13 18:02:42 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h47H7-000pOh-Qe for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Mar 2019 18:02:42 +0100 Original-Received: from localhost ([127.0.0.1]:47989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h47H6-0006vF-LN for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Mar 2019 13:02:40 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h476x-0006bx-Fv for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2019 12:52:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h476s-0004P0-Vy for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2019 12:52:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57110) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h476q-0004OV-O0 for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2019 12:52:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h476n-0005Ho-S8 for bug-gnu-emacs@gnu.org; Wed, 13 Mar 2019 12:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Mar 2019 16:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34776 X-GNU-PR-Package: emacs Original-Received: via spool by 34776-submit@debbugs.gnu.org id=B34776.155249588520276 (code B ref 34776); Wed, 13 Mar 2019 16:52:01 +0000 Original-Received: (at 34776) by debbugs.gnu.org; 13 Mar 2019 16:51:25 +0000 Original-Received: from localhost ([127.0.0.1]:42421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h476C-0005Gy-Jr for submit@debbugs.gnu.org; Wed, 13 Mar 2019 12:51:24 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:33472 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h4767-0005Gg-CH for 34776@debbugs.gnu.org; Wed, 13 Mar 2019 12:51:23 -0400 Original-Received: from localhost (97-126-92-188.tukw.qwest.net [97.126.92.188]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 4C32AFA02C; Wed, 13 Mar 2019 16:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ericabrahamsen.net; s=mail; t=1552495873; bh=jCRrbXIoijqhtM+cAzoP4YX0r6Tlp4REfWEgJMfFZVA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=vFhZL/ZBXR+120L6/4MVtgWnmzrdeDxFacmD7HZ2JgTXe1s9BvlIwar+jtMzLvmnq +nBgDEzgb3nHEmtljgw2+LyK8GQKYULwRu9mCY/3uZwj+s1lbmkSJ0b6iR0nz+Nz4c Az9cSb31yYKCcyZiQGroKYQyCGxV3QX1SWeVKqlo= In-Reply-To: (Glenn Morris's message of "Fri, 08 Mar 2019 21:07:32 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156296 Archived-At: --=-=-= Content-Type: text/plain On 03/08/19 21:07 PM, Glenn Morris wrote: > Eric Abrahamsen wrote: > >> Actually it looks like I was wrong about using add-function with >> choose-completion-string-functions, it's just a plain list you stick >> functions into. I think it has to be an error not to declare it >> buffer-local... I've worked around this with `make-local-variable', but >> I'm halfway sure this should be a defvar-local...? > > The two uses in the Emacs code-base use add-hook without LOCAL. > completing-read-multiple and ido-common-initialization. You're right, I was misinterpreting the code and comments as saying the functions should be buffer local, when it just meant they *could* be buffer local. I'll use add-hook with LOCAL. So never mind! But I'd still like to add something like the attached, as functions following the current docstring will raise an error. Eric --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=patch.txt diff --git a/lisp/simple.el b/lisp/simple.el index d4ae5ebb1f..0274bdb459 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8188,6 +8188,9 @@ choose-completion-string-functions BUFFER - the buffer in which the choice should be inserted, BASE-POSITION - where to insert the completion. +Functions should also accept and ignore a potential fourth +argument, passed for backwards compatibility. + If a function in the list returns non-nil, that function is supposed to have inserted the CHOICE in the BUFFER, and possibly exited the minibuffer; no further functions will be called. --=-=-=--