[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#66890: 29.1; buffer-size should also accept the buffer's name as str
From: |
Stefan Kangas |
Subject: |
bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument |
Date: |
Fri, 3 Nov 2023 17:21:44 -0700 |
Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:
> I do have an opinion on this: I wish I could go back in time and get rid
> of this `buffer-or-string` business altogether.
>
> The reason is that I've seen several ELisp packages which abused buffer
> names as "handles" for buffers, leading to nasty bugs when those buffers
> get renamed (e.g. by things like uniquify).
I'm not sure which way to lean here: writing ELisp customizations is
easier for regular users if these functions accept either buffer or
string. It's also less verbose.
OTOH, perhaps you're right that it's just too brittle.
Do you have some sense for how common that class of bugs are?
My guess is that we have a few of them in our tree, too.
> It's not important enough to motivate making backward
> incompatible changes.
>
> Maybe we should just "de-emphasize" the fact that those functions also
> accept strings, and instead insist that you have to go through
> `get-buffer` (or `get-buffer-create`). If that sounds vague and you
> don't know what that would mean concretely, well.. you're not alone :-)
Perhaps we could recommend against abusing it in `(elisp) Tips'.
- bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument, Daniel Nagy, 2023/11/02
- bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument, Eli Zaretskii, 2023/11/02
- bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument, Daniel Nagy, 2023/11/04
- bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument, Drew Adams, 2023/11/04
- bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument, Eli Zaretskii, 2023/11/05
- bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument, Stefan Monnier, 2023/11/05
- Message not available
- bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument, Eli Zaretskii, 2023/11/03