unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>, help-gnu-emacs@gnu.org
Subject: RE: Bookmark the end of file?
Date: Tue, 7 Apr 2015 15:27:01 -0700 (PDT)	[thread overview]
Message-ID: <d4846444-4b83-4d15-813d-29fbaac6ba0e@default> (raw)
In-Reply-To: <jwv4morzlpk.fsf-monnier+gmane.emacs.help@gnu.org>

> I think it'd be OK to refine the current code such that a bookmark
> that's at a position equal to point-max would be marked as "go the EOB"
> instead of "go to the position that happened to be EOB back when we
> created the bookmark".

Unless that's not what the user wants. ;-)

The usual behavior of a bookmark is to take you to a recorded
position, which is understood not to be absolute but relative to the
surrounding context (i.e., located by that context).

A buffer (file) position is what is bookmarked.  But the intention
is for the bookmark to be automatically repositioned to stay, if
possible, surrounded by the same text context.  The recorded position
is used only as a starting point.  The actual jump position is
adjusted to try to place it in the same context.

So is "relative to the surrounding context" to be understood in this
particular case as just after the text that precedes the bookmarked
place?  Or is it to be understood as just before the (nonexistent)
text that follows it, i.e., at eob?

Do you assume that most users want to track eob in such a case?
Or do you assume that they want to track the text that preceded the
bookmarked position?

Consider also this comment for the code that automatically relocates
a bookmark when you jump to it, to keep it within/near its originally
recorded context:

;; Go searching forward first.  Then, if forward-str exists and
;; was found in the file, we can search backward for behind-str.
;; Rationale is that if text was inserted between the two in the
;; file, it's better to be put before it so you can read it,
;; rather than after and remain perhaps unaware of the changes.

In the special case we are considering now, you seem to assume that
it is better for the cursor to be put *after* any text inserted
since bookmarking, not that "it's better to be put before it so you
can read it".

I'd say there are different use cases to consider.

One approach is to offer users some ways to obtain one or the other
behavior after the (ordinary) bookmark has been created.  (Bookmark+
does that.)

Another approach could be to let users choose the behavior when a
bookmark is created at eob, and save that behavior choice in the
bookmark.  Of course then the bookmark is essentially of a different
type (different recorded info), and if a user wants to later switch
it to the other behavior then sh?e will need to jump through some hoops.



  reply	other threads:[~2015-04-07 22:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06 23:39 Bookmark the end of file? Marcin Borkowski
2015-04-06 23:59 ` Drew Adams
2015-04-07  1:03   ` Marcin Borkowski
2015-04-07  0:00 ` Dale Snell
2015-04-07  1:10   ` Marcin Borkowski
2015-04-07 13:36     ` J. David Boyd
2015-04-07 19:11       ` Marcin Borkowski
2015-04-07 16:49     ` Dale Snell
2015-04-07 19:19       ` Marcin Borkowski
2015-04-07 21:14 ` Stefan Monnier
2015-04-07 22:27   ` Drew Adams [this message]
2015-04-12 20:22     ` Stefan Monnier
2015-04-12 20:42       ` Drew Adams
2015-04-12 21:05         ` Stefan Monnier
2015-04-12 21:34           ` Drew Adams
2015-04-13  2:23             ` Stefan Monnier
     [not found]           ` <mailman.528.1428874505.904.help-gnu-emacs@gnu.org>
2015-04-13  3:28             ` Do we want more choice? (was Bookmark the end of file?) Rusi
2015-04-13  5:35               ` Drew Adams
2015-04-13  7:17                 ` tomas
2015-04-13  7:53                   ` Marcin Borkowski
2015-04-13  8:12                     ` tomas
2015-04-13 14:52                   ` Eli Zaretskii
2015-04-13 19:23                     ` tomas
2015-04-14  7:38                     ` Gian Uberto Lauri
2015-04-14 14:23                       ` Eli Zaretskii
2015-04-14 14:42                         ` Gian Uberto Lauri
2015-04-14 15:30                           ` Eli Zaretskii
2015-04-14 15:37                             ` Gian Uberto Lauri
2015-04-13 17:20                   ` Stefan Monnier
2015-04-13 19:26                     ` tomas
2015-04-13  7:36                 ` Marcin Borkowski

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=d4846444-4b83-4d15-813d-29fbaac6ba0e@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --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.
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).