unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: David Biesack <David.Biesack@Apiture.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: "36877@debbugs.gnu.org" <36877@debbugs.gnu.org>
Subject: bug#36877: 25.3; uniquify renaway uniquify-managed list
Date: Wed, 25 Nov 2020 17:19:41 +0000	[thread overview]
Message-ID: <D230363B-2E7D-497B-8719-27A96E28C4FF@apiture.com> (raw)
In-Reply-To: <01B77E96-5A7F-4A38-A6DC-BA870B875330@apiture.com>

Note that this problem is still persisting for me, both in Emacs 26 and also in Emacs 27.1
which I just upgraded to.

I have implemented a workaround to the uniquify-managed list growing
Exponentially after using revert-buffer. See this patch

  *** /dev/fd/632020-11-25 12:18:39.000000000 -0500
--- /Users/david.biesack/emacs/uniqify.el2020-11-25 11:24:19.000000000 -0500
***************
*** 69,74 ****
--- 69,77 ----
  ;;   Stefan Monnier <monnier@cs.yale.edu> 17 Nov 2000
  ;; Algorithm and data structure changed to reduce consing with lots of buffers
  ;;   Francesco Potortì <pot@gnu.org> (ideas by rms and monnier) 2001-07-18
+ ;; Added workaround to uniqify-managed list growing exponentially
+ ;;   (underlying problem still exists tho)
+ ;;   DavidBiesack@gmail.com 25Nov20

  ;; Valuable feedback was provided by
  ;; Paul Smith <psmith@baynetworks.com>,
***************
*** 270,275 ****
--- 273,285 ----
  (defun uniquify-rationalize (fix-list)
    ;; Set up uniquify to re-rationalize after killing/renaming
    ;; if there is a conflict.
+
+   ;; When using revert-buffer, the uniquify-managed list grows exponentially;
+   ;; and there are many duplicates items in the list. So sort and remove dups first.
+   ;; (The real fix would be to find/repair whatever allows dups in the list,
+   ;; or use a hashtable instead.)
+   (setq fix-list (delete-dups (sort fix-list 'uniquify-item-greaterp)))
+
    (dolist (item fix-list)
      (with-current-buffer (uniquify-item-buffer item)
        ;; Refresh the dirnames and proposed names.

David Biesack | Vice President, API Platforms
David.Biesack@apiture.com | @davidbiesack <https://twitter.com/davidbiesack>




On 8/21/19, 8:47 AM, "David Biesack" <David.Biesack@Apiture.com> wrote:

    No, uniquify-after-kill-buffer-p is set to t in my session; no customization.

    David Biesack | Vice President, API Platforms
    David.Biesack@apiture.com | @davidbiesack <https://twitter.com/davidbiesack>





    On 8/20/19, 10:47 PM, "Noam Postavsky" <npostavs@gmail.com> wrote:

        David Biesack <David.Biesack@Apiture.com> writes:

        > Attached is a backtrace.
        > Let me know if there is other advice I can add to help track this down.

        The attachment seems to be missing.  But anyway, I have a simple
        reproducer now, so we don't need any more backtraces.  I found setting
        uniquify-after-kill-buffer-p to nil was needed to reproduce this, do you
        have that setting in your init?





Disclaimer: The information in this message may be proprietary and/or confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify Apiture immediately by replying to this message and deleting it from your computer.

  reply	other threads:[~2020-11-25 17:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 16:04 bug#36877: 25.3; uniquify renaway uniquify-managed list David Biesack
2019-08-09  0:47 ` Noam Postavsky
2019-08-09 15:58   ` David Biesack
2019-08-15 17:20     ` Noam Postavsky
2019-08-16 14:36       ` David Biesack
2019-08-18 17:51       ` Noam Postavsky
2019-08-20 15:07         ` David Biesack
2019-08-21  2:47           ` Noam Postavsky
2019-08-21 12:47             ` David Biesack
2020-11-25 17:19               ` David Biesack [this message]
2021-05-12 15:37                 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D230363B-2E7D-497B-8719-27A96E28C4FF@apiture.com \
    --to=david.biesack@apiture.com \
    --cc=36877@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).