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: [PATCH] Fix bookmark-bmenu-list sorting. Date: Fri, 04 Mar 2022 02:18:44 -0600 Message-ID: <87tuceuo4b.fsf@red-bean.com> References: <875yovm1m6.fsf@elite.giraud> <87v8wvkk64.fsf@red-bean.com> <83v8wuj3v0.fsf@gnu.org> <87tucewgu7.fsf@red-bean.com> <83lexqi3z9.fsf@gnu.org> 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="702"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: manuel@ledu-giraud.fr, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 04 09:20:12 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 1nQ3AZ-000ASF-4B for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Mar 2022 09:20:11 +0100 Original-Received: from localhost ([::1]:54626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ3AX-0001JX-R4 for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Mar 2022 03:20:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ39G-0000U2-Al for emacs-devel@gnu.org; Fri, 04 Mar 2022 03:18:50 -0500 Original-Received: from sanpietro.red-bean.com ([45.79.25.59]:59638) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ39E-0002BT-4e; Fri, 04 Mar 2022 03:18:50 -0500 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: In-Reply-To:Date:Reply-To:References:Subject:Cc:To:From:Sender: Content-Transfer-Encoding:Content-ID:Content-Description; bh=GKUGjT77BBD40PNJOO9t52EHqgE55OxqVAToeBHfv5I=; t=1646381927; x=1647591527; b=EaA0OrxrOP8tI1zgfuiugul9DW6/exUXyH6Fa969Nx7TdFD21mc4dGlI0/8bAmapD8vyCktyneR +ALPiMFoW4/CtgiUNd4SuODDUIcZbvcjjtwkFG0JQj5QYHlENh8uGdBSx5xS10CjTBzhurQwWBIjk BGEn8F0ekOxqL7NYpPA0PQzr9Ngfk8m29owMGxqJ/F/Mh1qpwQmOQ67eu1oVU9gjx8Qf5SAj630iE xD1rBqELs/YqC/sjywpz1By98TWfGuyjZCg8aw5J2fgnrYFVm1yjeaZxGtvWTBOaQo0GyOsEcpfmr mbMywt9q2SPAID97Q+LXrONZ5foDZoJcmMsw==; Original-Received: from 99-112-125-163.lightspeed.cicril.sbcglobal.net ([99.112.125.163]:60044 helo=floss) 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 1nQ39A-00CgR0-PA; Fri, 04 Mar 2022 08:18:45 +0000 In-Reply-To: <83lexqi3z9.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Mar 2022 09:14:34 +0200") Received-SPF: pass client-ip=45.79.25.59; envelope-from=kfogel@red-bean.com; helo=sanpietro.red-bean.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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:286810 Archived-At: On 04 Mar 2022, Eli Zaretskii wrote: >The original message didn't describe any bugs, so I concluded it >was a >new feature. Sorry about that. > >However, if this is a bug, please tell: > > . what is the bug and how to reproduce it? > . if this is a regression, what was the last Emacs version > where the > reproduction recipe worked correctly? The variable `bookmark-sort-flag' is not obeyed in `bookmark-bmenu-mode' (that's the Dired-like mode entered interactively via `edit-bookmarks'). The behavior is supposed to be that when `bookmark-sort-flag' is non-nil, bookmarks are listed in lexical order by bookmark name, and when the variable is nil, they are listed in order from most-recently-created down to least-recently-created (As an aside: the latter case relies on the assumption that the order of elements in `bookmark-alist' reflects the order in which the bookmarks were created. This happens to be true, and is even documented in a couple of places in bookmark.el, but is not well-documented at the code site where it is actually implemented. That's something I'll take care of separately after handling Manuel's patch.) The bug Manuel found is that if you set `bookmark-sort-flag' to nil, the list is still displayed in lexically sorted order, as though the flag were still non-nil. His patch fixes that (although there is still a related pre-existing buglet, which I discuss farther down in this email). Manuel's original post said this in a compact and less detailed way: "Here is a patch that I think fix the default `bookmark-bmenu-list' sorting when `bookmark-sort-flag' is nil." >How do you know whether the current pretest of 28.1 is or isn't >"in >the very latest stages of its pretest"? The text says to ask if >you >aren't sure. As things are, we are, I hope, in the very latest >stages. Oh, I see now. There's an ambiguity (between CONTRIBUTE and how version numbers are recorded in the release branch's README), but from what you say, I now see that where CONTRIBUTE says "when it is for Emacs version NN.1 that is in the very last stages of its pretest", that means that the version number in the README on the branch will say NN.0.X. That isn't obvious from CONTRIBUTE, but it's a perfectly reasonable interpretation. (The other interpretation -- the one I made -- is that README would contain NN.1[.x] already; some projects do release branches one way, some do it the other.) >> I'm happy to put this change on whatever branch you prefer, of >> course. > >I will make up my mind after I know the answers to the above >questions. In addition to the two changes described above (Manuel's patch, and a separate internal comment fix), there is another buglet I am chasing, which I found when I was testing Manuel's patch: Even after Manuel's fix, the buffer generated by `edit-bookmarks' will not reorder the bookmarks after one toggles `bookmark-sort-flag' and types `g' (which runs `revert-buffer', which in this case invokes a `revert-buffer-function' that regenerates the buffer). But this problem is only for the first incarnation of that buffer! If one kills the buffer and rebuilds it from scratch, after that, the toggle-flag-and-revert routine *will* correctly reorder the bookmarks each time. This is a very minor buglet, in terms of its effects on users, since most people set `bookmark-sort-flag' in their init files anyway and aren't likely to toggle it during an Emacs session. However, it still bothers me, and it certainly interferes with testing `bookmark-sort-flag', so I'm planning to fix it too. So in summary, there are three small changes coming: 1) Manuel's original bugfix 2) Internal comment fix, motivated by (1) 3) Fix for the toggle-regenerate buglet. I would mildly prefer to put them all on the same branch, but I don't care which branch that is; let me know what you'd like. If you would like them on different branches, I can do that, just let me know which change goes to which branch. Best regards, -Karl