unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: Bastien <bzg@altern.org>
Cc: Nicolas Richard <theonewiththeevillook@yahoo.fr>,
	Leo Liu <sdl.web@gmail.com>,
	16935@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <87vbvuxaz0.fsf@yahoo.fr> (raw)
In-Reply-To: <87mwh62fkq.fsf@bzg.ath.cx> (Bastien's message of "Tue, 04 Mar 2014 15:39:33 +0100")

Bastien <bzg@altern.org> writes:
> Leo Liu <sdl.web@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.





  reply	other threads:[~2014-03-04 15:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 14:12 bug#16935: 24.3.50; when tab-completing in 'M-x' : "Wrong type argument: numberp, nil" Nicolas Richard
2014-03-04 14:27 ` Leo Liu
2014-03-04 14:39   ` Bastien
2014-03-04 15:03     ` Nicolas Richard [this message]
2014-03-04 15:13       ` Bastien
2014-03-04 17:03     ` Glenn Morris
2014-03-04 17:21       ` Bastien
2014-03-05  0:15       ` Leo Liu
2014-03-05  7:08         ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbvuxaz0.fsf@yahoo.fr \
    --to=theonewiththeevillook@yahoo.fr \
    --cc=16935@debbugs.gnu.org \
    --cc=bzg@altern.org \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).