GNU bug report logs - #20845
25.0.50; bookmark.el, handling of fictitious `buffer' property

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Drew Adams <drew.adams@HIDDEN>; dated Thu, 18 Jun 2015 15:27:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 20845 <at> debbugs.gnu.org:


Received: (at 20845) by debbugs.gnu.org; 5 Jul 2019 21:35:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 17:35:14 2019
Received: from localhost ([127.0.0.1]:53890 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hjVrN-0001qx-VM
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2019 17:35:14 -0400
Received: from aserp2120.oracle.com ([141.146.126.78]:41740)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1hjVrM-0001qg-TQ
 for 20845 <at> debbugs.gnu.org; Fri, 05 Jul 2019 17:35:13 -0400
Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1])
 by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x65LYEE6044495;
 Fri, 5 Jul 2019 21:35:07 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : cc : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02;
 bh=kqkMtQcAO9TJP1/QoiNYUlsJIQ/dcNrmKvhn0UKK/ws=;
 b=gbzKR7TWJeE5sxcZbZOo7B42jRvhIExLMKaMmnabFXgBXIvvdPLq5rE12mZWZPqyLvHa
 ZnLP9kvrGV8Dpzx6ADtfGDirvaoIUjb7I5lP7LDUg7AjT4PdeITTYbqEetz6Rf6VxRjM
 8NVUct2wwa1not9fx2C4Dfz2R5JXm5xs5nnPAE72guQZGRK1nkxp461S62SRs2uKHWb6
 qBU9RjQYmAxJVfgj7rjLyiesSw5VsbU5/u2g15O/CpM1V1x4UmS8NBLkgwB/nz/COqNV
 TTRd/hX+JwBhtaMgYJpNoqnzi1zQ5QykNnigPkybvS+qp0kSjj0o7WPytmmRzsmUHtXn XQ== 
Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71])
 by aserp2120.oracle.com with ESMTP id 2te5tc4kwf-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 05 Jul 2019 21:35:07 +0000
Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1])
 by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x65LX26s030543;
 Fri, 5 Jul 2019 21:35:07 GMT
Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75])
 by aserp3030.oracle.com with ESMTP id 2th5qmxek2-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 05 Jul 2019 21:35:06 +0000
Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14])
 by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x65LZ5RP024961;
 Fri, 5 Jul 2019 21:35:05 GMT
MIME-Version: 1.0
Message-ID: <405d0ee9-4de7-473c-9308-fd83930259ad@default>
Date: Fri, 5 Jul 2019 14:35:04 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
Subject: RE: bug#20845: 25.0.50; bookmark.el, handling of fictitious `buffer'
 property
References: <CADwFkmnGJuGZY9Zhi8jQE_AY47fGYZCH1a-EgrJ4p-bHdGQ9tg@HIDDEN>
 <jwv5zogehvh.fsf-monnier+emacs@HIDDEN>
 <CADwFkmnBSAAFWwm64L+TphPLkwWFDN-6B5zJv-kjLWOnR==6Gw@HIDDEN>
 <bc9398b8-6eb0-4edb-8e2f-0062386ef0ad@default> <855zogdxml.fsf@HIDDEN>
In-Reply-To: <855zogdxml.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4861.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9309
 signatures=668688
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=818
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1810050000 definitions=main-1907050273
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9309
 signatures=668688
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 priorityscore=1501 malwarescore=0
 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015
 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=870 adultscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000
 definitions=main-1907050273
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 20845
Cc: 20845 <at> debbugs.gnu.org, Stefan Kangas <stefan@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> > It should be sufficient to communicate the buffer
> > _name_ as the property value.  And that's something
> > savable and retrievable - it's useful generally.
> >
> > IOW, it's OK to have `buffer' bookmark property,
> > but I think its value should be a buffer name.
>=20
> Would that potentially be a problem if the buffer is renamed?

Yes. But it's not much different from the problem
that arises if a file name is changed.

And no different from the case where a buffer
(not a buffer name) no longer exists (which can
happen even if a buffer object is used in a live,
not persisted, `bookmark-alist').

We can try to jump through hoops for this.  It's
a choice how many hoops we want to jump through.

We could `condition-case'-handle the case where
`bookmark-default-handler' is used, and try to
deal with errors such as those.  We already do
that for condition `bookmark-error-no-filename'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20845; Package emacs. Full text available.

Message received at 20845 <at> debbugs.gnu.org:


Received: (at 20845) by debbugs.gnu.org; 5 Jul 2019 21:33:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 17:33:15 2019
Received: from localhost ([127.0.0.1]:53876 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hjVpT-0001ml-AV
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2019 17:33:15 -0400
Received: from aserp2120.oracle.com ([141.146.126.78]:40510)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1hjVpR-0001mZ-Mu
 for 20845 <at> debbugs.gnu.org; Fri, 05 Jul 2019 17:33:14 -0400
Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1])
 by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x65LTVWE041453;
 Fri, 5 Jul 2019 21:33:07 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : cc : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02;
 bh=iuezgI3snzoibiUwmgrsnlPVbCKTIoJ7FFKatXmBGKM=;
 b=dM+2qjJt8e+UKgl0gL8kFUxRS+mzMhBvZYUYvDo59a4fisLoRk0CgxKETJsO9Gz4AlYS
 SSetdsT/LE7pGCH0LjX4SRrB0LpdCTChkMC34XK999FYOrhkDoPAmdfsGocqgDDmHkSX
 I82IHfZ3MPB8nBPPztvGWCEGWwUhfa2cX1tg8ryYRUcNOmWgiadtCAdx94UYzkeCoSwW
 JzjexeTYDk0rvsPMFYJXoIIddJRCDCVytEKwCFs0vGR9yBVarFlEDhk0X3qVmhteZgx/
 yrNQhj7Wi2Q3UP+Z4VAvRZWL61MtkiyWFLVDVj0/B9acCzfMBEuBoGZqC6l4e5lX5+KB gw== 
Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79])
 by aserp2120.oracle.com with ESMTP id 2te5tc4ksu-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 05 Jul 2019 21:33:07 +0000
Received: from pps.filterd (userp3020.oracle.com [127.0.0.1])
 by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x65LWxKp158579;
 Fri, 5 Jul 2019 21:33:06 GMT
Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75])
 by userp3020.oracle.com with ESMTP id 2thxrvmbbc-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 05 Jul 2019 21:33:06 +0000
Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14])
 by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x65LX3Er024272;
 Fri, 5 Jul 2019 21:33:05 GMT
MIME-Version: 1.0
Message-ID: <c9777eb7-dbe0-438a-9bd0-dbf73ead8584@default>
Date: Fri, 5 Jul 2019 14:33:03 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: RE: bug#20845: 25.0.50; bookmark.el, handling of fictitious `buffer'
 property
References: <CADwFkmnGJuGZY9Zhi8jQE_AY47fGYZCH1a-EgrJ4p-bHdGQ9tg@HIDDEN>
 <jwv5zogehvh.fsf-monnier+emacs@HIDDEN>
 <CADwFkmnBSAAFWwm64L+TphPLkwWFDN-6B5zJv-kjLWOnR==6Gw@HIDDEN>
 <bc9398b8-6eb0-4edb-8e2f-0062386ef0ad@default>
 <jwvy31cgqci.fsf-monnier+emacs@HIDDEN>
In-Reply-To: <jwvy31cgqci.fsf-monnier+emacs@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4861.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9309
 signatures=668688
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1810050000 definitions=main-1907050273
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9309
 signatures=668688
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 priorityscore=1501 malwarescore=0
 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015
 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000
 definitions=main-1907050272
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 20845
Cc: 20845 <at> debbugs.gnu.org, Stefan Kangas <stefan@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> > I agree, provided the doc of `bookmark-default-handler'
> > makes clear (1) that the value is assumed to be a
> > buffer, not a buffer name,
>=20
> The current code accepts both and that seems quite reasonable to me
> (even though I dislike this same fact in many other places).

Yes, right.

> > and (2) that this is not a "normal" bookmark property, that is, one
> > whose value can be saved.
>=20
> There's no readable printed representation of a buffer object, so that
> goes without saying.

I don't think it goes without saying, here.
I don't know why we wouldn't want to mention this.

I know of no other possibility of a bookmark that
does not have a print/read representation, and so
can't be persisted.  Persisting bookmarks is a
pretty fundamental part of Emacs bookmarking.

(Even the temporary bookmarks you can create with
Bookmark+ have a print/read representation, so
you can save them if you want.)

Of course, just because I don't know of other
such unsavable bookmarks doesn't mean they aren't
created by some library somewhere.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20845; Package emacs. Full text available.

Message received at 20845 <at> debbugs.gnu.org:


Received: (at 20845) by debbugs.gnu.org; 5 Jul 2019 20:51:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 16:51:16 2019
Received: from localhost ([127.0.0.1]:53860 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hjVAq-0000c0-6I
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2019 16:51:16 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63512)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1hjVAo-0000bj-ND
 for 20845 <at> debbugs.gnu.org; Fri, 05 Jul 2019 16:51:15 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7DB321009BB;
 Fri,  5 Jul 2019 16:51:06 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 43F891004B3;
 Fri,  5 Jul 2019 16:51:05 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1562359865;
 bh=1OL+bjPQcBHYF62EInPgbBayimmrWwtOxdML+OL/Ohw=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=hwmAwGe0up4jxOu5R2+7kpJltrZnJCg1RfatDSq2g3eXbEwAi13kDCVR8chepdnvu
 UDuU6tXC70Pjxm9AHWW2aC8t43/SrQrXZ9qHbvwEh3B2uaLAfS5dWzOBi4e+IkkyJW
 Qe1TiavVa5xfvRlhUbMI5kqG12pl9dMxg08wIBVr47ZoW5bHJIgKDiD9PEA22S6C9m
 /AWd60klC3WWWOZ29uWQ/XopwyzPhxEtC00274S4aFGldATUdVhUb6uwcgdEdB6CVi
 ZVnCIwS86i2nO8VlQsSVH5XPDG5PqOaey6yF+UgGOiBACEzk5vIBN4DtqOdqhIlL2T
 gli9IUKOksEZw==
Received: from alfajor (76-10-138-228.dsl.teksavvy.com [76.10.138.228])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 31D72120497;
 Fri,  5 Jul 2019 16:51:04 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#20845: 25.0.50;
 bookmark.el, handling of fictitious `buffer' property
Message-ID: <jwvy31cgqci.fsf-monnier+emacs@HIDDEN>
References: <CADwFkmnGJuGZY9Zhi8jQE_AY47fGYZCH1a-EgrJ4p-bHdGQ9tg@HIDDEN>
 <jwv5zogehvh.fsf-monnier+emacs@HIDDEN>
 <CADwFkmnBSAAFWwm64L+TphPLkwWFDN-6B5zJv-kjLWOnR==6Gw@HIDDEN>
 <bc9398b8-6eb0-4edb-8e2f-0062386ef0ad@default>
Date: Fri, 05 Jul 2019 16:51:02 -0400
In-Reply-To: <bc9398b8-6eb0-4edb-8e2f-0062386ef0ad@default> (Drew Adams's
 message of "Fri, 5 Jul 2019 10:16:18 -0700 (PDT)")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.140 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20845
Cc: 20845 <at> debbugs.gnu.org, Stefan Kangas <stefan@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> I agree, provided the doc of `bookmark-default-handler'
> makes clear (1) that the value is assumed to be a
> buffer, not a buffer name,

The current code accepts both and that seems quite reasonable to me
(even though I dislike this same fact in many other places).

> and (2) that this is not a "normal" bookmark property, that is, one
> whose value can be saved.

There's no readable printed representation of a buffer object, so that
goes without saying.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20845; Package emacs. Full text available.

Message received at 20845 <at> debbugs.gnu.org:


Received: (at 20845) by debbugs.gnu.org; 5 Jul 2019 20:39:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 16:39:42 2019
Received: from localhost ([127.0.0.1]:53846 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hjUzd-0000HM-QK
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2019 16:39:41 -0400
Received: from mail-io1-f45.google.com ([209.85.166.45]:46039)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1hjUza-0000Gu-1M
 for 20845 <at> debbugs.gnu.org; Fri, 05 Jul 2019 16:39:40 -0400
Received: by mail-io1-f45.google.com with SMTP id g20so535087ioc.12
 for <20845 <at> debbugs.gnu.org>; Fri, 05 Jul 2019 13:39:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=W0L1Ox511eRsTxac4IGoUC087H8MyvLrai+imyd9Rjs=;
 b=KCqb4DIilzlDxuiVhBJfJ7TAzj5FputD1Ppo5s1uUBoJVieYvmnqViaHK+GrkaBtXg
 z4Gn2yQDZfOTP1GZZp4EKO+Wza6OZPujSz6NzKW3h7VadApYRzgUmUZjZfUpcQu9xsn4
 zvQtgHHg5wag6+C4MZCL4V/LSFPbCoKx28QVYS5EguKLVpdeZikOW/t7+6uQ6mLcdcdM
 kLG3oCS1HcP1t91Quxp6j2BsDz/vArhToOR5aY44aPNqUymkZtj2halIwHah3FWqcNrI
 U8fn8pXYZHDqM7iezV+xqteilN58LjrEYLb+YqZ4G7aGVD6N3SjqpxRVR9QJWBWfBNET
 wu4w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=W0L1Ox511eRsTxac4IGoUC087H8MyvLrai+imyd9Rjs=;
 b=SjGjJkZqIOBGcmWEh3rl7k4G6e9KKNQF8VpkaDnz9VgbAnwvy+u+o4o2jmwLeKXBHo
 Xop8NzBnGN0rdCqbIPQ2Cnfq47fVKFHbfEKIgXFHuM3ibx5YbbbZBbsE1jf0cu2kloew
 i3EZxnpR/be43RStHgA3YEjRe/MRD3c4aZqfyYy5lM9pBr5dV0LzZrdUzpIplDIxfehj
 Rd1G9WApmlV56vZ8S0mzAw9nYgpFoKqEarO+q6EswF7tiRYdglMMI2Kcks0tqvDaR2ni
 k+X5CPF/DEp7i1u1W1vRReXT4dQseZ6LOPM4VB/7wkED1tnJo94bKDJ5dGSxU2EHUkr6
 jY2A==
X-Gm-Message-State: APjAAAWq5asfuBGX1JSPCF8iLdSPmgpeHynRnqxzgMIi8qPy12bmU/a+
 4oDCgYVxey2PAAOpNVyD/2L7m1Qd
X-Google-Smtp-Source: APXvYqw9Rv8oeQ5jbmDDxn1i3XHJuWypOUjjw4q1oDoWRzGMC2Ssuo1Bjv8vSpYnGYsx1CS7f/Qlsg==
X-Received: by 2002:a02:8816:: with SMTP id r22mr6870717jai.60.1562359171727; 
 Fri, 05 Jul 2019 13:39:31 -0700 (PDT)
Received: from vhost2
 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196])
 by smtp.gmail.com with ESMTPSA id w23sm16481480ioa.51.2019.07.05.13.39.30
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 05 Jul 2019 13:39:30 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#20845: 25.0.50;
 bookmark.el, handling of fictitious `buffer' property
References: <CADwFkmnGJuGZY9Zhi8jQE_AY47fGYZCH1a-EgrJ4p-bHdGQ9tg@HIDDEN>
 <jwv5zogehvh.fsf-monnier+emacs@HIDDEN>
 <CADwFkmnBSAAFWwm64L+TphPLkwWFDN-6B5zJv-kjLWOnR==6Gw@HIDDEN>
 <bc9398b8-6eb0-4edb-8e2f-0062386ef0ad@default>
Date: Fri, 05 Jul 2019 16:39:30 -0400
In-Reply-To: <bc9398b8-6eb0-4edb-8e2f-0062386ef0ad@default> (Drew Adams's
 message of "Fri, 5 Jul 2019 10:16:18 -0700 (PDT)")
Message-ID: <855zogdxml.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20845
Cc: 20845 <at> debbugs.gnu.org, Stefan Kangas <stefan@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Drew Adams <drew.adams@HIDDEN> writes:

> It should be sufficient to communicate the buffer
> _name_ as the property value.  And that's something
> savable and retrievable - it's useful generally.
>
> IOW, it's OK to have `buffer' bookmark property,
> but I think its value should be a buffer name.

Would that potentially be a problem if the buffer is renamed?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20845; Package emacs. Full text available.

Message received at 20845 <at> debbugs.gnu.org:


Received: (at 20845) by debbugs.gnu.org; 5 Jul 2019 17:16:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 13:16:36 2019
Received: from localhost ([127.0.0.1]:53660 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hjRp5-0000zH-2j
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2019 13:16:36 -0400
Received: from userp2120.oracle.com ([156.151.31.85]:60578)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1hjRp1-0000yw-Pu
 for 20845 <at> debbugs.gnu.org; Fri, 05 Jul 2019 13:16:32 -0400
Received: from pps.filterd (userp2120.oracle.com [127.0.0.1])
 by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x65HEZda173949;
 Fri, 5 Jul 2019 17:16:24 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : cc : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02;
 bh=j6ofeEU1N1iCRSndF1D8EHJ4Yd3GgN51rtfIs/cAQAg=;
 b=3DHsi5K8lyfqKd46hETkVTmjsfRlHKqgaexxJYyCoy5dQbg1dPs5BajRpXgqHVe2W2a2
 hV7v8pzRByiVHiRbmuvPKFv/XwPBuKuhp8eHAkL/iF8BG1IyWrBba7X0iBC74G7ZbqnL
 jx8CJpP7v7nCi99gPPvYjfM9f2NVCS43ToRxa7ouv1cZSEhrBiOf8ao12bZI1Ct2kC1g
 DOl3l+0htVyg3uaFyZIgZRil7knAwanC/hP/LjyTQ9Yv9p9ImmnOo842UWJwHdVYTWnw
 7E+z2izPz6QbPc6uqixw9uDUDLF02Nx7zquc7bBqBcO0/dC6BhdkrqP+R5xno8KPcspC VA== 
Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70])
 by userp2120.oracle.com with ESMTP id 2te61qbxg9-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 05 Jul 2019 17:16:24 +0000
Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1])
 by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x65HCebr099506;
 Fri, 5 Jul 2019 17:16:24 GMT
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
 by aserp3020.oracle.com with ESMTP id 2th9echnjd-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 05 Jul 2019 17:16:23 +0000
Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18])
 by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x65HGJds009436;
 Fri, 5 Jul 2019 17:16:21 GMT
MIME-Version: 1.0
Message-ID: <bc9398b8-6eb0-4edb-8e2f-0062386ef0ad@default>
Date: Fri, 5 Jul 2019 10:16:18 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>, Stefan Monnier
 <monnier@HIDDEN>
Subject: RE: bug#20845: 25.0.50; bookmark.el, handling of fictitious `buffer'
 property
References: <CADwFkmnGJuGZY9Zhi8jQE_AY47fGYZCH1a-EgrJ4p-bHdGQ9tg@HIDDEN>
 <jwv5zogehvh.fsf-monnier+emacs@HIDDEN>
 <CADwFkmnBSAAFWwm64L+TphPLkwWFDN-6B5zJv-kjLWOnR==6Gw@HIDDEN>
In-Reply-To: <CADwFkmnBSAAFWwm64L+TphPLkwWFDN-6B5zJv-kjLWOnR==6Gw@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4861.0 (x86)]
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9309
 signatures=668688
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1810050000 definitions=main-1907050212
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9309
 signatures=668688
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 priorityscore=1501 malwarescore=0
 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011
 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000
 definitions=main-1907050213
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 20845
Cc: 20845 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> > > I'm looking into Emacs Bug#20845 which asks about the purpose of the
> > > "bookmark" property in bookmark.el.
> >
> > I don't see any `bookmark` property, sorry.
>=20
> That should be "buffer", sorry about that.

That typo at the beginning of the report was my fault.
I meant `buffer' property, not `bookmark' property.

> > Oh, I see how/where it's used and it's definitely still used:
> > Info-bookmark-jump uses it (i.e. not in the stored bookmark object, but
> > in a transient object passed to bookmark-default-handler).

Yes, thanks for pointing that out.

> > So maybe it should be documented in the docstring of
> > `bookmark-default-handler` for the benefit of other handlers.
>=20
> I agree with this conclusion.  So not only do we keep it, but we document
> it.
>=20
> Thanks for helping out Stefan, it seems we now have a way forward.

I agree, provided the doc of `bookmark-default-handler'
makes clear (1) that the value is assumed to be a
buffer, not a buffer name, and (2) that this is not a
"normal" bookmark property, that is, one whose value
can be saved.

It's OK for a jump function to pass a buffer object as
the property value to the default handler.  But it's
generally not OK for code to try to store a buffer
value for property `buffer'.  Such a bookmark works OK
in a live `bookmark-alist', but it isn't persistable.

That the default handler recognizes this property,
which cannot be persisted, is a bit aberrant.

It's normal for mode-setting, narrowing, etc. to be
coded in a jump function.  What's not so normal is
to communicate the buffer to the default bookmark
handler as a bookmark property.

It should be sufficient to communicate the buffer
_name_ as the property value.  And that's something
savable and retrievable - it's useful generally.

IOW, it's OK to have `buffer' bookmark property,
but I think its value should be a buffer name.

Something like this might be better than what we
have now (tested only mildly, using vanilla Emacs
26.2):

(defun Info-bookmark-make-record ()
  ""
  (let* ((file (and (stringp Info-current-file)
                    (file-name-sans-extension
                     (file-name-nondirectory Info-current-file))))
         (bookmark-name (if file
                            (concat "(" file ") " Info-current-node)
                          Info-current-node))
         (defaults (delq nil (list bookmark-name file Info-current-node))))
    `(,bookmark-name
      ,@(bookmark-make-record-default 'no-file)
      (filename . ,Info-current-file)
      (info-node . ,Info-current-node)
      (buffer . ,(buffer-name))         ; <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
      (handler . Info-bookmark-jump)
      (defaults . ,defaults))))

(defun Info-bookmark-jump (bmk)
  ""
  (let* ((file  (bookmark-prop-get bmk 'filename))
         (node  (bookmark-prop-get bmk 'info-node)))
    (Info-find-node file node)
    ;; Use `bookmark-default-handler' to move to location in node.
    (bookmark-default-handler
     (cons "" (bookmark-get-bookmark-record bmk))))) <=3D=3D=3D=3D=3D no BU=
F

(defun bookmark-default-handler (bmk-record)
  ""
  (let ((file          (bookmark-get-filename bmk-record))
        ;; Get buffer from recorded buffer name. <=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
        (buf           (get-buffer (bookmark-prop-get bmk-record 'buffer)))
        (forward-str   (bookmark-get-front-context-string bmk-record))
        (behind-str    (bookmark-get-rear-context-string bmk-record))
        (place         (bookmark-get-position bmk-record)))
    (set-buffer
     (cond
      ((and file (file-readable-p file) (not (buffer-live-p buf)))
       (find-file-noselect file))
      (buf)
      (t (signal 'bookmark-error-no-filename (list 'stringp file)))))
    (if place (goto-char place))
    (when (and forward-str (search-forward forward-str (point-max) t))
      (goto-char (match-beginning 0)))
    (when (and behind-str (search-backward behind-str (point-min) t))
      (goto-char (match-end 0)))
    nil))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20845; Package emacs. Full text available.

Message received at 20845 <at> debbugs.gnu.org:


Received: (at 20845) by debbugs.gnu.org; 5 Jul 2019 14:04:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 10:04:56 2019
Received: from localhost ([127.0.0.1]:53590 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hjOpc-0002P4-4r
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2019 10:04:56 -0400
Received: from mail-wr1-f43.google.com ([209.85.221.43]:33562)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1hjOpa-0002Oo-Nc
 for 20845 <at> debbugs.gnu.org; Fri, 05 Jul 2019 10:04:55 -0400
Received: by mail-wr1-f43.google.com with SMTP id n9so10102348wru.0
 for <20845 <at> debbugs.gnu.org>; Fri, 05 Jul 2019 07:04:54 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=izLBqWQTxEEeRA6+nhLHmgD7PsuXOLCjX9e6bLdffxQ=;
 b=h0FvyDuGspmIGprUvJ0BEVlTPhYR+YjF8AQGKYsb6f15TY5VAj7lZE9a1mOGhbtzSf
 hqlj8dnN0CBANkB7X8uGnscRK3RLSHWYOVrA9dFZv8Pzf2wqANl4Aqz30FJ6uU48kNmu
 lgcP8i8Tp2lXL8hKap2Pu90YR5D8s3L64lzuQJ9evAR7AOdMjQLWY2IKgLd3HwFx2ECe
 2Xz175eTcO8uy1qvTPjTH9/Vf97vx7pLUoaAKgfK5Ev3s3Krfj6H9xUFUjsXFBHzG5kP
 OmKQn2gnXwppYnNMzyLNt0msXmAbIxBCrprkri7w0EA4Rs61R/QJjU0pJQ7XEV6PDrmE
 on8w==
X-Gm-Message-State: APjAAAW/6ywtv9JKrg93cmDcF7LXMi5hSkoJmpAJHBcZmhmGjdcvyGg3
 axCM1ySi9f+WYC1uiSkP+n+bWnWGYALKpbGfRTY=
X-Google-Smtp-Source: APXvYqybAU6rd2SXaDl2nGKfCg4fOQA0cIhdpBwp9etDmhrIt8EiErGsxIX62R4ZCQRn2lWvh5n2U9zw9AUSm+6WEYI=
X-Received: by 2002:a05:6000:14b:: with SMTP id
 r11mr4361122wrx.196.1562335488049; 
 Fri, 05 Jul 2019 07:04:48 -0700 (PDT)
MIME-Version: 1.0
References: <CADwFkmnGJuGZY9Zhi8jQE_AY47fGYZCH1a-EgrJ4p-bHdGQ9tg@HIDDEN>
 <jwv5zogehvh.fsf-monnier+emacs@HIDDEN>
In-Reply-To: <jwv5zogehvh.fsf-monnier+emacs@HIDDEN>
From: Stefan Kangas <stefan@HIDDEN>
Date: Fri, 5 Jul 2019 16:04:36 +0200
Message-ID: <CADwFkmnBSAAFWwm64L+TphPLkwWFDN-6B5zJv-kjLWOnR==6Gw@HIDDEN>
Subject: Re: bug#20845: 25.0.50;
 bookmark.el, handling of fictitious `buffer' property
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20845
Cc: 20845 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Stefan Monnier <monnier@HIDDEN> writes:
> > I'm looking into Emacs Bug#20845 which asks about the purpose of the
> > "bookmark" property in bookmark.el.
>
> I don't see any `bookmark` property, sorry.

That should be "buffer", sorry about that.

> > The suggestion given by Drew above is to remove it.
> > Do you have an opinion about that?
>
> Not really, no.  But such "old-style" bookmarks might still be used by
> third-party packages and might still appear in users's
> ~/.emacs.d/bookmarks, so if we want to remove support for it, maybe we
> should try and do it gradually.
>
> [...taking a second look...]
>
> Oh, I see how/where it's used and it's definitely still used:
> Info-bookmark-jump uses it (i.e. not in the stored bookmark object, but
> in a transient object passed to bookmark-default-handler).
> So maybe it should be documented in the docstring of
> `bookmark-default-handler` for the benefit of other handlers.

I agree with this conclusion.  So not only do we keep it, but we document it.

Thanks for helping out Stefan, it seems we now have a way forward.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20845; Package emacs. Full text available.

Message received at 20845 <at> debbugs.gnu.org:


Received: (at 20845) by debbugs.gnu.org; 5 Jul 2019 13:46:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 09:46:50 2019
Received: from localhost ([127.0.0.1]:52551 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hjOY6-0001hB-6O
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2019 09:46:50 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58680)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1hjOY3-0001gn-5v
 for 20845 <at> debbugs.gnu.org; Fri, 05 Jul 2019 09:46:48 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 817A6100870;
 Fri,  5 Jul 2019 09:46:40 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DF2D31004B3;
 Fri,  5 Jul 2019 09:46:37 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1562334397;
 bh=0N1YSKpU2EWSMoDmwGxoYR6Gf68Wf545sN6leECjYbo=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=hVjysw1cCcRxL4ZZxOxV+xP+txQ5yW18AW6xbgOUbxHZK9r6WLzYpIyTju7W6mv0l
 MW3b2ZqbTPSOYWEVfGXGViZNIYGSTqBBttD8mjGle4U3b28dMZCvrLCOIsiJAckff6
 2HVu9MVZaHIdxzI+y4Ht6Il9ZRGXzXlpAB6oDhHWieknJ76qA58pWFrnm1A8l3feQI
 /IITzOmCwP4WxXkSOi4uaxegm1rUupuUpPi7haJrT6neFE34SVkN70UQHKyb8PEGTI
 sBcy9E9n6qTepnRv/Nd87CxSoCI66/gbksEIhvS9EjT+o2lViTUSwt0wlynbyEUNaw
 B/HSk8dVu093w==
Received: from pastel (76-10-138-228.dsl.teksavvy.com [76.10.138.228])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8B7E21200CE;
 Fri,  5 Jul 2019 09:46:37 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
Subject: Re: bug#20845: 25.0.50;
 bookmark.el, handling of fictitious `buffer' property
Message-ID: <jwv5zogehvh.fsf-monnier+emacs@HIDDEN>
References: <CADwFkmnGJuGZY9Zhi8jQE_AY47fGYZCH1a-EgrJ4p-bHdGQ9tg@HIDDEN>
Date: Fri, 05 Jul 2019 09:46:31 -0400
In-Reply-To: <CADwFkmnGJuGZY9Zhi8jQE_AY47fGYZCH1a-EgrJ4p-bHdGQ9tg@HIDDEN>
 (Stefan Kangas's message of "Fri, 5 Jul 2019 14:45:19 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.144 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20845
Cc: 20845 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> I'm looking into Emacs Bug#20845 which asks about the purpose of the
> "bookmark" property in bookmark.el.

I don't see any `bookmark` property, sorry.

>> Function `bookmark-default-handler' picks up and handles the property
>> (field) named `bookmark', if present.

Where?

>> I see nowhere else where this property is used, and nowhere where it is
>> set.  And it is not documented.

Sounds like the description of leftover code.  Usually it's either
because of an oversight or for backward compatibility purposes.

>> IOW, there is no notion or existence (AFAICT) of any bookmarks that
>> record a `buffer' property.

Which property are we talking about, `buffer` or `bookmark`?

>> * If the file is readable and is not visited then it visits the file
>>   using `find-file-noselect'.  Why?

I'll assume this question was the result of a temporary confusion on
Drew's part, since I think it's pretty obvious why we'd want to visit
the file here.

>> * Otherwise, if the buffer named by property `buffer' exists then the
>>   default handler does nothing (no-op).

No: it selects that buffer as the current buffer.

> This handling was added in this commit:
>
>     commit dbf8402bc76a775284905f09399b4d88ee0c03e5
>     Author: Stefan Monnier <monnier@HIDDEN>
>     Date:   Wed Feb 10 15:02:54 2010 -0500
>
>         (bookmark-handle-bookmark): Catch the right error.
>         (bookmark-default-handler): Accept new bookmark field `buffer'.

And it had been earlier removed by:

    commit 13901bcbc4926630bdb2127301af0cdf7bcc50f7
    Author: Karl Fogel <kfogel@HIDDEN>
    Date:   Mon Oct 5 01:35:34 2009 +0000

so my commit re-instated support for it.

> But trying to find out why this was committed made me even more
> confused.  I could find Stefan Monnier arguing against this change on
> two different occasions:
>
>     2010-01-25 - https://debbugs.gnu.org/cgi/bugreport.cgi?bug=5476#14
>     2010-01-26 - https://debbugs.gnu.org/cgi/bugreport.cgi?bug=5476#20

Good digging, thanks.

> I understand this was a long time ago, but if you still remember it,
> do you think you could help shed some light into the purpose of this
> code?

I can't remember why I accepted to install it, but these discussions
seem to indicate that the purpose for the patch was to preserve
compatibility with old bookmarks that don't use their own
bookmark handler.

> The suggestion given by Drew above is to remove it.
> Do you have an opinion about that?

Not really, no.  But such "old-style" bookmarks might still be used by
third-party packages and might still appear in users's
~/.emacs.d/bookmarks, so if we want to remove support for it, maybe we
should try and do it gradually.

[...taking a second look...]

Oh, I see how/where it's used and it's definitely still used:
Info-bookmark-jump uses it (i.e. not in the stored bookmark object, but
in a transient object passed to bookmark-default-handler).
So maybe it should be documented in the docstring of
`bookmark-default-handler` for the benefit of other handlers.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20845; Package emacs. Full text available.

Message received at 20845 <at> debbugs.gnu.org:


Received: (at 20845) by debbugs.gnu.org; 5 Jul 2019 12:45:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 08:45:39 2019
Received: from localhost ([127.0.0.1]:52487 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hjNas-00005A-N4
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2019 08:45:39 -0400
Received: from mail-wm1-f51.google.com ([209.85.128.51]:52146)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1hjNaq-0008WV-3K
 for 20845 <at> debbugs.gnu.org; Fri, 05 Jul 2019 08:45:36 -0400
Received: by mail-wm1-f51.google.com with SMTP id 207so8756174wma.1
 for <20845 <at> debbugs.gnu.org>; Fri, 05 Jul 2019 05:45:35 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc;
 bh=g6Lq3d15TrPS0EUjk+99h0mBPWHHE/0JtnC0jjaMPdM=;
 b=AmZkqryL2drjMqANhgzGva+27pdzwn7AklyYzWqtPZyPp4q9W/sJsSfj5eeCFHBT0+
 8CJ4MkK8aM+akz7ityVsn1Pe6M53FuChwVEmwkn8/u1td7UK8+m96qFBpFAWM8yj/1wz
 /w54zu/4NsmaBbpe7gIfCldpU1qYbQ32oJ+JQlMslOomugTgC517KV8YpNis7CXkYpKP
 Re84VSrPXIB+fY3QGyOZHwO/ghlDkMW3n5JLalcO6gQAaKbnp2Ql8nu41VendRAtx9X2
 KcHXSYr7Auy24wMZQt4BOPbrM9+qyS0G+5imQ7HROb+nYMEKwEpuemoS7NWlmTA/sQLg
 oQNQ==
X-Gm-Message-State: APjAAAUZmVLKn18S2wRcqR1rlaSZib7sROkizBqHWHKcFzAqk0o/koez
 ZL/Z9eyqW0CG3XE9RJOA8xexvuiJ39joRmnHdVA=
X-Google-Smtp-Source: APXvYqzbyR+hyHKSAuFsiIFCUxiqe8TFK/tog+a2QUaDnUur9pYOrwR0/5sLqD9UfRZSK0w0QqbhJ7kWammZKE+49cA=
X-Received: by 2002:a7b:c928:: with SMTP id h8mr3566151wml.93.1562330730134;
 Fri, 05 Jul 2019 05:45:30 -0700 (PDT)
MIME-Version: 1.0
From: Stefan Kangas <stefan@HIDDEN>
Date: Fri, 5 Jul 2019 14:45:19 +0200
Message-ID: <CADwFkmnGJuGZY9Zhi8jQE_AY47fGYZCH1a-EgrJ4p-bHdGQ9tg@HIDDEN>
Subject: Re: bug#20845: 25.0.50;
 bookmark.el, handling of fictitious `buffer' property
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20845
Cc: 20845 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Stefan,

I'm looking into Emacs Bug#20845 which asks about the purpose of the
"bookmark" property in bookmark.el.  I'm confused as to what its
purpose is, as is Drew in the bug report quoted below.

Drew Adams <drew.adams@HIDDEN> writes:

> Function `bookmark-default-handler' picks up and handles the property
> (field) named `bookmark', if present.
>
> I see nowhere else where this property is used, and nowhere where it is
> set.  And it is not documented.
>
> IOW, there is no notion or existence (AFAICT) of any bookmarks that
> record a `buffer' property.  And yet, the *default* handler handles
> this unknown property - in two ways:
>
> * If the file is readable and is not visited then it visits the file
>   using `find-file-noselect'.  Why?
>
> * Otherwise, if the buffer named by property `buffer' exists then the
>   default handler does nothing (no-op).  The (non-English) comment here
>   is "See if buffer BUF have been created.", which tells us nothing
>   about why it is handled by doing nothing.
>
> This partial "handling" of the undocumented and never-set property
> `buffer' was apparently introduced in Emacs 23.1.  As it never did
> anything, it was seemingly never noticed.
>
> This property should either be properly documented (in the doc string of
> `bookmark-alist'), as to its use and meaning, or its default "handling"
> should be removed, as misguided.  I'd suggest that the unclear handling
> should just be removed.
>
> If there is some existing code distributed with Emacs that actually uses
> this property (and I can find none) then a bug can be filed for it.
>
> A grep of the Emacs sources for `bookmark-prop-set' shows no occurrences
> of that function outside bookmark.el, and that function is never used to
> set property `bookmark'.  I have also checked all occurrences of
> `bookmark-make-record' in the Emacs Lisp sources, and found none that
> set or use property `bookmark'.
>
> AFAICT, this property does not exist, and its incomplete "handling"
> should be removed.
>
> On the other hand, if this handling was just added to bookmark.el by
> someone only as support for some 3rd-party code, then it doesn't belong
> here anyway - that 3rd-party code can advise `bookmark-default-handler'
> or simply define its own, non-default, handlers.

This handling was added in this commit:

    commit dbf8402bc76a775284905f09399b4d88ee0c03e5
    Author: Stefan Monnier <monnier@HIDDEN>
    Date:   Wed Feb 10 15:02:54 2010 -0500

        (bookmark-handle-bookmark): Catch the right error.
        (bookmark-default-handler): Accept new bookmark field `buffer'.

This was authored by Thierry Volpiatto according to ChangeLog:

    +2010-02-10  Thierry Volpiatto  <thierry.volpiatto@HIDDEN>

But trying to find out why this was committed made me even more
confused.  I could find Stefan Monnier arguing against this change on
two different occasions:

    2010-01-25 - https://debbugs.gnu.org/cgi/bugreport.cgi?bug=5476#14
    2010-01-26 - https://debbugs.gnu.org/cgi/bugreport.cgi?bug=5476#20

Yet this was committed on 2010-02-10.  I was unable to find any
discussion that would explain what had changed.

I understand this was a long time ago, but if you still remember it,
do you think you could help shed some light into the purpose of this
code?

The suggestion given by Drew above is to remove it.  Do you have an
opinion about that?

Thanks in advance!

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20845; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Jun 2015 15:26:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 18 11:26:41 2015
Received: from localhost ([127.0.0.1]:50947 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Z5biD-0004uy-5d
	for submit <at> debbugs.gnu.org; Thu, 18 Jun 2015 11:26:41 -0400
Received: from eggs.gnu.org ([208.118.235.92]:42572)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1Z5biB-0004uk-8V
 for submit <at> debbugs.gnu.org; Thu, 18 Jun 2015 11:26:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1Z5bi4-0003Nz-Uh
 for submit <at> debbugs.gnu.org; Thu, 18 Jun 2015 11:26:33 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:50690)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1Z5bi4-0003Nt-Rb
 for submit <at> debbugs.gnu.org; Thu, 18 Jun 2015 11:26:32 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56071)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1Z5bi3-00061R-Ql
 for bug-gnu-emacs@HIDDEN; Thu, 18 Jun 2015 11:26:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1Z5bhw-0003JM-PW
 for bug-gnu-emacs@HIDDEN; Thu, 18 Jun 2015 11:26:31 -0400
Received: from aserp1040.oracle.com ([141.146.126.69]:28560)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1Z5bhw-0003IE-JW
 for bug-gnu-emacs@HIDDEN; Thu, 18 Jun 2015 11:26:24 -0400
Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])
 by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id
 t5IFQNhm030444
 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Thu, 18 Jun 2015 15:26:23 GMT
Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])
 by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t5IFQN5C013890
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL)
 for <bug-gnu-emacs@HIDDEN>; Thu, 18 Jun 2015 15:26:23 GMT
Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19])
 by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t5IFQICx001470
 for <bug-gnu-emacs@HIDDEN>; Thu, 18 Jun 2015 15:26:23 GMT
MIME-Version: 1.0
Message-ID: <45ac4463-d787-44d9-90ef-b40e32698ed9@default>
Date: Thu, 18 Jun 2015 08:26:17 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 25.0.50; bookmark.el, handling of fictitious `buffer' property
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9  (901082) [OL
 12.0.6691.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: aserv0022.oracle.com [141.146.126.234]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Function `bookmark-default-handler' picks up and handles the property
(field) named `bookmark', if present.

I see nowhere else where this property is used, and nowhere where it is
set.  And it is not documented.

IOW, there is no notion or existence (AFAICT) of any bookmarks that
record a `buffer' property.  And yet, the *default* handler handles
this unknown property - in two ways:

* If the file is readable and is not visited then it visits the file
  using `find-file-noselect'.  Why?

* Otherwise, if the buffer named by property `buffer' exists then the
  default handler does nothing (no-op).  The (non-English) comment here
  is "See if buffer BUF have been created.", which tells us nothing
  about why it is handled by doing nothing.

This partial "handling" of the undocumented and never-set property
`buffer' was apparently introduced in Emacs 23.1.  As it never did
anything, it was seemingly never noticed.

This property should either be properly documented (in the doc string of
`bookmark-alist'), as to its use and meaning, or its default "handling"
should be removed, as misguided.  I'd suggest that the unclear handling
should just be removed.

If there is some existing code distributed with Emacs that actually uses
this property (and I can find none) then a bug can be filed for it.

A grep of the Emacs sources for `bookmark-prop-set' shows no occurrences
of that function outside bookmark.el, and that function is never used to
set property `bookmark'.  I have also checked all occurrences of
`bookmark-make-record' in the Emacs Lisp sources, and found none that
set or use property `bookmark'.

AFAICT, this property does not exist, and its incomplete "handling"
should be removed.

On the other hand, if this handling was just added to bookmark.el by
someone only as support for some 3rd-party code, then it doesn't belong
here anyway - that 3rd-party code can advise `bookmark-default-handler'
or simply define its own, non-default, handlers.


In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2014-10-20 on LEG570
Bzr revision: 118168 rgm@HIDDEN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking=3Dyes,glyphs CPPFLAGS=3D-DGLYPH_DEBUG=3D1'




Acknowledgement sent to Drew Adams <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#20845; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.