bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#62417: ; Regression: 59ecf25fc860 is the first bad commit


From: Eli Zaretskii
Subject: bug#62417: ; Regression: 59ecf25fc860 is the first bad commit
Date: Mon, 27 Mar 2023 19:33:53 +0300

> Cc: philipk@posteo.net, 62417@debbugs.gnu.org
> Date: Mon, 27 Mar 2023 18:20:48 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > From: João Távora <joaotavora@gmail.com>
> > Date: Mon, 27 Mar 2023 14:08:17 +0000
> > Cc: philipk@posteo.net, 62417@debbugs.gnu.org
> > 
> > > since buffer-match-p accepts
> > > both buffers and their names.  Please explain.
> > 
> > In the patch I showed, which you and Philip approved, the docstring of
> > the variable display-buffer-alist was clarified to state that it is a buffer
> > name string, and _not_ a buffer object, that is passed to buffer-match-p.
> > This is absolutely necessary, and we've already been through this.
> 
> I don't understand why this is necessary, and I didn't intend to limit
> buffer-match-p to accepting only buffer names.  Please explain why is
> it necessary.
> 
> What I did say was that _if_ buffer-match-p will be able to accept
> _both_ buffer names and objects _and_ will pass to the function
> exactly the argument it was passed, i.e. either a buffer object or a
> name of a buffer, _then_ the backward-incompatibility will be solved.
> 
> The responsibility of making sure buffer-match-p accepts a name when
> the function expects only names is _on_the_caller_.  And the caller is
> NOT display-buffer, it's the Lisp code which calls display-buffer or
> which prepares the alist that will be passed to display-buffer.

To make a long story short: here's how the call to
display-buffer-assq-regexp looked like in Emacs 28:

      (let* ((user-action
              (display-buffer-assq-regexp
               (buffer-name buffer) display-buffer-alist action))

And here's how it looks like in Emacs 29:

    (let* ((user-action
            (display-buffer-assq-regexp
             buffer display-buffer-alist action))

Your change modified display-buffer-assq-regexp to pass to
buffer-match-p the name of the buffer if display-buffer-assq-regexp
was called with a buffer object.  This is not TRT, since, among other
issues, it changes the API of display-buffer-assq-regexp, which is a
public function.  Instead, we should do the following:

 . restore the calling convention of display-buffer-assq-regexp as it
   was in Emacs 28, where it accepted only buffer names, and fix its
   doc string accordingly
 . remove from display-buffer-assq-regexp the code which ensures
   buffer-match-p is called with the name of the buffer
 . make sure display-buffer call display-buffer-assq-regexp with a
   buffer's name, as it did in Emacs 28

OK?

(I can do this myself if you agree, and there are no other
objections.)





reply via email to

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