GNU bug report logs - #16935
24.3.50; when tab-completing in 'M-x' : "Wrong type argument: numberp, nil"

Previous Next

Package: emacs;

Reported by: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>

Date: Tue, 4 Mar 2014 14:13:02 UTC

Severity: normal

Tags: patch

Merged with 16933, 16934

Found in version 24.3.50

Done: Bastien <bzg <at> altern.org>

Bug is archived. No further changes may be made.

Full log


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

From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: Bastien <bzg <at> altern.org>
Cc: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>,
 Leo Liu <sdl.web <at> gmail.com>, 16935 <at> debbugs.gnu.org
Subject: Re: bug#16935: 24.3.50;
 when tab-completing in 'M-x' : "Wrong type argument: numberp, nil"
Date: Tue, 04 Mar 2014 16:03:15 +0100
Bastien <bzg <at> altern.org> writes:
> Leo Liu <sdl.web <at> gmail.com> writes:
>> I noticed this error too. (base-size (cdr last)) is used in 24.3 and no
>> errors there. So it will be good to know where the problem originated
>> and fix it.
> The commit makes `base-size' optional, so we need to ensure it
> falls back to 0 instead of nil.

Shouldn't base-size default to 0 in completion-hilit-commonality then,
to avoid having to fix code that relies on base-size being an integer
everywhere else ? Or were all such occurrences found already ?

--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1595,11 +1595,12 @@ This adds the face `completions-common-part' to the first
 `completions-first-difference' to the first character after that.
 
 It returns a list with font-lock properties applied to each element,
-and with BASE-SIZE appended as the last element."
+and with BASE-SIZE (or zero) appended as the last element."
+  (or base-size (setq base-size 0))
   (when completions
     (if (zerop prefix-len)
         completions
-      (let ((com-str-len (- prefix-len (or base-size 0))))
+      (let ((com-str-len (- prefix-len base-size)))
         (nconc
          (mapcar
           (lambda (elem)


-- 
Nico.




This bug report was last modified 11 years and 140 days ago.

Previous Next


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