Eli Zaretskii writes: >> Cc: 62417@debbugs.gnu.org >> From: João Távora >> Date: Fri, 24 Mar 2023 19:48:35 +0000 >> >> If the previous explanation is somehow hard to understand, here's a >> hopefully simpler one with a repro which doesn't require SLY. In Emacs >> 28 the docstring for `display-buffer-alist` states (emphasis mine): >> >> If non-nil, this is an alist of elements (CONDITION . ACTION), >> where: >> >> CONDITION is either a regexp matching buffer names, or a >> function that takes two arguments - a buffer name and the >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> ACTION argument of `display-buffer' - and returns a boolean. >> >> In Emacs 29, the docstring was changed to state: >> >> If non-nil, this is an alist of elements (CONDITION . ACTION), >> where: >> >> CONDITION is passed to `buffer-match-p', along with the buffer >> that is to be displayed and the ACTION argument of >> `display-buffer', to check if ACTION should be used. >> >> Any code that was written for the Emacs 28 contract in mind like, for >> example: >> >> (defun foop (buffer-name _alist) (string-match "foop" buffer-name)) >> >> (add-to-list 'display-buffer-alist '(foop . display-buffer-other-frame)) >> >> Will now fail with an obscure error message. I've checked "Incompatible >> Lisp Changes in Emacs 29.1" in etc/NEWS and could not find a mention to >> this, so I assume it was not intentional. >> >> So it is most clearly a regression. > > There's something missing in the above description, since > buffer-match-p accepts a function as its CONDITION argument, and calls > that function with the buffer and ACTION. We would have to call the function with the buffer name instead of the buffer object. So the `buffer-match-p' fix would look like this: