unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Marcin Borkowski <mbork@wmi.amu.edu.pl>,
	Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: RE: Bookmark the end of file?
Date: Mon, 6 Apr 2015 16:59:13 -0700 (PDT)	[thread overview]
Message-ID: <9aacf44d-27ae-4b40-b27a-ae81f5a92216@default> (raw)
In-Reply-To: <87vbh8hlns.fsf@wmi.amu.edu.pl>

> how to set a bookmark to the end of some file (IOW, (point-max))?  (Of
> course it is possible with Bookmark+, but is there any UI for that
> there?  Is it at all possible with vanilla bookmarks?)
> 
> My use case is a file which I visit (almost) every day to /add/
> something to its end (e.g., a ledger file).  I can imagine other,
> similar uses for that, too.

1. You can use `bookmark-after-jump-hook' with both vanilla
`bookmark.el' and Bookmark+.  Add a function that goes to
`point-max', for instance.

If you don't want to do that for all bookmarks (which I
imagine), you can define a command that binds that hook and
then jumps to a particular bookmark or lets you choose a
bookmark from some particular set of bookmarks.  IOW, create
your own `jump-then-goto-eof' command.

2. Both vanilla bookmarks and Bookmark+ bookmarks save text
before and after point, and then use that text to try to
reposition the location later.  Usually that enables relocation
correctly.

But if the location is at eof/eob and you append new text to
the file then this relocation might fail.

With Bookmark+, you can bookmark the file and then combine
that bookmark with a function bookmark that goes to `point-max'.
That is, create a sequence bookmark of: (1) the bookmark to the
file followed by (2) a function bookmark that goes to eof.

3. With Bookmark+, you can tag a bookmark with tag "bmkp-jump".
The function that is the value of a "bmkp-jump" tag is called
just after standard hook `bookmark-after-jump-hook' is invoked.

Note that this is a case where the tag is not just a string -
it is a cons with car "bmkp-jump" and with cdr the extra jump
function.  IOW, you can use tag "bmkp-jump" to invoke functions
that are specific to individual bookmarks.  In this way,
bookmarks can have their own, extra jump behavior.



  reply	other threads:[~2015-04-06 23:59 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 [this message]
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
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=9aacf44d-27ae-4b40-b27a-ae81f5a92216@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=mbork@wmi.amu.edu.pl \
    /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).