GNU bug report logs - #23533
24.5; test-completion with completion-regexp-list

Previous Next

Package: emacs;

Reported by: ynyaaa <at> gmail.com

Date: Fri, 13 May 2016 17:09:01 UTC

Severity: normal

Tags: confirmed, patch

Found in versions 24.5, 25.0.95

Fixed in version 26.0.50

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23533 in the body.
You can then email your comments to 23533 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#23533; Package emacs. (Fri, 13 May 2016 17:09:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to ynyaaa <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 13 May 2016 17:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ynyaaa <at> gmail.com
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; test-completion with completion-regexp-list
Date: Sat, 14 May 2016 01:57:26 +0900
Calling `test-completion' with non-empty `completion-regexp-list'
may cause an error.

(let ((completion-regexp-list '("")))
 (test-completion "XXX" '(("XXX"))))
error-> Wrong type argument: stringp, ("XXX")




In GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.0.6002
Configured using:
 `configure --prefix=/c/usr --host=i686-pc-mingw32'

Important settings:
  value of $LANG: JPN
  locale-coding-system: cp932

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:

Load-path shadows:
None found.

Features:
(advice rect debug help-mode pp shadow sort gnus-util mail-extr emacsbug
message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils
time-date japan-util tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win
w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
w32notify w32 multi-tty emacs)

Memory information:
((conses 8 79804 16234)
 (symbols 32 17797 0)
 (miscs 32 58 258)
 (strings 16 11770 3224)
 (string-bytes 1 298070)
 (vectors 8 10732)
 (vector-slots 4 468507 13202)
 (floats 8 62 414)
 (intervals 28 270 193)
 (buffers 508 20))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23533; Package emacs. (Fri, 17 Jun 2016 04:07:01 GMT) Full text and rfc822 format available.

Message #8 received at 23533 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: 23533 <at> debbugs.gnu.org
Cc: ynyaaa <at> gmail.com
Subject: 24.5; test-completion with completion-regexp-list
Date: Fri, 17 Jun 2016 00:06:44 -0400
found 23533 25.0.95
tag 23533 + confirmed patch
quit

Yup, test-completion doesn't handle testing an alist against
completion-regexp-list. Easy to fix:

diff --git i/src/minibuf.c w/src/minibuf.c
index d85a7a9..74be5d8 100644
--- i/src/minibuf.c
+++ w/src/minibuf.c
@@ -1665,6 +1665,8 @@ DEFUN ("test-completion", Ftest_completion,
Stest_completion, 2, 3, 0,
       tem = Fassoc_string (string, collection, completion_ignore_case
? Qt : Qnil);
       if (NILP (tem))
     return Qnil;
+      else if (CONSP (tem))
+        tem = XCDR (tem);
     }
   else if (VECTORP (collection))
     {




bug Marked as found in versions 25.0.95. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Fri, 17 Jun 2016 04:07:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed and patch. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Fri, 17 Jun 2016 04:07:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23533; Package emacs. (Sat, 18 Jun 2016 01:02:01 GMT) Full text and rfc822 format available.

Message #15 received at 23533 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: 23533 <at> debbugs.gnu.org
Cc: ynyaaa <at> gmail.com
Subject: Re: bug#23533: 24.5; test-completion with completion-regexp-list
Date: Fri, 17 Jun 2016 21:01:01 -0400
On Fri, Jun 17, 2016 at 12:06 AM, Noam Postavsky
<npostavs <at> users.sourceforge.net> wrote:
> +      else if (CONSP (tem))
> +        tem = XCDR (tem);

Of course that should be XCAR, not XCDR.

Should this go to master or emacs-25? The fix is simple (though I
managed to get it wrong once) and localized; on the other hand, it's
not a critical bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23533; Package emacs. (Sat, 18 Jun 2016 08:08:01 GMT) Full text and rfc822 format available.

Message #18 received at 23533 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: ynyaaa <at> gmail.com, 23533 <at> debbugs.gnu.org
Subject: Re: bug#23533: 24.5; test-completion with completion-regexp-list
Date: Sat, 18 Jun 2016 11:08:42 +0300
> From: Noam Postavsky <npostavs <at> users.sourceforge.net>
> Date: Fri, 17 Jun 2016 21:01:01 -0400
> Cc: ynyaaa <at> gmail.com
> 
> On Fri, Jun 17, 2016 at 12:06 AM, Noam Postavsky
> <npostavs <at> users.sourceforge.net> wrote:
> > +      else if (CONSP (tem))
> > +        tem = XCDR (tem);
> 
> Of course that should be XCAR, not XCDR.
> 
> Should this go to master or emacs-25? The fix is simple (though I
> managed to get it wrong once) and localized; on the other hand, it's
> not a critical bug.

I'm not sure this is a bug.  But if we want to allow this, the fix
should go to master.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23533; Package emacs. (Sat, 18 Jun 2016 17:16:02 GMT) Full text and rfc822 format available.

Message #21 received at 23533 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: ynyaaa <at> gmail.com, 23533 <at> debbugs.gnu.org
Subject: Re: bug#23533: 24.5; test-completion with completion-regexp-list
Date: Sat, 18 Jun 2016 13:14:59 -0400
On Sat, Jun 18, 2016 at 4:08 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> I'm not sure this is a bug.

I  think it's pretty clearly a bug, because the docs explain that
test-completion takes the same arguments as all-completions and
try-completions, which do handle an alist COLLECTION with a non-nil
completion-regexp-list.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23533; Package emacs. (Sat, 18 Jun 2016 17:29:02 GMT) Full text and rfc822 format available.

Message #24 received at 23533 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: ynyaaa <at> gmail.com, 23533 <at> debbugs.gnu.org
Subject: Re: bug#23533: 24.5; test-completion with completion-regexp-list
Date: Sat, 18 Jun 2016 20:29:39 +0300
> From: Noam Postavsky <npostavs <at> users.sourceforge.net>
> Date: Sat, 18 Jun 2016 13:14:59 -0400
> Cc: 23533 <at> debbugs.gnu.org, ynyaaa <at> gmail.com
> 
> On Sat, Jun 18, 2016 at 4:08 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > I'm not sure this is a bug.
> 
> I  think it's pretty clearly a bug, because the docs explain that
> test-completion takes the same arguments as all-completions and
> try-completions, which do handle an alist COLLECTION with a non-nil
> completion-regexp-list.

When code contradicts the documentation, it's not immediately clear
that the code should be fixed.

Anyway, I don't consider myself an expert on completion, so I feel
uneasy about makings this change without any of the experts voicing
their opinions on the change.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23533; Package emacs. (Sat, 18 Jun 2016 17:41:02 GMT) Full text and rfc822 format available.

Message #27 received at 23533 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: ynyaaa <at> gmail.com, 23533 <at> debbugs.gnu.org
Subject: Re: bug#23533: 24.5; test-completion with completion-regexp-list
Date: Sat, 18 Jun 2016 13:40:04 -0400
On Sat, Jun 18, 2016 at 1:29 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> From: Noam Postavsky <npostavs <at> users.sourceforge.net>
>> Date: Sat, 18 Jun 2016 13:14:59 -0400
>> Cc: 23533 <at> debbugs.gnu.org, ynyaaa <at> gmail.com
>>
>> On Sat, Jun 18, 2016 at 4:08 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> > I'm not sure this is a bug.
>>
>> I  think it's pretty clearly a bug, because the docs explain that
>> test-completion takes the same arguments as all-completions and
>> try-completions, which do handle an alist COLLECTION with a non-nil
>> completion-regexp-list.
>
> When code contradicts the documentation, it's not immediately clear
> that the code should be fixed.

Independently of the documentation, I also think it makes no sense to
have test-completion be inconsistent with all-completions and
try-completion.

>
> Anyway, I don't consider myself an expert on completion, so I feel
> uneasy about makings this change without any of the experts voicing
> their opinions on the change.

Okay, I will wait another week before pushing to master in case anyone
has some objections/comments.




Reply sent to Noam Postavsky <npostavs <at> users.sourceforge.net>:
You have taken responsibility. (Mon, 27 Jun 2016 01:15:02 GMT) Full text and rfc822 format available.

Notification sent to ynyaaa <at> gmail.com:
bug acknowledged by developer. (Mon, 27 Jun 2016 01:15:02 GMT) Full text and rfc822 format available.

Message #32 received at 23533-done <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: 23533-done <at> debbugs.gnu.org
Cc: ynyaaa <at> gmail.com, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#23533: 24.5; test-completion with completion-regexp-list
Date: Sun, 26 Jun 2016 21:14:46 -0400
Version: 25.2

On Sat, Jun 18, 2016 at 1:40 PM, Noam Postavsky
<npostavs <at> users.sourceforge.net> wrote:
> Okay, I will wait another week before pushing to master in case anyone
> has some objections/comments.

Pushed as dd98ee89




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 25 Jul 2016 11:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 21 Nov 2016 04:24:02 GMT) Full text and rfc822 format available.

bug No longer marked as fixed in versions 25.2. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 21 Nov 2016 04:24:02 GMT) Full text and rfc822 format available.

bug Marked as fixed in versions 26.0.50. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 21 Nov 2016 04:24:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 19 Dec 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 268 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.