From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: [PATCH] Add user option to disable location in bookmarks Date: Sat, 20 Jun 2020 23:34:05 +0000 (UTC) Message-ID: <062414c6-41f4-4803-9a62-28274825b8e0@default> References: <87sgep35cb.fsf@gmail.com> <87blld2x5h.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="63807"; mail-complaints-to="usenet@ciao.gmane.io" To: Jamie Beardslee , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 21 01:34:45 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmn0X-000GUs-6s for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Jun 2020 01:34:45 +0200 Original-Received: from localhost ([::1]:59244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmn0W-00084Z-96 for ged-emacs-devel@m.gmane-mx.org; Sat, 20 Jun 2020 19:34:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmn01-0007eG-Jf for emacs-devel@gnu.org; Sat, 20 Jun 2020 19:34:13 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:54884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmmzz-0005wU-JX for emacs-devel@gnu.org; Sat, 20 Jun 2020 19:34:13 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05KNViAI020311; Sat, 20 Jun 2020 23:34:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=XeM+0IN62mghu5OwhAPJxXOyF4EoGqEH08Mzt8I4zlc=; b=E+RNh4vV99nV0VScowRw8J24bwcprnXm2uL4X1r6dmShBx1lx4JgXl64d/gAyvTiLzDS 393TcMaxUhn+Lb+WU1LxET+Jd4CI88c4XSA4GTFq1ACZFHehBDXdm6WlrATNZCOUiGa5 CohZGIaq03bOWXuAQNVF6jrcw9AIVSTJKO3NwekzCauV8Srtv/AfzOjpopifRvRij6// VsZ1YTXhJplH+YLcKIoawcyoahqlgFH3bf5x9wVaphbnSYHgYvKDH9qs2T+PWWbe3HkD 8ozSIzDheSh5W/eBviy3qB45cv6HUfWjzsmENjtezFkUdaO8Q0addb0l0BiJ3pVYymlK TQ== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 31sebb1r8q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 20 Jun 2020 23:34:08 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05KNXIjZ010174; Sat, 20 Jun 2020 23:34:07 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 31seb7e95h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 20 Jun 2020 23:34:07 +0000 Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 05KNY6MQ031422; Sat, 20 Jun 2020 23:34:06 GMT In-Reply-To: <87blld2x5h.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5017.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9658 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006200178 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9658 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 cotscore=-2147483648 lowpriorityscore=0 phishscore=0 bulkscore=0 clxscore=1015 impostorscore=0 malwarescore=0 priorityscore=1501 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006200178 Received-SPF: pass client-ip=141.146.126.78; envelope-from=drew.adams@oracle.com; helo=aserp2120.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/20 18:57:45 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -63 X-Spam_score: -6.4 X-Spam_bar: ------ X-Spam_report: (-6.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252474 Archived-At: > > You don't specify what the actual problem is. How does a bookmark > > interfere with save-place? Maybe provide a step-by-step recipe to > > show the problem, starting from `emacs -Q' (no init file). >=20 > =E2=80=98bookmark-set=E2=80=99 saves the position--by which I mean point = and context > strings--with no option (that I can find) of not saving it. When using > =E2=80=98bookmark-jump=E2=80=99, point will always be moved to that posit= ion, ignoring > the position from save-place. That's not a recipe. A bookmark can do anything. It can even make use of save-place or any save-place info. You can create whatever kind of bookmark you need, if you need something special. See `bookmark-make-record-function', and see how it's used in the Elisp sources to create different kinds of bookmarks. `bookmark-set' uses `bookmark-make-record', which calls the function value of `bookmark-make-record-function'. It's only the default value of variable `bookmark-make-record-function' that does what you say. If the default `bookmark-make-record-function' doesn't do what's needed for save-place, then maybe save-place should define its own type of bookmark. Or probably all it needs to do is `add-hook' for `bookmark-after-jump-hook', just as it does for `find-file-hook', `dired-initial-position-hook', and `kill-emacs-hook'. IOW, after jumping to the position that you bookmarked, move to the save-place position. It's you who bookmarked a given position. And likely you do sometimes want to return to that position. But if there's a more recent position in that file, which save-place has saved for you, then just use that one, via `bookmark-after-jump-hook'. (And again, a bookmark need not have a location. If you use the default make-record function then yes, the bookmark saves a position.) > > Just what behavior are you looking for? Do you not want to open the > > file at all? (If so, what do you want the bookmark to do with the > > file, instead of opening it?) > > > > If you want the bookmark to open the file, where do you want the > > cursor to be in it - at what position? >=20 > My patch allows the user to choose whether or not the bookmark record > should be in control of the position. The bookmark record has already chosen that. Just use a different kind of record. Why have an option that acts in a blanket manner on all bookmarks, to ignore their position? 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. > > A bookmark can target a file in any way you want, including (but not > > limited to) opening it at a given position. You can easily bookmark a > > file so that the bookmark opens it with the cursor at position 1, for > > example. (And you need not visit a file in order to bookmark it.) > > > > Finally, a bookmark need not have any `location' field. >=20 > I understand this. I think it would be useful to have a simple > accessible way to effectively disable the point manipulation part of > bookmarks. It=E2=80=99s not exactly convenient to edit the bookmark file= by > hand every time a bookmark is created just to disable this feature. No one suggested that you edit a bookmark file. Your cure isn't localized to the ill. If this is a good option to give users, to let save-place override bookmark locations, just like it does for Dired and `find-file', then that option belongs to save-place.