bug#80499: 31.0.50; dired-auto-toggle-b-switch does not work as expected

Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
On Thu, 23 Jul 2026 16:16:58 +0100 Sean Whitton <[email protected]> wrote:

> Stephen Berman [14/Jul  4:31pm +02] wrote:
>> On Tue, 14 Jul 2026 12:31:08 +0100 Sean Whitton <[email protected]> wrote:
>>
>>> Stephen Berman [13/Jul  7:18pm +02] wrote:
>>>> In case this has fallen under Sean's radar, is it ok to install in the
>>>> release branch the variant of the above patch using
>>>> `generate-new-buffer' instead of `get-buffer-create'?
>>>
>>> I don't think this variant has actually been posted, just described?
>>
>> Right, because compared to the previous patch I posted it's just a
>> single substitution of a function name; but here's the new patch:
>>
>> diff --git a/lisp/files.el b/lisp/files.el
>> index 149a3e80866..df6cc562065 100644
>> --- a/lisp/files.el
>> +++ b/lisp/files.el
>> @@ -8486,9 +8486,12 @@ insert-directory
>>          ;; error.
>>          (when (> (file-attribute-size (file-attributes errfile)) 0)
>>            (defvar dired--ls-error-buffer) ; Pacify byte-compiler.
>> -          (let ((errbuf (get-buffer-create "*ls error*")))
>> +          (let ((errbuf (or (get-buffer "*ls error*")
>> +                            (let ((buf (generate-new-buffer "*ls error*")))
>> +                              (with-current-buffer buf
>> +                                (setq buffer-read-only t))
>> +                              buf))))
>>              (with-current-buffer errbuf
>> -              (setq buffer-read-only t)
>>                (let ((inhibit-read-only t))
>>                  (erase-buffer)
>>                  (insert-file-contents errfile)))
>>
>> But I forgot that we're discussing a reformulation of commit c9da3c1a5ed
>> to master, so obviously whichever patch is chosen must go to master, not
>> the release branch.
>
> This patch looks good to me, thanks.

Thanks, now pushed to master as commit 75441af2c5a.

Steve Berman
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.