emacs-devel
[Top][All Lists]
Advanced

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

Re: Revamping bs.el


From: Juanma Barranquero
Subject: Re: Revamping bs.el
Date: Mon, 12 Dec 2022 23:48:16 +0100

There are a few errors in the current bs.el that nobody has reported, likely because
nobody is using the functionality.

- The docstring for `bs-attributes-list' says that there are four fields (HEADER,
  MINIMUM-LENGTH, MAXIMUM-LENGTH and FUN-OR-STRING) that can either be a value
  (string for HEADER and FUN-OR-STRING, a number for the LENGTH fields) or a function
  that returns the relevant value. And then:

  The function gets as parameter the buffer where we have started
  buffer selection and the list of all buffers to show.  The function must
  return a string representing the column's value.


but the first sentence is only true for FUN-OR-STRING. The only case of
MINIMUM-LENGTH being a function in bs.el is called without arguments (and presumably the
MAXIMUM-LENGTH function, if any, would too, but that column is 'currently ignored' since
forever). There are no examples of a HEADER function, but presumably it would also be
called without arguments (as it is relevant to the header line, and not the content).

- Then there's `bs--make-header-match-string', which totally ignores the possibility of
  HEADER being a function. Also, it constructs a regexp by concatenating strings without
  regexp-quote'ing them. But there's no guarantee anywhere that a column title can not be
  something like "THIS*MUCH" or "Money$" or whatever.

`bs--make-header-match' is an internal function, and will disappear in 30.1 with my
tabulated-list changes, because it's no longer relevant. I can "fix" it in 29.1, but I'd
prefer not to do it, as obviously the "call function to get the column header"
functionality seems to have been mostly ignored. There's not much point in introducing a
change now that could lead to other bugs.

Fixing the docstring of `bs-attributes-list' is another matter. I'd like to document the
profile parameter of HEADER and MINIMUM-LENGTH, reduce the description of
MAXIMUM-LENGTH
to just "(currently ignored)" and clarify that the last paragraph
of the docstring is 
talking only about FUN-OR-STRING.


reply via email to

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