From: Juanma Barranquero <lekktu@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Revamping bs.el
Date: Mon, 12 Dec 2022 23:48:16 +0100 [thread overview]
Message-ID: <CAAeL0SS09ZpxDnBEb-=gxAqMFOQYibwB164MNY-3JrgdmXmzYw@mail.gmail.com> (raw)
In-Reply-To: <83zgbz4brj.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2034 bytes --]
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.
[-- Attachment #2: Type: text/html, Size: 4267 bytes --]
next prev parent reply other threads:[~2022-12-12 22:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 2:13 Revamping bs.el Juanma Barranquero
2022-12-06 12:16 ` Eli Zaretskii
2022-12-06 12:23 ` Juanma Barranquero
2022-12-06 12:30 ` Eli Zaretskii
2022-12-06 12:37 ` Juanma Barranquero
2022-12-06 14:24 ` Eli Zaretskii
2022-12-07 1:39 ` Juanma Barranquero
2022-12-07 12:52 ` Eli Zaretskii
2022-12-12 22:48 ` Juanma Barranquero [this message]
2022-12-13 12:10 ` Eli Zaretskii
2022-12-13 12:31 ` Juanma Barranquero
2022-12-13 13:23 ` Eli Zaretskii
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='CAAeL0SS09ZpxDnBEb-=gxAqMFOQYibwB164MNY-3JrgdmXmzYw@mail.gmail.com' \
--to=lekktu@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/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).