Lars Ingebrigtsen <larsi@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 39600) by debbugs.gnu.org; 8 Aug 2020 21:58:57 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 08 17:58:57 2020 Received: from localhost ([127.0.0.1]:59690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1k4Wrh-0008B0-9w for submit <at> debbugs.gnu.org; Sat, 08 Aug 2020 17:58:57 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <monnier@HIDDEN>) id 1k4Wrf-0008Am-Hp for 39600 <at> debbugs.gnu.org; Sat, 08 Aug 2020 17:58:55 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 75DFE100ED1; Sat, 8 Aug 2020 17:58:49 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8CC8E100312; Sat, 8 Aug 2020 17:58:47 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1596923927; bh=F73rhbIJpjMZ7sC7tVza+LqH4aV99k+lJdf3SAwiKg4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=WFz1QtxJ335dUXOF80UHdv9QWqAVy/0JFojLWYetJgzS1tZA5JfcaoyQF9ozDIIuR ePu7QYNzZTrqspmnoiy5g5HMGd0uXex4smNNGFYlRCnvalHtcSf4uHeAC483gWOBQN S8RzZfbAxE2FmoqtnyvI/YbZGuJJOxEqGjw1Sa+TEdlNKo838Un+S8g7mUKmkDgTTy sqbckLrZkvcRlT/CI5JyydIFesa2LAKQXZPL5h7B10Dgq2V+1JQCrSzxUWmhwaaTTj GcnDeNmTxY3TJT77Z8s5oZNWqhKilYzl87pZnG2oE2Mva4ok5UNp/HTDOwow395Xvd nFYB/GxWZ/H1w== Received: from milanesa (unknown [45.72.246.108]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 47DE012029D; Sat, 8 Aug 2020 17:58:47 -0400 (EDT) From: Stefan Monnier <monnier@HIDDEN> To: Lars Ingebrigtsen <larsi@HIDDEN> Subject: Re: bug#39600: [PATCH] Fix handling of non-exclusive non-prefix completion functions Message-ID: <jwv8seoby8b.fsf-monnier+emacs@HIDDEN> References: <CAPu3fz2upooTeN7XmQt7q=W1FGxyk1pzaVqg+TQkEz7OnEYeaA@HIDDEN> <874kpdz12d.fsf@HIDDEN> Date: Sat, 08 Aug 2020 17:58:39 -0400 In-Reply-To: <874kpdz12d.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sat, 08 Aug 2020 16:04:10 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.029 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 39600 Cc: 39600 <at> debbugs.gnu.org, Amai Kinono <amaikinono@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) >> Currently, with non-exclusive completion functions, Emacs will do >> `try-completion` on the current text, and decide whether to try next >> completion function based on that. This makes completion functions that >> can do non-prefix completions fails when the current text only occurs in >> the middle of the candidates. This is a problem I found in a FIXME in >> the code. >> >> # How does this work? >> >> I use `completion-all-completions` instead. As far as I know, this >> respects the `completion-styles`. > [...] > Stefan, how does this patch look to you? I think it replaces one set of problems with another. Within the completion-at-point-function we shouldn't call anything like `try-completion`: we should only decide which completion table to use but we shouldn't look inside those completion tables. So a better solution is to build a new completion table which combines (e.g. with `completion-table-in-turn`) the current one with that of "the rest". [ The tricky (but still doable) case being when when the current completion table and that of the rest don't use the same BEG and END. ] Stefan
bug-gnu-emacs@HIDDEN
:bug#39600
; Package emacs
.
Full text available.Received: (at 39600) by debbugs.gnu.org; 8 Aug 2020 14:04:23 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 08 10:04:23 2020 Received: from localhost ([127.0.0.1]:59401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1k4PSR-00078e-4l for submit <at> debbugs.gnu.org; Sat, 08 Aug 2020 10:04:23 -0400 Received: from quimby.gnus.org ([95.216.78.240]:52346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <larsi@HIDDEN>) id 1k4PSP-00078P-AA for 39600 <at> debbugs.gnu.org; Sat, 08 Aug 2020 10:04:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8r2pyxp5QVphmwAob9SMZfcEnannx5ScKyFQZeMOTFw=; b=gzUOLDVrc9TqCRT7IDBu76jgH3 QYG1lBNX8jhJPGG7KT2YW6KtnQzJ+uEVkH9MJ6DsQX2hCRGOM/ILPPgWUIBsJG+ZCnnqdfkXOVyHB TOA3pJFWn0M2dBQGw9bTuFxccXF3lXJmvBDn7HXsqiQiQIkWXsnIaCzd9MVxzne9HSic=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <larsi@HIDDEN>) id 1k4PSF-0005DX-TT; Sat, 08 Aug 2020 16:04:14 +0200 From: Lars Ingebrigtsen <larsi@HIDDEN> To: Amai Kinono <amaikinono@HIDDEN> Subject: Re: bug#39600: [PATCH] Fix handling of non-exclusive non-prefix completion functions References: <CAPu3fz2upooTeN7XmQt7q=W1FGxyk1pzaVqg+TQkEz7OnEYeaA@HIDDEN> Date: Sat, 08 Aug 2020 16:04:10 +0200 In-Reply-To: <CAPu3fz2upooTeN7XmQt7q=W1FGxyk1pzaVqg+TQkEz7OnEYeaA@HIDDEN> (Amai Kinono's message of "Fri, 14 Feb 2020 15:34:19 +0800") Message-ID: <874kpdz12d.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Amai Kinono <amaikinono@HIDDEN> writes: > Currently, with non-exclusive completion functions, Emacs will do > `try-completion` on the current text, and decide whether to try next > completion function based on that. This makes completion fu [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 39600 Cc: 39600 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Amai Kinono <amaikinono@HIDDEN> writes: > Currently, with non-exclusive completion functions, Emacs will do > `try-completion` on the current text, and decide whether to try next > completion function based on that. This makes completion functions that > can do non-prefix completions fails when the current text only occurs in > the middle of the candidates. This is a problem I found in a FIXME in > the code. > > # How does this work? > > I use `completion-all-completions` instead. As far as I know, this > respects the `completion-styles`. [...] Stefan, how does this patch look to you? > - ;; FIXME: Here we'd need to decide whether there are > - ;; valid completions against the current text. But this depends > - ;; on the actual completion UI (e.g. with the default completion > - ;; it depends on completion-style) ;-( > - ;; We approximate this result by checking whether prefix > - ;; completion might work, which means that non-prefix completion > - ;; will not work (or not right) for completion functions that > - ;; are non-exclusive. > - (null (try-completion (buffer-substring-no-properties > - (car res) (point)) > - (nth 2 res) > - (plist-get (nthcdr 3 res) :predicate))) > + (null (completion-all-completions > + (buffer-substring-no-properties (car res) (point)) > + (nth 2 res) > + (plist-get (nthcdr 3 res) :predicate) > + (- (point) (car res)))) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no
bug-gnu-emacs@HIDDEN
:bug#39600
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 14 Feb 2020 15:07:54 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 14 10:07:54 2020 Received: from localhost ([127.0.0.1]:34463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1j2cZN-0002CN-SD for submit <at> debbugs.gnu.org; Fri, 14 Feb 2020 10:07:54 -0500 Received: from lists.gnu.org ([209.51.188.17]:41615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <amaikinono@HIDDEN>) id 1j2VUg-0005le-LA for submit <at> debbugs.gnu.org; Fri, 14 Feb 2020 02:34:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55018) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <amaikinono@HIDDEN>) id 1j2VUe-0003Cg-SH for bug-gnu-emacs@HIDDEN; Fri, 14 Feb 2020 02:34:34 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <amaikinono@HIDDEN>) id 1j2VUd-0007gs-94 for bug-gnu-emacs@HIDDEN; Fri, 14 Feb 2020 02:34:32 -0500 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:40757) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <amaikinono@HIDDEN>) id 1j2VUd-0007gH-2z for bug-gnu-emacs@HIDDEN; Fri, 14 Feb 2020 02:34:31 -0500 Received: by mail-qk1-x744.google.com with SMTP id b7so8327468qkl.7 for <bug-gnu-emacs@HIDDEN>; Thu, 13 Feb 2020 23:34:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=PkTFLG20wezB0j2GOZioRETftw6BYh9JvAtxKLeFySI=; b=ZffBi031RNxgSt2+SqfmzaxMvp8Y3rC2S7sIiLpwgQSWfdX1WBlCgr6Snqdu6cjLal ydofjclMGi0Dxxe9FOlu7/Csn7I/NVPd6dXYGawBJ3HZGlzBr7IyM+bLOybL+5DjWeZp RoZ1a+M8X+CGlqv7Z7gsEICT4RmvMgMZ8Gi9rubNAdt+ADv76JBKRF2dUiJnXffEcNv5 1blbvf1aLD4eTPfW4igGMY89qtkAFf9M4uLZYQh9DP6wvTkT8PqLirVJGeiNfK3bVnmS QpMLcxq47FjgyB74AQyb1pncoKPEjQwbwdLFWdjO19eeKgHIoPmA3MXaaVgwWKBiRQ4l LJEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=PkTFLG20wezB0j2GOZioRETftw6BYh9JvAtxKLeFySI=; b=B3IXv8olZoSCkRwNYn5UcqGu3FVMsYE5s3+8Hhg++6Is2JEpvV15YikdI9H8Z6HMm7 2ueIWdnhaKMw7txpZFQTS5K/vjr/BLfF7h2Lb4ixkBCyhHWHwDjGQtUzKMNIMyvSUA9Y Y0oGatsSkWnEq911tToiEbJwMz/5IsSMJ03PYu9d1X5lZIfZ4hfNWtdOjesQc2OsuU3B N1d0vHlNTH1NFj5uSSTK9rWoJzDALPUVNYJsUVPzm85W9LacICOS4Re1vphcEGhqVIQg BK2fB3Y6HZ8MoCE6hoVKUukd2USnhXl6bezLo5gtPIII7P3mottieGwv8tix3ZX7Z1zO 0QuA== X-Gm-Message-State: APjAAAUVQPif67x5JpwzMgb8J6ElAZ9MvPkRPBO59aAFfnp9oUWblSh1 ipehU143/3j1LFI/d2RXT3MtKVswWCKdSa+DHK+WcU77m9E= X-Google-Smtp-Source: APXvYqwbnrmQo9+AALtl+0VMAU3mhdUbJM5B/wytwO2x8wnUEn2Nvl0OUqbaS4lV0mIobYpcq2kTIX1f90KBogYWHZ0= X-Received: by 2002:a05:620a:cc8:: with SMTP id b8mr1288485qkj.65.1581665670102; Thu, 13 Feb 2020 23:34:30 -0800 (PST) MIME-Version: 1.0 From: Amai Kinono <amaikinono@HIDDEN> Date: Fri, 14 Feb 2020 15:34:19 +0800 Message-ID: <CAPu3fz2upooTeN7XmQt7q=W1FGxyk1pzaVqg+TQkEz7OnEYeaA@HIDDEN> Subject: [PATCH] Fix handling of non-exclusive non-prefix completion functions To: bug-gnu-emacs@HIDDEN Content-Type: multipart/mixed; boundary="0000000000006ba657059e843c86" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: # What does this fix? Currently, with non-exclusive completion functions, Emacs will do `try-completion` on the current text, and decide whether to try next completion function based on that. This makes completion function [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (amaikinono[at]gmail.com) 0.0 HTML_MESSAGE BODY: HTML included in message 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 14 Feb 2020 10:07:53 -0500 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) --0000000000006ba657059e843c86 Content-Type: multipart/alternative; boundary="0000000000006ba656059e843c84" --0000000000006ba656059e843c84 Content-Type: text/plain; charset="UTF-8" # What does this fix? Currently, with non-exclusive completion functions, Emacs will do `try-completion` on the current text, and decide whether to try next completion function based on that. This makes completion functions that can do non-prefix completions fails when the current text only occurs in the middle of the candidates. This is a problem I found in a FIXME in the code. # How does this work? I use `completion-all-completions` instead. As far as I know, this respects the `completion-styles`. Here's a simple test. Eval this: ``` (require 'thingatpt) (defun my-completion-at-point () (let* ((symbol (thing-at-point 'symbol)) (bounds (bounds-of-thing-at-point 'symbol))) (list (car bounds) (cdr bounds) '("gnuemacs" "xemacs" "uemacs") :exclusive 'no))) (setq completion-at-point-functions '(my-completion-at-point elisp-completion-at-point)) (setq completion-styles '(substring)) ``` Now type "emacs" and press `C-M-i`, the candidates defined in `my-completion-at-point` will show up correctly. Now change `completion-styles` to `(basic)`, and complete "emacs" again, it fallbacks to `elisp-completion-at-point`. # The patch See the attachment. Since I don't know much about email, I'm not sure if gmail's attachment is permanent, so I'll also paste the diff and commit log here: ## Diff --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2244,18 +2244,11 @@ completion--capf-wrapper (unless (member fun completion--capf-safe-funs) (push fun completion--capf-safe-funs)) (and (eq 'no (plist-get (nthcdr 3 res) :exclusive)) - ;; FIXME: Here we'd need to decide whether there are - ;; valid completions against the current text. But this depends - ;; on the actual completion UI (e.g. with the default completion - ;; it depends on completion-style) ;-( - ;; We approximate this result by checking whether prefix - ;; completion might work, which means that non-prefix completion - ;; will not work (or not right) for completion functions that - ;; are non-exclusive. - (null (try-completion (buffer-substring-no-properties - (car res) (point)) - (nth 2 res) - (plist-get (nthcdr 3 res) :predicate))) + (null (completion-all-completions + (buffer-substring-no-properties (car res) (point)) + (nth 2 res) + (plist-get (nthcdr 3 res) :predicate) + (- (point) (car res)))) (setq res nil))) ((not (or (listp res) (functionp res))) (unless (member fun completion--capf-misbehave-funs) ## Commit Log Fix handling for non-exclusive non-prefix completion functions * lisp/minibuffer.el (completion--capf-wrapper): use completion-all-completions to do the test. --0000000000006ba656059e843c84 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"># What does this fix?<br><br>Currently, with non-exclusive= completion functions, Emacs will do<br>`try-completion` on the current tex= t, and decide whether to try next<br>completion function based on that. Thi= s makes completion functions that<br>can do non-prefix completions fails wh= en the current text only occurs in<br>the middle of the candidates. This is= a problem I found in a FIXME in<br>the code.<br><br># How does this work?<= br><br>I use `completion-all-completions` instead. As far as I know, this<b= r>respects the `completion-styles`.<br><br>Here's a simple test. Eval t= his:<br><br>```<br>(require 'thingatpt)<br>(defun my-completion-at-poin= t ()<br>=C2=A0 (let* ((symbol (thing-at-point 'symbol))<br>=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(bounds (bounds-of-thing-at-point 'symbol)))<br= >=C2=A0 =C2=A0 (list (car bounds) (cdr bounds)<br>=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 '("gnuemacs" "xemacs" "uemacs"= )<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :exclusive 'no)))<br>(setq comp= letion-at-point-functions<br>=C2=A0 =C2=A0 =C2=A0 '(my-completion-at-po= int elisp-completion-at-point))<br>(setq completion-styles '(substring)= )<br>```<br><br>Now type "emacs" and press `C-M-i`, the candidate= s defined in<br>`my-completion-at-point` will show up correctly. Now change= <br>`completion-styles` to `(basic)`, and complete "emacs" again,= it<br>fallbacks to `elisp-completion-at-point`.<br><br># The patch<br><br>= See the attachment. Since I don't know much about email, I'm not su= re if<br>gmail's attachment is permanent, so I'll also paste the di= ff and commit<br>log here:<br><br>## Diff<br><br>--- a/lisp/minibuffer.el<b= r>+++ b/lisp/minibuffer.el<br>@@ -2244,18 +2244,11 @@ completion--capf-wrap= per<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(unless (member fun complet= ion--capf-safe-funs)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pu= sh fun completion--capf-safe-funs))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(and (eq 'no (plist-get (nthcdr 3 res) :exclusive))<br>- =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; FIXME: Here we'd need to d= ecide whether there are<br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ;; valid completions against the current text.=C2=A0 But this depends<b= r>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; on the actual compl= etion UI (e.g. with the default completion<br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 ;; it depends on completion-style) ;-(<br>- =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; We approximate this result by = checking whether prefix<br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ;; completion might work, which means that non-prefix completion<br>- = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; will not work (or not r= ight) for completion functions that<br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 ;; are non-exclusive.<br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (null (try-completion (buffer-substring-no-properties<br>= - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(car res) (point= ))<br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (nth 2 res)<br>= - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (plist-get (nthcdr 3 r= es) :predicate)))<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (nu= ll (completion-all-completions<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(buffer-substring-no-properties (car = res) (point))<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(nth 2 res)<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(plist-get (nthcdr 3 res) :predicate)= <br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0(- (point) (car res))))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 (setq res nil)))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((not= (or (listp res) (functionp res)))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(unless (member fun completion--capf-misbehave-funs)<br><br>## Commit= Log<br><br>Fix handling for non-exclusive non-prefix completion functions<= br><br>* lisp/minibuffer.el (completion--capf-wrapper):<br>use completion-a= ll-completions to do the test.</div> --0000000000006ba656059e843c84-- --0000000000006ba657059e843c86 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Fix-handling-for-non-exclusive-non-prefix-completion.patch" Content-Disposition: attachment; filename="0001-Fix-handling-for-non-exclusive-non-prefix-completion.patch" Content-Transfer-Encoding: base64 Content-ID: <f_k6lutlbe0> X-Attachment-Id: f_k6lutlbe0 RnJvbSA0ZGQ0ZDU4ZDU2YzExMWViMWJhNDgyMTE5YzA3MTM0Yjg1NTkxNzQ3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbWFpS2lub25vIDxhbWFpa2lub25vQGdtYWlsLmNvbT4KRGF0 ZTogRnJpLCAxNCBGZWIgMjAyMCAxNDo1Mjo1NSArMDgwMApTdWJqZWN0OiBbUEFUQ0hdIEZpeCBo YW5kbGluZyBmb3Igbm9uLWV4Y2x1c2l2ZSBub24tcHJlZml4IGNvbXBsZXRpb24KIGZ1bmN0aW9u cwoKKiBsaXNwL21pbmlidWZmZXIuZWwgKGNvbXBsZXRpb24tLWNhcGYtd3JhcHBlcik6CnVzZSBj b21wbGV0aW9uLWFsbC1jb21wbGV0aW9ucyB0byBkbyB0aGUgdGVzdC4KLS0tCiBsaXNwL21pbmli dWZmZXIuZWwgfCAxNyArKysrKy0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDUgaW5zZXJ0 aW9ucygrKSwgMTIgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9taW5pYnVmZmVyLmVs IGIvbGlzcC9taW5pYnVmZmVyLmVsCmluZGV4IDQ5ZGFhYmMuLmY4MTFhNWYgMTAwNjQ0Ci0tLSBh L2xpc3AvbWluaWJ1ZmZlci5lbAorKysgYi9saXNwL21pbmlidWZmZXIuZWwKQEAgLTIyNDQsMTgg KzIyNDQsMTEgQEAgY29tcGxldGlvbi0tY2FwZi13cmFwcGVyCiAgICAgICAgICAgKHVubGVzcyAo bWVtYmVyIGZ1biBjb21wbGV0aW9uLS1jYXBmLXNhZmUtZnVucykKICAgICAgICAgICAgIChwdXNo IGZ1biBjb21wbGV0aW9uLS1jYXBmLXNhZmUtZnVucykpCiAgICAgICAgICAgKGFuZCAoZXEgJ25v IChwbGlzdC1nZXQgKG50aGNkciAzIHJlcykgOmV4Y2x1c2l2ZSkpCi0gICAgICAgICAgICAgICA7 OyBGSVhNRTogSGVyZSB3ZSdkIG5lZWQgdG8gZGVjaWRlIHdoZXRoZXIgdGhlcmUgYXJlCi0gICAg ICAgICAgICAgICA7OyB2YWxpZCBjb21wbGV0aW9ucyBhZ2FpbnN0IHRoZSBjdXJyZW50IHRleHQu ICBCdXQgdGhpcyBkZXBlbmRzCi0gICAgICAgICAgICAgICA7OyBvbiB0aGUgYWN0dWFsIGNvbXBs ZXRpb24gVUkgKGUuZy4gd2l0aCB0aGUgZGVmYXVsdCBjb21wbGV0aW9uCi0gICAgICAgICAgICAg ICA7OyBpdCBkZXBlbmRzIG9uIGNvbXBsZXRpb24tc3R5bGUpIDstKAotICAgICAgICAgICAgICAg OzsgV2UgYXBwcm94aW1hdGUgdGhpcyByZXN1bHQgYnkgY2hlY2tpbmcgd2hldGhlciBwcmVmaXgK LSAgICAgICAgICAgICAgIDs7IGNvbXBsZXRpb24gbWlnaHQgd29yaywgd2hpY2ggbWVhbnMgdGhh dCBub24tcHJlZml4IGNvbXBsZXRpb24KLSAgICAgICAgICAgICAgIDs7IHdpbGwgbm90IHdvcmsg KG9yIG5vdCByaWdodCkgZm9yIGNvbXBsZXRpb24gZnVuY3Rpb25zIHRoYXQKLSAgICAgICAgICAg ICAgIDs7IGFyZSBub24tZXhjbHVzaXZlLgotICAgICAgICAgICAgICAgKG51bGwgKHRyeS1jb21w bGV0aW9uIChidWZmZXItc3Vic3RyaW5nLW5vLXByb3BlcnRpZXMKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKGNhciByZXMpIChwb2ludCkpCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKG50aCAyIHJlcykKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAocGxpc3QtZ2V0IChudGhjZHIgMyByZXMpIDpwcmVkaWNhdGUpKSkKKyAg ICAgICAgICAgICAgIChudWxsIChjb21wbGV0aW9uLWFsbC1jb21wbGV0aW9ucworICAgICAgICAg ICAgICAgICAgICAgIChidWZmZXItc3Vic3RyaW5nLW5vLXByb3BlcnRpZXMgKGNhciByZXMpIChw b2ludCkpCisgICAgICAgICAgICAgICAgICAgICAgKG50aCAyIHJlcykKKyAgICAgICAgICAgICAg ICAgICAgICAocGxpc3QtZ2V0IChudGhjZHIgMyByZXMpIDpwcmVkaWNhdGUpCisgICAgICAgICAg ICAgICAgICAgICAgKC0gKHBvaW50KSAoY2FyIHJlcykpKSkKICAgICAgICAgICAgICAgIChzZXRx IHJlcyBuaWwpKSkKICAgICAgICAgICgobm90IChvciAobGlzdHAgcmVzKSAoZnVuY3Rpb25wIHJl cykpKQogICAgICAgICAgICh1bmxlc3MgKG1lbWJlciBmdW4gY29tcGxldGlvbi0tY2FwZi1taXNi ZWhhdmUtZnVucykKLS0gCjIuMjUuMAoK --0000000000006ba657059e843c86--
Amai Kinono <amaikinono@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#39600
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.