From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: Revamping bs.el Date: Mon, 12 Dec 2022 23:48:16 +0100 Message-ID: References: <83v8mo7mnz.fsf@gnu.org> <83o7sg7lzk.fsf@gnu.org> <83ilio7gq9.fsf@gnu.org> <83zgbz4brj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000bd704805efa94e5e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28212"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 12 23:49:57 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p4rcR-0007BJ-Ls for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Dec 2022 23:49:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4rbn-0001Cu-A9; Mon, 12 Dec 2022 17:49:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4rbW-00017i-NN for emacs-devel@gnu.org; Mon, 12 Dec 2022 17:49:14 -0500 Original-Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4rbU-00021b-1O; Mon, 12 Dec 2022 17:48:57 -0500 Original-Received: by mail-ej1-x62e.google.com with SMTP id vv4so32114353ejc.2; Mon, 12 Dec 2022 14:48:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6bl6sKv8RcqLOl1qG7jOgkwj0RmeQkgKzRFSItAca4E=; b=HMawX0FvWJgzKmHcM5IjA1qf0ZUG6321pYv0eqPMb2OvU+bEzURQC0bYKFIg9WgcO8 AYHYugjg4hjZXDbYcUi3AATuDLYpOja5Ff7x7z/+pDbs2jguJ4TTbGeoXbtALUON5LIj +BdxL1Y4HcNr7Bj/dt8t3zWSDx6DF533QGxxx5m/3nTLfvDMsfiX4WeqX1/FTRVjaTvU YTZ1LLaMC7FYmmhPJ2elNulbYQNcpkoeDzerAtF6cWk2F2SmyjnHG9oC2E85HLjmWWc/ nMrlPtfmbSVF5EhOgIiyhzw4x/OuG2MRUBycTiQZ/2t6t+LMTs1l2DqfAsJgWkHhS18N 0tLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6bl6sKv8RcqLOl1qG7jOgkwj0RmeQkgKzRFSItAca4E=; b=Ck+XaGD0JOyCwdXdgMNAMZ5GRuB/Mcvd/rx3zqEwLByCSBY27HrBXxihRxkBrPC1dn k35EZ9uLWIBgtV0y6hKSHU/cLhHpsC/b+fqcW++oV4/ZvQrhw9TqAjDiJwh4tb9B+Tpc jI1uHckj3sboI2TkctZr9A0ScDnWBbRwyoX+e9BZTzxKMmwyJYpNhN5KkKoigOjazcdE 4brCxMfvSuQrI+26M/ronOeZ63bENEyNPAyfOwCJLSGC6p0x5JFT1B2pu3mTjx2D6Uas cDf0jrE5pi3+VGXT1Ln3BurQjYlQisMyA90bAdI+syy3zKlg7i9gF6i5hCSyoutv0jGt 92EA== X-Gm-Message-State: ANoB5pmDbXCU6M2+1ho6BJjkg4cv1VffflWpzjzgRJH45IH49MDDeXo6 jixU/tB+bQMVIk/NclxMIDqu4CnEEiXqYT0RVzA1uDXP X-Google-Smtp-Source: AA0mqf6/8FftnYDKl1R/0hlfwJSC4R9F2nKjHsVTiqQErpXyJ8bbWOl8j8/9WvlFz+EKcdz+sR5qXkYASjc6hVtBGMA= X-Received: by 2002:a17:907:2147:b0:7c1:541c:209a with SMTP id rk7-20020a170907214700b007c1541c209amr540872ejb.471.1670885333100; Mon, 12 Dec 2022 14:48:53 -0800 (PST) In-Reply-To: <83zgbz4brj.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=lekktu@gmail.com; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:301287 Archived-At: --000000000000bd704805efa94e5e Content-Type: text/plain; charset="UTF-8" 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. --000000000000bd704805efa94e5e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
There are a few errors in the current bs.el that nobody has reported, l= ikely because
nobody is using the functionality.

- The docstring for = `bs-attributes-list' says that there are four fields (HEADER,
=C2=A0 MIN= IMUM-LENGTH, MAXIMUM-LENGTH and FUN-OR-STRING) that can either be a value
= =C2=A0 (string=C2=A0for=C2=A0HEADER and FUN-OR-STRING, a number for the LENGTH fields) or a function
=C2=A0 th= at=C2=A0returns=C2=A0th= e relevant value. And then:

=C2=A0 The functi= on gets as parameter the buffer where we have started
=C2=A0 buffer sele= ction and the list of all buffers to show.=C2=A0 The function must
=C2= =A0 return a string representing the column's value.


but the fi= rst 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 presumab= ly the
MAXIMUM-LENGTH function, if any, would too, but that col= umn 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=C2=A0line, and n= ot the content).

- Then there's `bs--make-header-match-string= 9;, which totally ignores the possibility of
=C2=A0 HEADER bein= g a function. Also, it constructs a regexp=C2=A0by concatenating strings wi= thout
=C2=A0 regexp-quote'ing them. But there's no guar= antee anywhere that a column title can not be
=C2=A0 something = like "THIS*MUCH" or "Money$" or whatever.

`bs--m= ake-header-match' is an internal function, and will disappear in 30.1 w= ith my
tabulated-list changes, because it's no longer relev= ant. I can "fix" it in 29.1, but I'd
= prefer not t= o 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 o= ther bugs.

Fixing the docstring of `bs-attributes-list' is anoth= er matter. I'd like to document the
profile parameter of H= EADER and MINIMUM-LENGTH, reduce the description of
MAXIMUM-LENGT= H
to just "(curr= ently ignored)" and clarify that the last paragraph
of the docstri= ng is=C2=A0
talking only= about FUN-OR-STRING.

--000000000000bd704805efa94e5e--