From unknown Mon Jun 23 04:13:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13882: 24.2; saveplace.el limit drop least recently used Resent-From: Kevin Ryde Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Mar 2013 20:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13882@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.136251666517114 (code B ref -1); Tue, 05 Mar 2013 20:52:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Mar 2013 20:51:05 +0000 Received: from localhost ([127.0.0.1]:33039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCypB-0004Rf-2C for submit@debbugs.gnu.org; Tue, 05 Mar 2013 15:51:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49589) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCyp2-0004RJ-C0 for submit@debbugs.gnu.org; Tue, 05 Mar 2013 15:50:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCyoZ-0006WZ-GT for submit@debbugs.gnu.org; Tue, 05 Mar 2013 15:50:25 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:53122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCyoZ-0006WV-De for submit@debbugs.gnu.org; Tue, 05 Mar 2013 15:50:23 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCyoW-0000Dq-K9 for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2013 15:50:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCyoN-0006TR-5H for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2013 15:50:20 -0500 Received: from mailout1-15.pacific.net.au ([125.255.80.134]:45483 helo=mailout3-syd3.pacific.net.au) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCyoM-0006S3-JF for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2013 15:50:11 -0500 Received: from mailproxy3-syd3.pacific.net.au (mailproxy3-syd3.pacific.net.au [61.8.2.164]) by mailout3-syd3.pacific.net.au (Postfix) with ESMTP id 3954C37F7FC for ; Wed, 6 Mar 2013 07:50:03 +1100 (EST) Received: from blah.blah (unknown [203.26.175.129]) by mailproxy3-syd3.pacific.net.au (Postfix) with ESMTP id D185D578085 for ; Wed, 6 Mar 2013 07:49:30 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.80) (envelope-from ) id 1UCynS-0003bT-N8 for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2013 07:49:14 +1100 From: Kevin Ryde Date: Wed, 06 Mar 2013 07:49:14 +1100 Message-ID: <87ip55608l.fsf@blah.blah> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) --=-=-= Content-Type: text/plain When saveplace.el reaches save-place-limit, the file positions retained via ~/.emacs-places are the first limit-many in alphabetical order. I hoped instead it would be the first limit-many most recently used. Ie. drop the least recently visited files in order to enforce the limit. I struck this when I reached my save-place-limit with lots of files I had visited long ago but which happened to be alphabetically before ones I was visiting now. The save-place feature no longer saved places across sessions for files I now visited. The effect can be seen by setting a small limit per init.el below. Then foo.el to visit three files successively HOME=`pwd` emacs -Q -l ./init.el -l ./foo.el This leaves .emacs-places (in the current directory due to faked $HOME) containing (("/tmp/aa" . 4) ("/tmp/bb" . 4) ("/tmp/cc" . 4)) Notice /tmp/cc was the most recently visited file but it's at the end of the list and will be truncated when load-save-place-alist-from-file enforces save-place-limit of 2. HOME=`pwd` emacs -Q -l ./init.el /tmp/cc => point is at start of buffer /tmp/cc I hoped it would be at the end from the last visit Note that you must exit and restart emacs to see the effect, because save-place-limit is only enforced by load-save-place-alist-from-file. Within a session there's no limit, only in reading the .emacs-places file on restarting emacs. I get some joy from not sorting save-place-alist when saving per change below. I believe save-place-to-alist keeps save-place-alist in "most recent first" order (by delq and re-push to move an existing entry to the start), and that that order should be preserved when saving. 2013-03-04 Kevin Ryde * saveplace.el (save-place-alist-to-file): Don't `sort' save-place-alist alphabetically, keep it in "most recent first" order. This ensures save-place-limit drops the least recently visited files, not the alphabetically last files. Dropping alphabetically last files had meant save-place stopped working across sessions after .emacs-places filled with alphabetically early names. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=init.el Content-Transfer-Encoding: quoted-printable (setq-default save-place t) (setq save-place-limit 2) (require 'saveplace) --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=foo.el Content-Transfer-Encoding: quoted-printable (progn (find-file "/tmp/aa") (insert "aa\n") (save-buffer) (kill-buffer) (find-file "/tmp/bb") (insert "bb\n") (save-buffer) (kill-buffer) (find-file "/tmp/cc") (insert "cc\n") (save-buffer) (kill-buffer) (kill-emacs)) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=saveplace.el.nosort.diff --- saveplace.el.orig 2013-03-04 17:06:20.000000000 +1100 +++ saveplace.el 2013-03-04 17:07:42.000000000 +1100 @@ -224,8 +224,7 @@ (symbol-name coding-system-for-write))) (let ((print-length nil) (print-level nil)) - (pp (sort save-place-alist - (lambda (a b) (string< (car a) (car b)))) + (pp save-place-alist ;; saved in order of most recently used (current-buffer))) (let ((version-control (cond --=-=-= Content-Type: text/plain In GNU Emacs 24.2.1 (i486-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-09-10 on biber, modified by Debian Configured using: `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.2/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default enable-multibyte-characters: t --=-=-=-- From unknown Mon Jun 23 04:13:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13882: 24.2; saveplace.el limit drop least recently used Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Mar 2013 15:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Kevin Ryde Cc: Karl Fogel , 13882@debbugs.gnu.org Received: via spool by 13882-submit@debbugs.gnu.org id=B13882.136267041413940 (code B ref 13882); Thu, 07 Mar 2013 15:34:02 +0000 Received: (at 13882) by debbugs.gnu.org; 7 Mar 2013 15:33:34 +0000 Received: from localhost ([127.0.0.1]:36708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDcp3-0003cn-N8 for submit@debbugs.gnu.org; Thu, 07 Mar 2013 10:33:34 -0500 Received: from mail-lb0-f181.google.com ([209.85.217.181]:64149) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDcp1-0003ca-O5 for 13882@debbugs.gnu.org; Thu, 07 Mar 2013 10:33:33 -0500 Received: by mail-lb0-f181.google.com with SMTP id gm6so534304lbb.26 for <13882@debbugs.gnu.org>; Thu, 07 Mar 2013 07:32:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type:x-antivirus :x-antivirus-status; bh=J0uflY//4zUysANdTQ4auhr5VUDYhi3yDJbMJUkisMs=; b=CdlGCcYaymPHLoben8qfuAU5TKi66SWITpcSgtFB0iN6If0UkdcvOTMEvZYLSv50EB ErhzFNCqO99ZErjbDqZKGQd0vfpB+d2j14Yu1GRMYplySmrYLA+N511DbuV9sMyr+U0/ wZ5hb4oRGdkr8M8f0xZIeOvFJZPPxG/lLX0ti/srM13NY/8aA1cZj29GpSppC2fVY+pM 47kLUY759DjC1Fpsj2cHnM6mBVeFX4Lffgj/nawxr8xCVbfWnWCl5nLSuZRjdjarv7aA g489AMzHE6bkVr36NML/K7xDnaTbR0ZZ39P38YkSMzoCGG4AqmdBuwEZW/dlLT0VPhKX W4MA== X-Received: by 10.152.109.208 with SMTP id hu16mr29127859lab.45.1362670372929; Thu, 07 Mar 2013 07:32:52 -0800 (PST) Received: from SOL ([178.252.98.87]) by mx.google.com with ESMTPS id ng6sm1016195lab.2.2013.03.07.07.32.50 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Mar 2013 07:32:51 -0800 (PST) From: Dmitry Gutov References: <87ip55608l.fsf@blah.blah> Date: Thu, 07 Mar 2013 19:32:45 +0400 In-Reply-To: <87ip55608l.fsf@blah.blah> (Kevin Ryde's message of "Wed, 06 Mar 2013 07:49:14 +1100") Message-ID: <874ngn5ioy.fsf@yandex.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain X-Antivirus: avast! (VPS 130307-0, 07.03.2013), Outbound message X-Antivirus-Status: Clean X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Kevin Ryde writes: > When saveplace.el reaches save-place-limit, the file positions retained > via ~/.emacs-places are the first limit-many in alphabetical order. > I hoped instead it would be the first limit-many most recently used. > Ie. drop the least recently visited files in order to enforce the limit. > > I struck this when I reached my save-place-limit with lots of files I > had visited long ago but which happened to be alphabetically before ones > I was visiting now. The save-place feature no longer saved places > across sessions for files I now visited. > I can confirm that this is a problem, and it doesn't look "minor" in the context of this package. > ... > I get some joy from not sorting save-place-alist when saving per change > below. > > I believe save-place-to-alist keeps save-place-alist in "most recent > first" order (by delq and re-push to move an existing entry to the > start), and that that order should be preserved when saving. I like the solution, but according to the ChangeLog the decision to sort the list was made at the request of a user, who apparently has to merge saveplace history files from time to time: 2010-12-29 Karl Fogel * saveplace.el (save-place-alist-to-file): Save list sorted and pretty-printed, so that it is mergeable by line-based text merging, as suggested by Iain Dalton . Paging the author. Karl, do you think this consideration is still important? I don't see a reasonable way to keep the list easy to merge and still retain the "most-recently used" information. You either keep the list unsorted (and continually shuffle the elements), or store some timestamps, which will also be a source of merge conflicts. > 2013-03-04 Kevin Ryde > > * saveplace.el (save-place-alist-to-file): Don't `sort' > save-place-alist alphabetically, keep it in "most recent first" order. > This ensures save-place-limit drops the least recently visited files, > not the alphabetically last files. Dropping alphabetically last files > had meant save-place stopped working across sessions after > .emacs-places filled with alphabetically early names. --Dmitry From unknown Mon Jun 23 04:13:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13882: 24.2; saveplace.el limit drop least recently used Resent-From: Karl Fogel Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Mar 2013 21:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: Kevin Ryde , 13882@debbugs.gnu.org Reply-To: Karl Fogel Received: via spool by 13882-submit@debbugs.gnu.org id=B13882.136269128911901 (code B ref 13882); Thu, 07 Mar 2013 21:22:02 +0000 Received: (at 13882) by debbugs.gnu.org; 7 Mar 2013 21:21:29 +0000 Received: from localhost ([127.0.0.1]:37157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDiFh-00035q-FP for submit@debbugs.gnu.org; Thu, 07 Mar 2013 16:21:29 -0500 Received: from mail-ia0-f181.google.com ([209.85.210.181]:46837) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDiFc-00035a-4Z for 13882@debbugs.gnu.org; Thu, 07 Mar 2013 16:21:24 -0500 Received: by mail-ia0-f181.google.com with SMTP id w33so865111iag.12 for <13882@debbugs.gnu.org>; Thu, 07 Mar 2013 13:20:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:reply-to:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=v2QWjMcqNcHR3EE1W5FduKg06pxjp++lwFOC4FPrw7s=; b=zHUyvmQS01/eQw84z+raXi71tXz3pAqh0Izh8oIrKNvxAcaXV04YiV52uZWw5ccS0D RDopsLK7pGTfkVeqzkOI9BgodgLxD01vz71Q09P6rWlWhAgTmY7Pf2dICDddaXaewoNN m2ccVfSTtVk3fdBE/ZJyeCOac2H0KNCEShwIFlclv9fdfV02TtJnMFHvskXqpN12aaKk Z/1SB0io6fRQwxoiKuP1xoVqXfbuHmgBECfLqxWrPCmC1OaavMgSFNxRY7VXIFKt4SXx kxPA2OwlDNVUyZ2y/gI+ZhFH2ooM6Puhc05p2Z3Ta86qgZC4XDE0iK9RvO45en09lLws K2Kg== X-Received: by 10.50.140.5 with SMTP id rc5mr15865317igb.78.1362691240567; Thu, 07 Mar 2013 13:20:40 -0800 (PST) Received: from kwarm.red-bean.com (74-92-190-113-Illinois.hfc.comcastbusiness.net. [74.92.190.113]) by mx.google.com with ESMTPS id a3sm3097719igq.5.2013.03.07.13.20.38 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 07 Mar 2013 13:20:39 -0800 (PST) From: Karl Fogel References: <87ip55608l.fsf@blah.blah> <874ngn5ioy.fsf@yandex.ru> Date: Thu, 07 Mar 2013 15:20:37 -0600 In-Reply-To: <874ngn5ioy.fsf@yandex.ru> (Dmitry Gutov's message of "Thu, 07 Mar 2013 19:32:45 +0400") Message-ID: <87a9qe52l6.fsf@kwarm.red-bean.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Dmitry Gutov writes: >Kevin Ryde writes: >> When saveplace.el reaches save-place-limit, the file positions retained >> via ~/.emacs-places are the first limit-many in alphabetical order. >> I hoped instead it would be the first limit-many most recently used. >> Ie. drop the least recently visited files in order to enforce the limit. >> >> I struck this when I reached my save-place-limit with lots of files I >> had visited long ago but which happened to be alphabetically before ones >> I was visiting now. The save-place feature no longer saved places >> across sessions for files I now visited. >> > >I can confirm that this is a problem, and it doesn't look "minor" in the >context of this package. > >> ... >> I get some joy from not sorting save-place-alist when saving per change >> below. >> >> I believe save-place-to-alist keeps save-place-alist in "most recent >> first" order (by delq and re-push to move an existing entry to the >> start), and that that order should be preserved when saving. > >I like the solution, but according to the ChangeLog the decision to sort >the list was made at the request of a user, who apparently has to merge >saveplace history files from time to time: > >2010-12-29 Karl Fogel > > * saveplace.el (save-place-alist-to-file): Save list sorted and > pretty-printed, so that it is mergeable by line-based text merging, > as suggested by Iain Dalton . > >Paging the author. > >Karl, do you think this consideration is still important? I don't see a >reasonable way to keep the list easy to merge and still retain the >"most-recently used" information. > >You either keep the list unsorted (and continually shuffle the >elements), or store some timestamps, which will also be a source of >merge conflicts. Hmmm. I see your point, and, of course, there are arguments both ways. We could supply an user-option to control the behavior, but that still leaves the question of which default we should choose... However, I think the answer to that is also clear: unsorted should be the default (or rather, chronologically sorted should be the default), and if a user wants the list alphabetized (for merge purposes), they can configure it so. And this would be documented not only in the new variable, but also in the doc string of `save-place-limit'. What do you think? -Karl >> 2013-03-04 Kevin Ryde >> >> * saveplace.el (save-place-alist-to-file): Don't `sort' >> save-place-alist alphabetically, keep it in "most recent first" order. >> This ensures save-place-limit drops the least recently visited files, >> not the alphabetically last files. Dropping alphabetically last files >> had meant save-place stopped working across sessions after >> .emacs-places filled with alphabetically early names. > >--Dmitry From unknown Mon Jun 23 04:13:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13882: 24.2; saveplace.el limit drop least recently used Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Mar 2013 22:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Karl Fogel Cc: iain.dalton@gmail.com, Kevin Ryde , 13882@debbugs.gnu.org Received: via spool by 13882-submit@debbugs.gnu.org id=B13882.136269446520179 (code B ref 13882); Thu, 07 Mar 2013 22:15:02 +0000 Received: (at 13882) by debbugs.gnu.org; 7 Mar 2013 22:14:25 +0000 Received: from localhost ([127.0.0.1]:37273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDj4z-0005FP-C3 for submit@debbugs.gnu.org; Thu, 07 Mar 2013 17:14:25 -0500 Received: from mail-la0-f51.google.com ([209.85.215.51]:37644) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDj4x-0005FD-6U for 13882@debbugs.gnu.org; Thu, 07 Mar 2013 17:14:24 -0500 Received: by mail-la0-f51.google.com with SMTP id fo13so1035511lab.24 for <13882@debbugs.gnu.org>; Thu, 07 Mar 2013 14:13:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding:x-antivirus:x-antivirus-status; bh=EZ84zDpZ25Dq7FcOTkmNshh6Wd7bx719rD/SvYrdd1I=; b=nB1bHOluZNrlPIoiGjt6eHr2LfUjVZbITyXTbTbVjIWCNbAbKRqaRXpFDrQNA8L+aH kxwQw4Yg18+yfYScROYgq4wicmGfX2q5EH651NWyPzJkD5bpZ0CTxQK60NlpM7tqx4S/ MQEbgrx+sgdV+NNcWnCFwRvKLeXldTx/+J/mk2tRGa4O0U8ymYiN9yHrQ5WmXPN1Ip/v 9qtQFJrB0dCmGuUhcmmdL1jGxwPlXmT361ZMdcVqaVaGsEbMJxv4bzxxwVBOzvaCtGYZ 0O6Lu5wCl0R+iyzJBYY+PTRBdzTI56ExEpot8AIY7chygudqVx7iUngWA4s3Eah9kYLg r7aw== X-Received: by 10.112.83.133 with SMTP id q5mr191119lby.25.1362694422883; Thu, 07 Mar 2013 14:13:42 -0800 (PST) Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPS id oy10sm1528671lab.8.2013.03.07.14.13.40 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Mar 2013 14:13:41 -0800 (PST) Message-ID: <51391119.5030008@yandex.ru> Date: Fri, 08 Mar 2013 02:13:45 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 References: <87ip55608l.fsf@blah.blah> <874ngn5ioy.fsf@yandex.ru> <87a9qe52l6.fsf@kwarm.red-bean.com> In-Reply-To: <87a9qe52l6.fsf@kwarm.red-bean.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 130307-0, 07.03.2013), Outbound message X-Antivirus-Status: Clean X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 08.03.2013 1:20, Karl Fogel wrote: > Dmitry Gutov writes: >> Karl, do you think this consideration is still important? I don't see a >> reasonable way to keep the list easy to merge and still retain the >> "most-recently used" information. >> >> You either keep the list unsorted (and continually shuffle the >> elements), or store some timestamps, which will also be a source of >> merge conflicts. > > Hmmm. I see your point, and, of course, there are arguments both ways. > > We could supply an user-option to control the behavior, but that still > leaves the question of which default we should choose... > > However, I think the answer to that is also clear: unsorted should be > the default (or rather, chronologically sorted should be the default), > and if a user wants the list alphabetized (for merge purposes), they can > configure it so. And this would be documented not only in the new > variable, but also in the doc string of `save-place-limit'. > > What do you think? We can do it this way, of course. But I imagine that merging of place files can only be a once-in-a-while occurrence, and at all other times the user would prefer the chronological sorting (if they were aware of this issue, at all). So maybe we should provide an export command instead, that would save the sorted places list to a file specified by the user, to do as they please. Let's also ask the original reporter. Iain, any opinion? From unknown Mon Jun 23 04:13:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13882: 24.2; saveplace.el limit drop least recently used Resent-From: Kevin Ryde Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2013 01:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Karl Fogel Cc: iain.dalton@gmail.com, 13882@debbugs.gnu.org, Dmitry Gutov Received: via spool by 13882-submit@debbugs.gnu.org id=B13882.136287721311299 (code B ref 13882); Sun, 10 Mar 2013 01:01:02 +0000 Received: (at 13882) by debbugs.gnu.org; 10 Mar 2013 01:00:13 +0000 Received: from localhost ([127.0.0.1]:42540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UEUcW-0002wA-5E for submit@debbugs.gnu.org; Sat, 09 Mar 2013 20:00:13 -0500 Received: from mailout2-13.pacific.net.au ([125.255.80.140]:50041 helo=mailout4-syd3.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UEUcS-0002vy-J1 for 13882@debbugs.gnu.org; Sat, 09 Mar 2013 20:00:11 -0500 Received: from mailproxy3-syd3.pacific.net.au (mailproxy3-syd3.pacific.net.au [61.8.2.164]) by mailout4-syd3.pacific.net.au (Postfix) with ESMTP id 4FD802239A0; Sun, 10 Mar 2013 11:59:20 +1100 (EST) Received: from blah.blah (unknown [203.26.175.178]) by mailproxy3-syd3.pacific.net.au (Postfix) with ESMTP id A897B578082; Sun, 10 Mar 2013 11:59:19 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.80) (envelope-from ) id 1UEUaI-0007MV-7J; Sun, 10 Mar 2013 11:57:54 +1100 From: Kevin Ryde References: <87ip55608l.fsf@blah.blah> <874ngn5ioy.fsf@yandex.ru> <87a9qe52l6.fsf@kwarm.red-bean.com> Date: Sun, 10 Mar 2013 11:57:54 +1100 In-Reply-To: <87a9qe52l6.fsf@kwarm.red-bean.com> (Karl Fogel's message of "Thu, 07 Mar 2013 15:20:37 -0600") Message-ID: <87zjyc3wbx.fsf@blah.blah> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) Karl Fogel writes: > > However, I think the answer to that is also clear: unsorted should be > the default (or rather, chronologically sorted should be the default), > and if a user wants the list alphabetized (for merge purposes), they can > configure it so. You'd be very tempted to let them put it through the sort program or sort func themselves, not have any option at all. In a merge you presumably still want the most-recent 400 visits, or whatever limit, which would require per-entry timestamps to do properly. And if you're not limiting it then I imagine there's no need to sort, just concat the lot. I wondered how well the simple save-place-loaded bit works when you've got two running copies of emacs. I suppose the save places of the last one to exit will overwrite anything the others saved. That wasn't the aim of the "merge" was it? From unknown Mon Jun 23 04:13:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13882: 24.2; saveplace.el limit drop least recently used Resent-From: Karl Fogel Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2013 22:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Kevin Ryde Cc: iain.dalton@gmail.com, 13882@debbugs.gnu.org, Dmitry Gutov Reply-To: Karl Fogel Received: via spool by 13882-submit@debbugs.gnu.org id=B13882.136295342031309 (code B ref 13882); Sun, 10 Mar 2013 22:11:01 +0000 Received: (at 13882) by debbugs.gnu.org; 10 Mar 2013 22:10:20 +0000 Received: from localhost ([127.0.0.1]:44610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UEoRg-00088w-FO for submit@debbugs.gnu.org; Sun, 10 Mar 2013 18:10:20 -0400 Received: from mail-oa0-f42.google.com ([209.85.219.42]:40220) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UEoRd-00088i-Fs for 13882@debbugs.gnu.org; Sun, 10 Mar 2013 18:10:19 -0400 Received: by mail-oa0-f42.google.com with SMTP id i18so3915687oag.15 for <13882@debbugs.gnu.org>; Sun, 10 Mar 2013 15:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:reply-to:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=HZZQ4ujTQ7JeALLdXfFa/nXS5ctJHVuOc3jE7IPjTQg=; b=HwjZ0GvdCNtAASPGVGmXuhnKy4hh6F5zBSTO+2GWQr4U1r2IoY3HBzTgJx566VYLPV 0h5kW+Q8Bs1TroqGQUpFxfVSg+0WjFvi0RrEx9L1QZkuiFvuwYH3WT0SiaF73yG08NDt PK1CZG2rpWE0G+SNAGMN7bOOQe55hrJodDERPTEdOCU2fTRSpz0GGbIIkdSMEtKe06aZ k5u4Uodq533kcDaEI94CbPER4koUPxlqw/eASYoBvrqawUoyXMLlxCO+dKfJwWsLp0V6 tzZubsQ+a4UpWhajhdJ4HAfN1uRiNHTIFwQ4mo8K5JAfm0GWptzJ1CvZb5i5FsZagRid BkbQ== X-Received: by 10.60.172.131 with SMTP id bc3mr7142490oec.79.1362953361212; Sun, 10 Mar 2013 15:09:21 -0700 (PDT) Received: from floss.red-bean.com (99-135-138-214.lightspeed.cicril.sbcglobal.net. [99.135.138.214]) by mx.google.com with ESMTPS id j10sm14920552obg.4.2013.03.10.15.09.17 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 10 Mar 2013 15:09:20 -0700 (PDT) From: Karl Fogel References: <87ip55608l.fsf@blah.blah> <874ngn5ioy.fsf@yandex.ru> <87a9qe52l6.fsf@kwarm.red-bean.com> <87zjyc3wbx.fsf@blah.blah> Date: Sun, 10 Mar 2013 17:09:11 -0500 In-Reply-To: <87zjyc3wbx.fsf@blah.blah> (Kevin Ryde's message of "Sun, 10 Mar 2013 11:57:54 +1100") Message-ID: <87li9udi0o.fsf@floss.red-bean.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Kevin Ryde writes: >Karl Fogel writes: >> However, I think the answer to that is also clear: unsorted should be >> the default (or rather, chronologically sorted should be the default), >> and if a user wants the list alphabetized (for merge purposes), they can >> configure it so. > >You'd be very tempted to let them put it through the sort program or >sort func themselves, not have any option at all. ? Sorry; I didn't understand the above. Are you saying I personally would be tempted to do that, or that in the abstract one would be tempted to do that? How would the user hook in to run the sort, unless we provide some option in saveplace.el? (We don't generally expect users to modify the source code of core Emacs packages.) >In a merge you presumably still want the most-recent 400 visits, or >whatever limit, which would require per-entry timestamps to do properly. >And if you're not limiting it then I imagine there's no need to sort, >just concat the lot. > >I wondered how well the simple save-place-loaded bit works when you've >got two running copies of emacs. I suppose the save places of the last >one to exit will overwrite anything the others saved. That wasn't the >aim of the "merge" was it? Um. Can you say the above more verbosely? I'm not really understanding how many different topics you're addressing, nor what changes you're proposing... I'm happy to address a concrete proposal, I'm just having trouble understanding exactly what you're saying above. (It could be because I'm a bit sick right now; apologies if my brain isn't working right...) -Karl From unknown Mon Jun 23 04:13:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13882: 24.2; saveplace.el limit drop least recently used Resent-From: Kevin Ryde Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2013 21:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Karl Fogel Cc: iain.dalton@gmail.com, 13882@debbugs.gnu.org, Dmitry Gutov Received: via spool by 13882-submit@debbugs.gnu.org id=B13882.13630372076144 (code B ref 13882); Mon, 11 Mar 2013 21:27:02 +0000 Received: (at 13882) by debbugs.gnu.org; 11 Mar 2013 21:26:47 +0000 Received: from localhost ([127.0.0.1]:46953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFAF2-0001b0-KG for submit@debbugs.gnu.org; Mon, 11 Mar 2013 17:26:46 -0400 Received: from mailout1-15.pacific.net.au ([125.255.80.134]:45795 helo=mailout3-syd3.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFAEy-0001ap-PG for 13882@debbugs.gnu.org; Mon, 11 Mar 2013 17:26:43 -0400 Received: from mailproxy3-syd3.pacific.net.au (mailproxy3-syd3.pacific.net.au [61.8.2.164]) by mailout3-syd3.pacific.net.au (Postfix) with ESMTP id C299637F717; Tue, 12 Mar 2013 08:25:41 +1100 (EST) Received: from blah.blah (unknown [203.26.175.175]) by mailproxy3-syd3.pacific.net.au (Postfix) with ESMTP id 0DACE578082; Tue, 12 Mar 2013 08:25:39 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.80) (envelope-from ) id 1UFACG-0002q6-9M; Tue, 12 Mar 2013 08:23:52 +1100 From: Kevin Ryde References: <87ip55608l.fsf@blah.blah> <874ngn5ioy.fsf@yandex.ru> <87a9qe52l6.fsf@kwarm.red-bean.com> <87zjyc3wbx.fsf@blah.blah> <87li9udi0o.fsf@floss.red-bean.com> Date: Tue, 12 Mar 2013 08:23:52 +1100 In-Reply-To: <87li9udi0o.fsf@floss.red-bean.com> (Karl Fogel's message of "Sun, 10 Mar 2013 17:09:11 -0500") Message-ID: <87y5dt8wbb.fsf@blah.blah> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Karl Fogel writes: > > or that in the abstract one would be > tempted to do that? Yes, in the abstract :-). > I'm happy to address a concrete proposal, I would say take away the `sort', and don't have an option for it. > How would the user hook in to run the sort, unless we provide some > option in saveplace.el? I presume a user has two .emacs-places files and wants to merge them. Was that the motivation for the sort? If yes then I would say the files can be sorted easily enough at that time, no need to always save sorted. In fact I would say keeping most-recent-first order might be desirable when merging two files anyway. > I'm just having > trouble understanding exactly what you're saying above. The second part I wondered what happens if I have two running copies of emacs, both with save-place enabled. When the first one exits it writes .emacs-places. When the second one exits it too writes .emacs-places. I suspect the second overwrites the first. Was such a situation the motivation for the sort to "merge"? From unknown Mon Jun 23 04:13:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13882: 24.2; saveplace.el limit drop least recently used Resent-From: Karl Fogel Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2013 22:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Kevin Ryde Cc: iain.dalton@gmail.com, 13882@debbugs.gnu.org, Dmitry Gutov Reply-To: Karl Fogel Received: via spool by 13882-submit@debbugs.gnu.org id=B13882.136303932212694 (code B ref 13882); Mon, 11 Mar 2013 22:03:01 +0000 Received: (at 13882) by debbugs.gnu.org; 11 Mar 2013 22:02:02 +0000 Received: from localhost ([127.0.0.1]:46986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFAnC-0003Ig-9w for submit@debbugs.gnu.org; Mon, 11 Mar 2013 18:02:02 -0400 Received: from mail-ie0-f175.google.com ([209.85.223.175]:56156) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFAn9-0003IC-BN for 13882@debbugs.gnu.org; Mon, 11 Mar 2013 18:02:00 -0400 Received: by mail-ie0-f175.google.com with SMTP id c12so5387775ieb.20 for <13882@debbugs.gnu.org>; Mon, 11 Mar 2013 15:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:reply-to:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=PSAc9VxKFZt03sYgmR3Qa1Vy3XRcJd5wXErx+p9hF7s=; b=xcPhhmfiv/0PJG1EiPUlHdIQJUvJ3NQbvrxXM6UO2WbsBKcDYKl9V+YeJicso9ZCh1 NSp1lm8jVnGjlITq1mFtUOmEY5ypJL/ZkgsHyIE8wLG7uQlovDgbsYmRvo0Nvl1hQ/y/ FZ3xd3GjwExEE2ehl/z4D5OQFApvrTyVZE6WTz+L4OIMlnDYvoZh9wggiFENCrnds9rM CZMOCb+wANyXGXugjJyBe0oZL5iwZIa+MzuM0wW1fMm9tQw/b0aHkbDp14PVu0lG/wh9 qRuBTEZulAs/vc6xNQ1rHUfchN5r8mQm2zhlRXDuURaXEGqah+R8ZW8cCcfGNncl4OPy wjkg== X-Received: by 10.42.30.132 with SMTP id v4mr10144392icc.34.1363039257271; Mon, 11 Mar 2013 15:00:57 -0700 (PDT) Received: from kwarm.red-bean.com (74-92-190-113-Illinois.hfc.comcastbusiness.net. [74.92.190.113]) by mx.google.com with ESMTPS id ur12sm16635545igb.8.2013.03.11.15.00.55 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 11 Mar 2013 15:00:56 -0700 (PDT) From: Karl Fogel References: <87ip55608l.fsf@blah.blah> <874ngn5ioy.fsf@yandex.ru> <87a9qe52l6.fsf@kwarm.red-bean.com> <87zjyc3wbx.fsf@blah.blah> <87li9udi0o.fsf@floss.red-bean.com> <87y5dt8wbb.fsf@blah.blah> Date: Mon, 11 Mar 2013 17:00:49 -0500 In-Reply-To: <87y5dt8wbb.fsf@blah.blah> (Kevin Ryde's message of "Tue, 12 Mar 2013 08:23:52 +1100") Message-ID: <87boapfvfy.fsf@kwarm.red-bean.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Kevin Ryde writes: >> I'm happy to address a concrete proposal, >I would say take away the `sort', and don't have an option for it. Ah, okay. So you're saying the merge use case is not worth supporting, it sounds like? >> How would the user hook in to run the sort, unless we provide some >> option in saveplace.el? > >I presume a user has two .emacs-places files and wants to merge them. >Was that the motivation for the sort? Right, I think so. I think it's typically that they keep their .emacs-places under version control, and they do an update ("pull") and get changes that need to be merged. So they want the file to work well with the usual merge algorithms. >If yes then I would say the files can be sorted easily enough at that >time, no need to always save sorted. In fact I would say keeping >most-recent-first order might be desirable when merging two files >anyway. Yes, now that you mention it, it makes me wonder why there was a merge problem in the first place... >The second part I wondered what happens if I have two running copies of >emacs, both with save-place enabled. When the first one exits it writes >.emacs-places. When the second one exits it too writes .emacs-places. >I suspect the second overwrites the first. Was such a situation the >motivation for the sort to "merge"? No; I think it was the above (version control) scenario. Best, -Karl From unknown Mon Jun 23 04:13:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13882: 24.2; saveplace.el limit drop least recently used Resent-From: Ian Dalton Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2013 22:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Karl Fogel Cc: Kevin Ryde , 13882@debbugs.gnu.org, Dmitry Gutov Received: via spool by 13882-submit@debbugs.gnu.org id=B13882.136303978813362 (code B ref 13882); Mon, 11 Mar 2013 22:10:02 +0000 Received: (at 13882) by debbugs.gnu.org; 11 Mar 2013 22:09:48 +0000 Received: from localhost ([127.0.0.1]:47002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFAui-0003TT-0c for submit@debbugs.gnu.org; Mon, 11 Mar 2013 18:09:48 -0400 Received: from mail-la0-f44.google.com ([209.85.215.44]:61769) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFAuf-0003TD-D0 for 13882@debbugs.gnu.org; Mon, 11 Mar 2013 18:09:46 -0400 Received: by mail-la0-f44.google.com with SMTP id eb20so4520514lab.31 for <13882@debbugs.gnu.org>; Mon, 11 Mar 2013 15:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=Zz1xL7yqNp8Qy4YjswuVc5wOX3ydt+l2AwgKW8hPwGQ=; b=QWG2xo+pWyfKjZZXVDK0T++DRbtNHHZVjbUHvnIBp3IiWkdm9+knDqB54RYaJlQbXd pm72dBgo42nijH13pJfiJb8BhrP9lihHtC7UbEog0hu7tbM/6hk3RZrBsZnypmdHDOdV KCzvEdbPGE0CX9ucaViuUsq7fo46KPFIj/DaY1MjebftyRFMXg62fpcnD947FEBGYqS+ RXBo4z/qNqqYtLl55kdhAsojqX5wVj/uSt3+rvHBnrSkG48JlOkZvMtZC20MCDoD9BI0 biQs2/1JLQ/9ezbLUNDV4u5+BftfgoNnhZEiwpVECg3cXnggnWr8qHR2FZ1dYrOoULnQ UL2Q== MIME-Version: 1.0 X-Received: by 10.152.148.195 with SMTP id tu3mr11770073lab.27.1363039722649; Mon, 11 Mar 2013 15:08:42 -0700 (PDT) Received: by 10.112.44.202 with HTTP; Mon, 11 Mar 2013 15:08:42 -0700 (PDT) In-Reply-To: <87boapfvfy.fsf@kwarm.red-bean.com> References: <87ip55608l.fsf@blah.blah> <874ngn5ioy.fsf@yandex.ru> <87a9qe52l6.fsf@kwarm.red-bean.com> <87zjyc3wbx.fsf@blah.blah> <87li9udi0o.fsf@floss.red-bean.com> <87y5dt8wbb.fsf@blah.blah> <87boapfvfy.fsf@kwarm.red-bean.com> Date: Mon, 11 Mar 2013 16:08:42 -0600 Message-ID: From: Ian Dalton Content-Type: multipart/alternative; boundary=e89a8f2348557bbd9204d7ad6a97 X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) --e89a8f2348557bbd9204d7ad6a97 Content-Type: text/plain; charset=UTF-8 For the record, my original bug report read: > I sync my Emacs profile across several computers with Unison, and it > can't merge changes in .places because it's one long line. I no longer use this setup, so I don't know how useful a change it was. I think that the Unison UI had some kind of option to do guided file merges, but it only worked for the usual simple line-oriented diff. --e89a8f2348557bbd9204d7ad6a97 Content-Type: text/html; charset=UTF-8
For the record, my original bug report read:

> I sync my Emacs profile across several computers with Unison, and it
> can't merge changes in .places because it's one long line.

I no longer use this setup, so I don't know how useful a change it was. I think that the Unison UI had some kind of option to do guided file merges, but it only worked for the usual simple line-oriented diff.
--e89a8f2348557bbd9204d7ad6a97-- From unknown Mon Jun 23 04:13:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13882: 24.2; saveplace.el limit drop least recently used Resent-From: Kevin Ryde Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Mar 2013 00:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Ian Dalton Cc: Karl Fogel , 13882@debbugs.gnu.org, Dmitry Gutov Received: via spool by 13882-submit@debbugs.gnu.org id=B13882.136304918727639 (code B ref 13882); Tue, 12 Mar 2013 00:47:02 +0000 Received: (at 13882) by debbugs.gnu.org; 12 Mar 2013 00:46:27 +0000 Received: from localhost ([127.0.0.1]:47077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFDMJ-0007Bj-22 for submit@debbugs.gnu.org; Mon, 11 Mar 2013 20:46:27 -0400 Received: from mailout1-15.pacific.net.au ([125.255.80.134]:45442 helo=mailout3-syd3.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFDMA-0007BU-Mx for 13882@debbugs.gnu.org; Mon, 11 Mar 2013 20:46:23 -0400 Received: from mailproxy3-syd3.pacific.net.au (mailproxy3-syd3.pacific.net.au [61.8.2.164]) by mailout3-syd3.pacific.net.au (Postfix) with ESMTP id 20B2837F7E2; Tue, 12 Mar 2013 11:45:19 +1100 (EST) Received: from blah.blah (unknown [203.26.175.175]) by mailproxy3-syd3.pacific.net.au (Postfix) with ESMTP id 7F69E5780A4; Tue, 12 Mar 2013 11:45:18 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.80) (envelope-from ) id 1UFDJj-0006UM-Ge; Tue, 12 Mar 2013 11:43:47 +1100 From: Kevin Ryde References: <87ip55608l.fsf@blah.blah> <874ngn5ioy.fsf@yandex.ru> <87a9qe52l6.fsf@kwarm.red-bean.com> <87zjyc3wbx.fsf@blah.blah> <87li9udi0o.fsf@floss.red-bean.com> <87y5dt8wbb.fsf@blah.blah> <87boapfvfy.fsf@kwarm.red-bean.com> Date: Tue, 12 Mar 2013 11:43:47 +1100 In-Reply-To: (Ian Dalton's message of "Mon, 11 Mar 2013 16:08:42 -0600") Message-ID: <87txoh8n24.fsf@blah.blah> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Ian Dalton writes: > > I no longer use this setup, so I don't know how useful a change it was. I > think that the Unison UI had some kind of option to do guided file merges, > but it only worked for the usual simple line-oriented diff. Hmm. Making the file line-wise probably helped, but I imagine there's no file format which could give the perfect result from the usual diff/patch contextual merges. How about keeping the line-by-line pretty print for everyone's readability, but drop the sort since it's actively harmful, and leave anything more for future thought. From unknown Mon Jun 23 04:13:46 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Kevin Ryde Subject: bug#13882: closed (Re: bug#13882: 24.2; saveplace.el limit drop least recently used) Message-ID: References: <87vc8vktxb.fsf@kwarm.red-bean.com> <87ip55608l.fsf@blah.blah> X-Gnu-PR-Message: they-closed 13882 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 13882@debbugs.gnu.org Date: Wed, 13 Mar 2013 19:01:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1363201262-28468-1" This is a multi-part message in MIME format... ------------=_1363201262-28468-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #13882: 24.2; saveplace.el limit drop least recently used which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 13882@debbugs.gnu.org. --=20 13882: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D13882 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1363201262-28468-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 13882-done) by debbugs.gnu.org; 13 Mar 2013 19:00:37 +0000 Received: from localhost ([127.0.0.1]:51845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFqui-0007OZ-OS for submit@debbugs.gnu.org; Wed, 13 Mar 2013 15:00:37 -0400 Received: from mail-ie0-f180.google.com ([209.85.223.180]:47433) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFque-0007OK-HD for 13882-done@debbugs.gnu.org; Wed, 13 Mar 2013 15:00:34 -0400 Received: by mail-ie0-f180.google.com with SMTP id bn7so1963414ieb.11 for <13882-done@debbugs.gnu.org>; Wed, 13 Mar 2013 11:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:reply-to:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=id/HYOaFpN+Xplsw0jymNTOE2jqCeREPB/gwOKBvN5w=; b=nEu6+hZEmtND7DR6nt1BrWQV1N7nm8WFMi08Hj0oiSRhtX8S8L1bpgaEwP5HZZYiA8 IQph6+GsNuWiHiBnVybq7UXHrTSogpvQFSevYbl0jW3Ajtfy3piOahsfpIycKfKEXKYw X/WVr+BISbM1kxa1np6o0clCOHi3aAM4CZ1TxFRmuQa0HWA1noT4ST1BhMKb7ZtOv68b 1uAkq9yWLzuz3HMNE35gUnCEoPayp6L6Jv48PMgLHo+YuOUNbKwRMcdwhk2urdrMHxmR YBzIERYr5jGh9ZjkpIUvVo1A5NYRUyMtyPebj40PfJn0Rsn5jCU83nIixbQMCrASZ8Nl We2Q== X-Received: by 10.50.220.170 with SMTP id px10mr17204081igc.61.1363201159996; Wed, 13 Mar 2013 11:59:19 -0700 (PDT) Received: from kwarm.red-bean.com (74-92-190-113-Illinois.hfc.comcastbusiness.net. [74.92.190.113]) by mx.google.com with ESMTPS id ih1sm4189322igc.3.2013.03.13.11.59.18 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 13 Mar 2013 11:59:18 -0700 (PDT) From: Karl Fogel To: Kevin Ryde Subject: Re: bug#13882: 24.2; saveplace.el limit drop least recently used References: <87ip55608l.fsf@blah.blah> <874ngn5ioy.fsf@yandex.ru> <87a9qe52l6.fsf@kwarm.red-bean.com> <87zjyc3wbx.fsf@blah.blah> <87li9udi0o.fsf@floss.red-bean.com> <87y5dt8wbb.fsf@blah.blah> <87boapfvfy.fsf@kwarm.red-bean.com> <87txoh8n24.fsf@blah.blah> Date: Wed, 13 Mar 2013 13:59:12 -0500 In-Reply-To: <87txoh8n24.fsf@blah.blah> (Kevin Ryde's message of "Tue, 12 Mar 2013 11:43:47 +1100") Message-ID: <87vc8vktxb.fsf@kwarm.red-bean.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13882-done Cc: Ian Dalton , 13882-done@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Karl Fogel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Kevin Ryde writes: >Ian Dalton writes: >> I no longer use this setup, so I don't know how useful a change it was. I >> think that the Unison UI had some kind of option to do guided file merges, >> but it only worked for the usual simple line-oriented diff. > >Hmm. Making the file line-wise probably helped, but I imagine there's >no file format which could give the perfect result from the usual >diff/patch contextual merges. > >How about keeping the line-by-line pretty print for everyone's >readability, but drop the sort since it's actively harmful, and leave >anything more for future thought. Done; see revision below. Thanks, Dmitry, Kevin, and Ian, for your thorough & patient explanations. ------------------------------------------------------------ revno: 112040 revision-id: kfogel@red-bean.com-20130313185405-ibq2um8vj55d4x0a parent: eggert@cs.ucla.edu-20130313184222-yq69wjnyhzd6o40d committer: Karl Fogel branch nick: trunk timestamp: Wed 2013-03-13 13:54:05 -0500 message: * saveplace.el (save-place-alist-to-file): Don't sort `save-place-alist', just pretty-print it (bug#13882). modified: lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432 lisp/saveplace.el saveplace.el-20091113204419-o5vbwnq5f7feedwu-622 ------------------------------------------------------------ -Karl ------------=_1363201262-28468-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 5 Mar 2013 20:51:05 +0000 Received: from localhost ([127.0.0.1]:33039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCypB-0004Rf-2C for submit@debbugs.gnu.org; Tue, 05 Mar 2013 15:51:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49589) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCyp2-0004RJ-C0 for submit@debbugs.gnu.org; Tue, 05 Mar 2013 15:50:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCyoZ-0006WZ-GT for submit@debbugs.gnu.org; Tue, 05 Mar 2013 15:50:25 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:53122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCyoZ-0006WV-De for submit@debbugs.gnu.org; Tue, 05 Mar 2013 15:50:23 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCyoW-0000Dq-K9 for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2013 15:50:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCyoN-0006TR-5H for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2013 15:50:20 -0500 Received: from mailout1-15.pacific.net.au ([125.255.80.134]:45483 helo=mailout3-syd3.pacific.net.au) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCyoM-0006S3-JF for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2013 15:50:11 -0500 Received: from mailproxy3-syd3.pacific.net.au (mailproxy3-syd3.pacific.net.au [61.8.2.164]) by mailout3-syd3.pacific.net.au (Postfix) with ESMTP id 3954C37F7FC for ; Wed, 6 Mar 2013 07:50:03 +1100 (EST) Received: from blah.blah (unknown [203.26.175.129]) by mailproxy3-syd3.pacific.net.au (Postfix) with ESMTP id D185D578085 for ; Wed, 6 Mar 2013 07:49:30 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.80) (envelope-from ) id 1UCynS-0003bT-N8 for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2013 07:49:14 +1100 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Subject: 24.2; saveplace.el limit drop least recently used Date: Wed, 06 Mar 2013 07:49:14 +1100 Message-ID: <87ip55608l.fsf@blah.blah> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) --=-=-= Content-Type: text/plain When saveplace.el reaches save-place-limit, the file positions retained via ~/.emacs-places are the first limit-many in alphabetical order. I hoped instead it would be the first limit-many most recently used. Ie. drop the least recently visited files in order to enforce the limit. I struck this when I reached my save-place-limit with lots of files I had visited long ago but which happened to be alphabetically before ones I was visiting now. The save-place feature no longer saved places across sessions for files I now visited. The effect can be seen by setting a small limit per init.el below. Then foo.el to visit three files successively HOME=`pwd` emacs -Q -l ./init.el -l ./foo.el This leaves .emacs-places (in the current directory due to faked $HOME) containing (("/tmp/aa" . 4) ("/tmp/bb" . 4) ("/tmp/cc" . 4)) Notice /tmp/cc was the most recently visited file but it's at the end of the list and will be truncated when load-save-place-alist-from-file enforces save-place-limit of 2. HOME=`pwd` emacs -Q -l ./init.el /tmp/cc => point is at start of buffer /tmp/cc I hoped it would be at the end from the last visit Note that you must exit and restart emacs to see the effect, because save-place-limit is only enforced by load-save-place-alist-from-file. Within a session there's no limit, only in reading the .emacs-places file on restarting emacs. I get some joy from not sorting save-place-alist when saving per change below. I believe save-place-to-alist keeps save-place-alist in "most recent first" order (by delq and re-push to move an existing entry to the start), and that that order should be preserved when saving. 2013-03-04 Kevin Ryde * saveplace.el (save-place-alist-to-file): Don't `sort' save-place-alist alphabetically, keep it in "most recent first" order. This ensures save-place-limit drops the least recently visited files, not the alphabetically last files. Dropping alphabetically last files had meant save-place stopped working across sessions after .emacs-places filled with alphabetically early names. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=init.el Content-Transfer-Encoding: quoted-printable (setq-default save-place t) (setq save-place-limit 2) (require 'saveplace) --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=foo.el Content-Transfer-Encoding: quoted-printable (progn (find-file "/tmp/aa") (insert "aa\n") (save-buffer) (kill-buffer) (find-file "/tmp/bb") (insert "bb\n") (save-buffer) (kill-buffer) (find-file "/tmp/cc") (insert "cc\n") (save-buffer) (kill-buffer) (kill-emacs)) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=saveplace.el.nosort.diff --- saveplace.el.orig 2013-03-04 17:06:20.000000000 +1100 +++ saveplace.el 2013-03-04 17:07:42.000000000 +1100 @@ -224,8 +224,7 @@ (symbol-name coding-system-for-write))) (let ((print-length nil) (print-level nil)) - (pp (sort save-place-alist - (lambda (a b) (string< (car a) (car b)))) + (pp save-place-alist ;; saved in order of most recently used (current-buffer))) (let ((version-control (cond --=-=-= Content-Type: text/plain In GNU Emacs 24.2.1 (i486-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-09-10 on biber, modified by Debian Configured using: `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.2/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default enable-multibyte-characters: t --=-=-=-- ------------=_1363201262-28468-1--