GNU bug report logs - #26317
26.0.50; Small incompatibility in ibuffer.el (ibuffer-compile-format)

Previous Next

Package: emacs;

Reported by: John Mastro <john.b.mastro <at> gmail.com>

Date: Thu, 30 Mar 2017 23:09:01 UTC

Severity: normal

Found in version 26.0.50

Done: Mark Oteiza <mvoteiza <at> udel.edu>

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 26317 in the body.
You can then email your comments to 26317 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#26317; Package emacs. (Thu, 30 Mar 2017 23:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Mastro <john.b.mastro <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 30 Mar 2017 23:09:02 GMT) Full text and rfc822 format available.

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

From: John Mastro <john.b.mastro <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; Small incompatibility in ibuffer.el (ibuffer-compile-format)
Date: Thu, 30 Mar 2017 16:07:59 -0700
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26317; Package emacs. (Thu, 30 Mar 2017 23:16:01 GMT) Full text and rfc822 format available.

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

From: John Mastro <john.b.mastro <at> gmail.com>
To: 26317 <at> debbugs.gnu.org
Subject: Re: bug#26317: 26.0.50;
 Small incompatibility in ibuffer.el (ibuffer-compile-format)
Date: Thu, 30 Mar 2017 16:15:16 -0700
[Message part 1 (text/plain, inline)]
John Mastro <john.b.mastro <at> gmail.com> 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.

        John
[0001-Fix-a-small-incompatibility-in-ibuffer.patch (application/octet-stream, attachment)]

Reply sent to Mark Oteiza <mvoteiza <at> udel.edu>:
You have taken responsibility. (Fri, 31 Mar 2017 00:26:02 GMT) Full text and rfc822 format available.

Notification sent to John Mastro <john.b.mastro <at> gmail.com>:
bug acknowledged by developer. (Fri, 31 Mar 2017 00:26:02 GMT) Full text and rfc822 format available.

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

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: John Mastro <john.b.mastro <at> gmail.com>
Cc: 26317-done <at> debbugs.gnu.org
Subject: Re: bug#26317: 26.0.50;
 Small incompatibility in ibuffer.el (ibuffer-compile-format)
Date: Thu, 30 Mar 2017 20:25:06 -0400
John Mastro <john.b.mastro <at> gmail.com> writes:

> John Mastro <john.b.mastro <at> gmail.com> 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.




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

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

Previous Next


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