From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#20845: 25.0.50; bookmark.el, handling of fictitious `buffer' property Date: Fri, 5 Jul 2019 14:45:19 +0200 Message-ID: References: <45ac4463-d787-44d9-90ef-b40e32698ed9@default> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="94793"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 20845@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 05 14:50:26 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hjNfV-000OYu-Tg for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jul 2019 14:50:26 +0200 Original-Received: from localhost ([::1]:52804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjNfT-00016q-Pt for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jul 2019 08:50:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56943) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjNbO-0007a4-8C for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 08:46:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjNbK-00019o-QP for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 08:46:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43666) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjNbF-0000mc-UB for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 08:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hjNbF-000061-OI for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 08:46:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <45ac4463-d787-44d9-90ef-b40e32698ed9@default> Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jul 2019 12:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20845 X-GNU-PR-Package: emacs Original-Received: via spool by 20845-submit@debbugs.gnu.org id=B20845.1562330739328 (code B ref 20845); Fri, 05 Jul 2019 12:46:01 +0000 Original-Received: (at 20845) by debbugs.gnu.org; 5 Jul 2019 12:45:39 +0000 Original-Received: from localhost ([127.0.0.1]:52487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hjNas-00005A-N4 for submit@debbugs.gnu.org; Fri, 05 Jul 2019 08:45:39 -0400 Original-Received: from mail-wm1-f51.google.com ([209.85.128.51]:52146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hjNaq-0008WV-3K for 20845@debbugs.gnu.org; Fri, 05 Jul 2019 08:45:36 -0400 Original-Received: by mail-wm1-f51.google.com with SMTP id 207so8756174wma.1 for <20845@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) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162118 Archived-At: 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 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 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 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