From: Sergey Organov <sorganov@gmail.com>
To: Philipp <p.stephani2@gmail.com>
Cc: martin rudalics <rudalics@gmx.at>, Eli Zaretskii <eliz@gnu.org>,
cpitclaudel@gmail.com, monnier@iro.umontreal.ca,
emacs-devel@gnu.org
Subject: Re: [PATCH] Should (buffer-list) ever return killed buffers?
Date: Mon, 24 May 2021 21:31:13 +0300 [thread overview]
Message-ID: <87wnrot24u.fsf@osv.gnss.ru> (raw)
In-Reply-To: <C96EF8E5-791B-4E88-99F8-530022E5D849@gmail.com> (Philipp's message of "Mon, 24 May 2021 18:07:41 +0200")
Philipp <p.stephani2@gmail.com> writes:
>> Am 24.05.2021 um 17:32 schrieb Sergey Organov <sorganov@gmail.com>:
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>>>> Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org
>>>> From: martin rudalics <rudalics@gmx.at>
>>>> Date: Mon, 24 May 2021 16:50:48 +0200
>>>>
>>>>>> + (unless (or (nill bufname)
>>>>>> + (eq (aref bufname 0) ?\s) ;; Don't kill internal buffers
>>>>>> (string-match-p preserve-regexp bufname))
>>>>>> (kill-buffer buffer)))))
>>>>>> (delete-other-windows)
>>>>>
>>>>> AFAICT, kill-buffer already is a no-op when the buffer is dead. So
>>>>> what exactly does this fix? (Apologies if I'm missing something: I
>>>>> cannot say that I've read all the discussions in this thread to the
>>>>> last detail.)
>>>>
>>>> Sergey never told us but it's likely `aref' choking on nil.
>>>
>>> Then why not use buffer-live-p?
>>
>> Cause aref is choking on bufname being nil, I think. What if
>> representation of killed buffers change?
>
> That won't happen. The ELisp manual guarantees that "[t]he
> ‘buffer-name’ of a buffer is ‘nil’ if, and only if, the buffer is
> killed."
Provide (null bufname) and (buffer-live-p buf) are synonyms, as the
manual claims,the former looks both more convenient and more logical in
this particular instance, as we already have bufname anyway, and the
problem is exactly because it's nil, not because the buffer is killed.
OTOH, killing of zombie buffer is not a problem by itself, so I don't
see why it should be explicitly checked and avoided.
Thanks,
-- Sergey Organov
next prev parent reply other threads:[~2021-05-24 18:31 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-23 23:14 Should (buffer-list) ever return killed buffers? Sergey Organov
2021-05-23 23:41 ` Stefan Monnier
2021-05-23 23:58 ` Sergey Organov
2021-05-24 3:32 ` Stefan Monnier
2021-05-24 14:15 ` martin rudalics
2021-05-24 14:23 ` Sergey Organov
2021-05-24 16:31 ` Stefan Monnier
2021-05-24 17:05 ` martin rudalics
2021-05-24 19:55 ` Stefan Monnier
2021-05-24 20:27 ` Sergey Organov
2021-05-25 6:49 ` martin rudalics
2021-05-24 13:41 ` [PATCH] " Sergey Organov
2021-05-24 14:04 ` Tassilo Horn
2021-05-24 14:25 ` Sergey Organov
2021-05-24 14:27 ` Eli Zaretskii
2021-05-24 14:50 ` martin rudalics
2021-05-24 15:05 ` Eli Zaretskii
2021-05-24 15:32 ` Sergey Organov
2021-05-24 16:07 ` [PATCH] " Philipp
2021-05-24 18:11 ` Sergey Organov
2021-05-24 18:31 ` Sergey Organov [this message]
2021-05-24 16:25 ` [PATCH] " Eli Zaretskii
2021-05-24 18:09 ` Sergey Organov
2021-05-24 16:04 ` martin rudalics
2021-05-24 16:30 ` Eli Zaretskii
2021-05-24 19:01 ` Stefan Monnier
2021-05-24 15:14 ` Sergey Organov
2021-07-22 11:27 ` Sergey Organov
2021-05-23 23:42 ` Clément Pit-Claudel
2021-05-23 23:55 ` Sergey Organov
2021-05-23 23:56 ` Clément Pit-Claudel
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wnrot24u.fsf@osv.gnss.ru \
--to=sorganov@gmail.com \
--cc=cpitclaudel@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=p.stephani2@gmail.com \
--cc=rudalics@gmx.at \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.