unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: Jamie Beardslee <beardsleejamie@gmail.com>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: [PATCH] Add user option to disable location in bookmarks
Date: Sun, 21 Jun 2020 16:13:06 +0700	[thread overview]
Message-ID: <CAP_d_8VdTROspAYgUZmTNgRMa75k3YKuj2tML81uds4znZJF3Q@mail.gmail.com> (raw)
In-Reply-To: <062414c6-41f4-4803-9a62-28274825b8e0@default>

On Sun, 21 Jun 2020 at 06:34, Drew Adams <drew.adams@oracle.com> wrote:

> If this is about save-place then save-place should
> do the right thing.  See above.  If there's an option
> to be added in that regard, it's a save-place option:
> `save-place-ignore-bookmark-position'.  The hook
> function (see above) can move to the save-place place
> if the option is non-nil, and just do nothing if it's
> nil.

I think you are too quick in punting the change to ‘save-place’.

I think it’s a matter of user expectations.

You expect that a bookmark targets a particular location in the file.
(There are bookmarks that do not target a file; let’s ignore them for
now.) Activating the bookmark visits that file (if not already
visited), displays that file’s buffer, and jumps to the bookmarked
location (adjusting it by searching for context if necessary).

Jamie expects that a bookmark targets the file in its entirety.
Activating the bookmark then should visit the file (if not already
visited) and display the file’s buffer. If the file had to be
re-visited, save-place kicks in and restores the point and scroll
position to the values saved when the file’s buffer was killed. If
save-place is not active, the point and scroll position should remain
whatever they end up by default (top of buffer?).

I dare say both expectations are valid for files. Therefore, the fix
should allow the user to avoid saving a location in bookmarks
targeting files, perhaps by introducing a setting like
‘bookmark-set-save-location’, boolean, default t. Other bookmark types
would then decide if it makes sense to honor that setting, and how.
E.g. an Info buffer technically contains a whole Info manual but,
through narrowing, makes an appearance of displaying only a single
Info page; it would make sense to bookmark the page but not the exact
line and context.



  parent reply	other threads:[~2020-06-21  9:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20 19:27 [PATCH] Add user option to disable location in bookmarks Jamie Beardslee
2020-06-20 21:35 ` Drew Adams
2020-06-20 22:24   ` Jamie Beardslee
2020-06-20 22:50     ` Stefan Monnier
2020-06-20 23:37       ` Drew Adams
2020-06-20 23:34     ` Drew Adams
2020-06-21  0:22       ` Jamie Beardslee
2020-06-21  5:19         ` Drew Adams
2020-06-21  9:56         ` Basil L. Contovounesios
2020-06-21  9:13       ` Yuri Khan [this message]
2020-06-21 18:44         ` Drew Adams

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=CAP_d_8VdTROspAYgUZmTNgRMa75k3YKuj2tML81uds4znZJF3Q@mail.gmail.com \
    --to=yuri.v.khan@gmail.com \
    --cc=beardsleejamie@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /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).