From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Re: [External] : [emacs bookmark.el] Sorting by last set Date: Sat, 04 Jun 2022 01:07:55 -0500 Message-ID: <875ylhvu4k.fsf@red-bean.com> Reply-To: Karl Fogel Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37486"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Manuel Giraud , Stefan Monnier , Drew Adams , emacs-devel To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 04 08:10:44 2022 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 1nxMzj-0009bq-FZ for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Jun 2022 08:10:43 +0200 Original-Received: from localhost ([::1]:47752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxMzi-0007dT-5F for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Jun 2022 02:10:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxMxA-0006Rz-94 for emacs-devel@gnu.org; Sat, 04 Jun 2022 02:08:05 -0400 Original-Received: from sanpietro.red-bean.com ([45.79.25.59]:37448) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxMx8-0000kl-3U for emacs-devel@gnu.org; Sat, 04 Jun 2022 02:08:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=red-bean.com; s=202005newsp; h=Content-Type:MIME-Version:Message-ID:Date: Reply-To:Subject:Cc:To:From:Sender:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=WWRIyUf/jn4dfTE7vviWPwTmPE1WC13ioSb5NZUIZCY=; t=1654322881; x=1655532481; b=Xl8POXD9ExIZ3f8gTeUwhAc8f4D9v1MpbRZ27p02S/HuDVtAGtzbI3EopsOqvm5+42VJWPaLmLr JDQ351pGJscsXkjFem1+OU8LpNfplOCEkd2UmLHedqu95DVpC/iru5EIUSCsGyVo1S9i2fDXs2UNc 7U04rfPi8hJfrKP3O87Odr70aLhLMf75/EJrLg16UNmw7NvemD/ZHjoOzO/SR1uZUDUH0zvfUbF1K AK2AuADbbdTp6dP2Z3+eyf/yHurpY7IVtME4QuUNwqqIKibPExqhFm4XMSD/jJ9rhugADf/uElIUE fDoGBdEoubX08wVXkNwIKEECl0cleETKgVTw==; Original-Received: from 23-120-121-32.lightspeed.cicril.sbcglobal.net ([23.120.121.32]:45106 helo=klen) by sanpietro.red-bean.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nxMx3-0079UW-O4; Sat, 04 Jun 2022 06:07:57 +0000 Received-SPF: pass client-ip=45.79.25.59; envelope-from=kfogel@red-bean.com; helo=sanpietro.red-bean.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FAKE_REPLY_C=1.486, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:290642 Archived-At: A few thoughts I just had while looking over the recent improvement to bookmark.el sorting (commit f461eb8fa -- not the later followup commit fccde52158, which isn't relevant for these thoughts): 1) We use the value `last-modified' (for `bookmark-sort-flag') to represent sorting by the date the bookmark was most recently updated to point to a particular target. But there are other ways to "modify" bookmarks: for example, you could edit a bookmark's annotation without updating its target. One could make a reasonably good argument as to why an annotation change should count as a "modification" for the purposes of sorting... and, one could make a reasonably good argument why it shouldn't. My purpose here is just to ask: is the name "last-modified" really the most appropriate one for the behavior currently implemented? The simple solution would be to just change the symbol to `last-set-date'. I think that would be my choice. It would reduce the potential for confusion and misunderstanding. (I won't go in to the more complex solutions here, as I'm not sure that bookmark.el really needs its sorting capability to be fully operational battle station.) * Now that we're using a symbol for *one* possible value of `bookmark-sort-flag', should we use symbols for *all* possible values? (And leave the treatments of `t' and nil as legacy compatibility behaviors, documented as such but deprecated in favor of using the corresponding new symbols instead when writing new configurations.) * Finally, perhaps `bookmark-sort-flag' is no longer the right name for this variable? It's not a "flag" anymore -- a "flag" should be either `t' or nil. This naming tradition mostly holds throughout Emacs, although there is at least one other exception. Of the 54 symbols whose names end in "-flag" that I found via `M-x apropos', I did a random sampling of about 15. A few don't have real doc strings (sigh), but their values at least were either 't' or nil. Of the documented ones in my sample, all but one were true Boolean flags. The single exception was `quit-flag', which I would now also argue is misnamed, but I'm not advocating here that we change that one :-). However, I think it would be good to deprecate `bookmark-sort-flag' in favor of 'bookmark-sort-behavior' or something, and do whatever the usual compatibility dance is for such situations. It's useful for the suffix "-flag" to actually mean something, and I'd rather not have bookmark.el contribute to the dilution of that linguistic tradition. By the way, I still think the change as currently landed is an unambiguous improvement. I would still want to keep it even if we didn't take any of my suggestions above. Best regards, -Karl