bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24966: 26.0.50;


From: Mark Oteiza
Subject: bug#24966: 26.0.50;
Date: Mon, 21 Nov 2016 14:42:26 -0500
User-agent: Mutt/1.7.1+41 (5382e1e4cee1) (2016-10-04)

On 20/11/16 at 11:24pm, address@hidden wrote:
> unarchive 23533
> # It was marked for 25.2 before master was renumbered to 26
> notfixed 23533 25.2
> fixed 23533 26.0.50
> retitle 24966 26.0.50; test-completion with alist COLLECTION calls PREDICATE 
> incorrectly
> tags 24966 confirmed
> quit
> 
> Mark Oteiza <address@hidden> writes:
> 
> > Hi,
> >
> > dd98ee8992c3246861e44 appears to be the culprit for breaking the
> > following from -Q:
> 
> Yup, I didn't fix test-completion correctly.
> 
> >
> > 1. C-x C-f /tmp/foo.tex
> > 2. M-x reftex-mode
> > 3. Insert the following: \label{foobar}
> > 4. M-x reftex-goto-label
> >
> > and, when attempting to complete, a wrong-type-argument error occurs.
> >
> > Debugger entered--Lisp error: (wrong-type-argument listp "argh")
> >   #[(x) "@;\207" [x] 1]("argh")
> >   test-completion("argh" ((xr nil "\\\\\\\\\\\\") (index-tags) (is-multi 
> > nil) (bibview-cache) (master-dir . "/tmp/") (label-numbers) (bof 
> > "/tmp/lol.tex") ("argh" "s" " " "/tmp/lol.tex" nil) (eof "/tmp/lol.tex")) 
> > #[(x) "@;\207" [x] 1])
> 
> I tentatively suggest the patch below, but I want to add some tests
> before commiting anything.
> 
> diff --git i/src/minibuf.c w/src/minibuf.c
> index 57eea05..fe187b3 100644
> --- i/src/minibuf.c
> +++ w/src/minibuf.c
> @@ -1686,8 +1686,6 @@ 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 = XCAR (tem);
>      }
>    else if (VECTORP (collection))
>      {
> @@ -1765,14 +1763,16 @@ DEFUN ("test-completion", Ftest_completion, 
> Stest_completion, 2, 3, 0,
>    /* Reject this element if it fails to match all the regexps.  */
>    if (CONSP (Vcompletion_regexp_list))
>      {
> +      Lisp_Object temstr = (CONSP (tem)) ? XCAR (tem) : tem;
> +      if (SYMBOLP (temstr))
> +        temstr = string;
> +
>        ptrdiff_t count = SPECPDL_INDEX ();
>        specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil);
>        for (regexps = Vcompletion_regexp_list; CONSP (regexps);
>          regexps = XCDR (regexps))
>       {
> -       if (NILP (Fstring_match (XCAR (regexps),
> -                                SYMBOLP (tem) ? string : tem,
> -                                Qnil)))
> +       if (NILP (Fstring_match (XCAR (regexps), temstr, Qnil)))
>           return unbind_to (count, Qnil);
>       }
>        unbind_to (count, Qnil);
> 

Thanks, this does indeed fix the recipe.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]