all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Daniel Nagy <danielnagy@posteo.de>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "66890@debbugs.gnu.org" <66890@debbugs.gnu.org>
Subject: bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument
Date: Sat, 4 Nov 2023 22:12:50 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488BA4FB3E3C2D5C05192DDF3A4A@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87jzqxgrof.fsf@posteo.de>

My 2c, FWIW -

Things don't have to be all-or-nothing.  A general
principle or approach is one consideration.  But
there can be others.

Stefan mentioned, I think, some specific contexts
where it makes little/no sense to accept a buffer
name in place of a buffer, as an argument.  Fine.
The doc should anyway make clear whether an actual
buffer is required.

There are other (maybe most?) contexts where it
can make sense to accept either one.

Please take a look at vanilla library bookmark.el.
I'm not saying that things are equivalent.  And
bookmark functions constitute a more isolated
context than buffer contexts - the latter are more
numerous and more variable.

But FWIW, bookmark.el functions used to accept
only a bookmark as argument.  Over time they were
systematically changed to accept either a bookmark
name (a string) or a bookmark (a list structure).
___

(This wasn't influenced by Bookmark+, BTW; it has
nothing to do with me.  And in Bookmark+ I prefer
to use the less cumbersome arg name BOOKMARK
instead of the name BOOKMARK-NAME-OR-RECORD, even
when the arg can be either a name or a bookmark.)
___

Similarly, vanilla Emacs used to use the arg name
BUFFER everywhere (whether or not a name was also
allowed), and in many places that was changed
over time to BUFFER-OR-NAME.  That there might be
more places where it makes sense for a function to
accept either seems reasonable.  That functions
should be considered individually also makes sense.

Should `buffer-size' allow a string argument -
that's the question raise here, no?  And Eli asked
the more general question of "whether it is worth
our while to convert more functions to accept both
buffers and names of buffers."  Whether you look
at one or several functions at a time, each should
be considered individually.
___

(Again, to me, the arg name BUFFER is preferable,
as long as the doc string makes clear (which it
really needs to do anyway) that either a string
or a buffer can be passed as arg.  But I'm not
suggesting that Emacs should change its naming
convention (again) in this regard.)





  reply	other threads:[~2023-11-04 22:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01 16:31 bug#66890: 29.1; buffer-size should also accept the buffer's name as string argument Daniel Nagy
2023-11-02  6:32 ` Eli Zaretskii
2023-11-02 19:38   ` Stefan Kangas
2023-11-02 20:55     ` Daniel Nagy
2023-11-03 13:38       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-04  0:21         ` Stefan Kangas
2023-11-04  6:03           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-04 10:43             ` Stefan Kangas
2023-11-04 20:57         ` Daniel Nagy
2023-11-04 22:12           ` Drew Adams [this message]
2023-11-05  5:35           ` Eli Zaretskii
2023-11-05 23:02           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]     ` <87bkcbzy6c.fsf@posteo.de>
2023-11-03  6:46       ` Eli Zaretskii

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=SJ0PR10MB5488BA4FB3E3C2D5C05192DDF3A4A@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=66890@debbugs.gnu.org \
    --cc=danielnagy@posteo.de \
    --cc=monnier@iro.umontreal.ca \
    /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.