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: Tue, 7 Apr 2015 15:27:01 -0700 (PDT) Message-ID: 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 1428445652 27202 80.91.229.3 (7 Apr 2015 22:27:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Apr 2015 22:27:32 +0000 (UTC) To: Stefan Monnier , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 08 00:27:20 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 1Yfbxo-0008IT-1t for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Apr 2015 00:27:20 +0200 Original-Received: from localhost ([::1]:49106 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfbxn-0004Ll-3i for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Apr 2015 18:27:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfbxd-0004Lb-83 for help-gnu-emacs@gnu.org; Tue, 07 Apr 2015 18:27:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfbxZ-0000a1-3M for help-gnu-emacs@gnu.org; Tue, 07 Apr 2015 18:27:09 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:28473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfbxY-0000Zv-SY for help-gnu-emacs@gnu.org; Tue, 07 Apr 2015 18:27:05 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t37MR3ZG028846 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Apr 2015 22:27:03 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t37MR2GR008426 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 7 Apr 2015 22:27:03 GMT Original-Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t37MR27t024094; Tue, 7 Apr 2015 22:27:02 GMT In-Reply-To: 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: 156.151.31.81 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:103565 Archived-At: > 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.