From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Bookmark the end of file? Date: Mon, 6 Apr 2015 16:59:13 -0700 (PDT) Message-ID: <9aacf44d-27ae-4b40-b27a-ae81f5a92216@default> References: <87vbh8hlns.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1428364790 11281 80.91.229.3 (6 Apr 2015 23:59:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Apr 2015 23:59:50 +0000 (UTC) To: Marcin Borkowski , Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 07 01:59:38 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YfGvZ-0004K9-HO for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Apr 2015 01:59:37 +0200 Original-Received: from localhost ([::1]:42265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfGvY-0005dB-Pz for geh-help-gnu-emacs@m.gmane.org; Mon, 06 Apr 2015 19:59:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfGvN-0005cu-7Y for help-gnu-emacs@gnu.org; Mon, 06 Apr 2015 19:59:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfGvJ-0002t4-St for help-gnu-emacs@gnu.org; Mon, 06 Apr 2015 19:59:25 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:34914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfGvJ-0002nr-MB for help-gnu-emacs@gnu.org; Mon, 06 Apr 2015 19:59:21 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t36NxF1I031677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Apr 2015 23:59:17 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t36NxEX6003463 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 6 Apr 2015 23:59:14 GMT Original-Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t36NxE1V022816; Mon, 6 Apr 2015 23:59:14 GMT In-Reply-To: <87vbh8hlns.fsf@wmi.amu.edu.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103550 Archived-At: > 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?) >=20 > 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.