unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Drew Adams <drew.adams@oracle.com>
Cc: 25032@debbugs.gnu.org
Subject: bug#25032: 25.1; `bookmark-set-internal', `bookmark-set-no-overwrite'
Date: Tue, 2 Jul 2019 07:23:27 +0200	[thread overview]
Message-ID: <CADwFkmknRXCYxAouO8a3in1REUJkaXjMws50HyUKuJz4h=Vmhw@mail.gmail.com> (raw)
In-Reply-To: <a2aaddd0-ce03-44f8-831f-5e0cbc1a0896@default>

Drew Adams <drew.adams@oracle.com> writes:

> 3. Similarly, why does the doc string of `bookmark-set-internal' say
>    "_Interactively_..."?  It should just say that it prompts for a
>    bookmark name and then...  And "error" is not easily and commonly
>    understood as a verb - use "raise an error" instead.

I have attached a patch which tries to improve the doc string.

> 4. `bookmark-set-internal' should preferably not accept both args PROMPT
>    and NAME.

See below.

>               If NAME is present (e.g. for non-interactive use of
>    `bookmark-set') then PROMPT makes no sense and is not used (and the
>    doc string is wrong about PROMPT in that case).

Please see if my above patch does not improve the situation.

> 5. In `bookmark-set-internal', a nil third arg should have been used to
>    mean overwrite, not raise an error, as overwriting is still, and
>    always has been, the default behavior of `bookmark-set'.  You should
>    have introduced the new value `error', not the new value `overwrite',
>    and kept the default (nil) behavior as overwriting.

I see your point.  But on the other hand a user can just use
bookmark-set and bookmark-set-overwrite, which are not advertised as
internal.

>    You will no doubt argue that this does not matter because
>    `bookmark-set-internal' is "internal".  But the main command is
>    still, and should still be `bookmark-set'.  `bookmark-set-internal'
>    should reflect _its_ behavior for the default case (nil).

I suspect that some of the things above will be a bit tricky to fix if
we still want to keep this as a general (internal) function used by
bookmark-set and bookmark-set-internal.  Which would be the main purpose
of this function, as I understand it.

The way it's written actually makes the implementation of the latter two
functions very straghtforward.  The code is not very hard to follow, in
my opinion.  But it's harder to think of a better alternative.

So, after we improve the doc string, this reviewer sees two options for
moving forward here:

1. Someone writes up a concrete suggestion.
2. We close this as wontfix and move on.

Thanks,
Stefan Kangas





  parent reply	other threads:[~2019-07-02  5:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-26  0:21 bug#25032: 25.1; `bookmark-set-internal', `bookmark-set-no-overwrite' Drew Adams
2019-06-12  9:09 ` Stefan Kangas
2019-07-02  5:23 ` Stefan Kangas [this message]
2019-07-02  5:27   ` Stefan Kangas
2019-07-02 16:48     ` Eli Zaretskii
2019-07-02 17:07       ` Stefan Kangas
2019-07-06  8:55         ` 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmknRXCYxAouO8a3in1REUJkaXjMws50HyUKuJz4h=Vmhw@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=25032@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).