Subject: bug#26317: closed (Re: bug#26317: 26.0.50; Small incompatibility in ibuffer.el (ibuffer-compile-format))

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 31 Mar 2017 00:26:02 +0000

Your bug report

#26317: 26.0.50; Small incompatibility in ibuffer.el (ibuffer-compile-format)

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
26317: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26317
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#26317: 26.0.50; Small incompatibility in ibuffer.el (ibuffer-compile-format)
From: Mark Oteiza <[email-masked]>
To: John Mastro <[email-masked]>
Cc: [email-masked]
Date: Thu, 30 Mar 2017 20:25:06 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

John Mastro <[email-masked]> writes:

> John Mastro <[email-masked]> wrote:
>> In commit 7e2a8b1, ibuffer.el was change to use `string-width' in a couple
>> places where it previously used `length'. The result is that custom columns
>> which can return nil, which worked in Emacs 25, will now cause an error.
>
> I've attached a patch that fixes this. Rather than touching the calls to
> `string-width' directly, it translates nil to the empty string. Either
> way restores compatibility with Emacs 25, but translating nil to the
> empty string seems preferable in that it saves later code from caring.
>
> Even though it's a tiny change, I'm not a regular contributor or
> particularly familiar with ibuffer's implementation, so any review is
> appreciated. My copyright assignment is on file.

LGTM.  Sorry for breaking it, and thanks for the fix!

Applied as eeaa707.

Subject: 26.0.50; Small incompatibility in ibuffer.el (ibuffer-compile-format)
From: John Mastro <[email-masked]>
To: [email-masked]
Date: Thu, 30 Mar 2017 16:07:59 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

In commit 7e2a8b1, ibuffer.el was change to use `string-width' in a couple
places where it previously used `length'. The result is that custom columns
which can return nil, which worked in Emacs 25, will now cause an error.

To reproduce, run `emacs -Q', yank the following into *scratch*, and evaluate
it:

    (require 'ibuffer)

    (define-ibuffer-column my-column
      (:name "X")
      (and (equal (buffer-name) "*scratch*") "Y"))

    (setq ibuffer-formats '((mark modified read-only
                                  " " (name 18 18 :left :elide)
                                  " " (my-column 5 5 :left)
                                  " " filename-and-process)))

    (ibuffer)

It works in Emacs 25, but in Emacs 26 an error is signaled:

    Debugger entered--Lisp error: (wrong-type-argument stringp nil)
      string-width(nil)

I came across this because I use the `ibuffer-vc' package, which defines a
column (`vc-status') whose implementation returns nil for some buffers (by
default, non-file-visiting buffers and buffers visiting remote files).

I will follow up with a patch in a separate email (so I can include the bug
number in the commit message).

        John