unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: David Biesack <David.Biesack@Apiture.com>
Cc: "36877@debbugs.gnu.org" <36877@debbugs.gnu.org>
Subject: bug#36877: 25.3; uniquify renaway uniquify-managed list
Date: Thu, 15 Aug 2019 13:20:13 -0400	[thread overview]
Message-ID: <85d0h6l50y.fsf@gmail.com> (raw)
In-Reply-To: <80998773-A88F-4750-84EC-1E73171A399A@apiture.com> (David Biesack's message of "Fri, 9 Aug 2019 15:58:22 +0000")

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

>   uniquify-rationalize-file-buffer-names("index.html" "/Users/david.biesack/dev/developer.apiture.com/_site/docs/apis/workflow/v0.13.0/" #<buffer index.html>)
>   uniquify--create-file-buffer-advice(#[257 "\301!\211\302\230\203\f

Ah right, Emacs 25 still has that thing where it cuts off nthe pasted
text after NUL bytes.  For next time, saving the backtrace to a file and
attaching it should work better.

Looking at the fix-list in the backtrace, we have:

  [cl-struct-uniquify-item "index.html" "/Users/david.biesack/dev/developer.apiture.com/_site/docs/apis/workflow/v0.13.0" #<buffer index.html> nil]
  { ;; repeated 5 times...
  [cl-struct-uniquify-item "index.html" "/Users/david.biesack/dev/developer.apiture.com/_site/docs/apis/sample" #<buffer index.html<docs/apis/sample>> "index.html<docs/apis/sample>"]
  [cl-struct-uniquify-item "index.html" "/Users/david.biesack/dev/developer.apiture.com/_site/doc/apis/sample" #<buffer index.html<doc/apis/sample>> "index.html<doc/apis/sample>"]
  [cl-struct-uniquify-item "index.html" "/Users/david.biesack/dev/developer.apiture.com/_site/docs/apis/sample/sample" #<buffer index.html<sample/sample>> "index.html<sample/sample>"]
  [cl-struct-uniquify-item "index.html" "/Users/david.biesack/dev/developer.apiture.com" #<buffer index.html<developer.apiture.com>> "index.html<developer.apiture.com>"]
  [cl-struct-uniquify-item "index.html" "/Users/david.biesack/dev/developer.apiture.com/_site/docs/concepts" #<buffer index.html<concepts>> "index.html<concepts>"]
  }

I think that means the (dolist (buffer (buffer-list))...) somehow went
over #<buffer index.html<docs/apis/sample>> 5 times, or else that buffer
already had duplicates in its uniquify-managed list (i.e., this
backtrace triggerred "too late").

Did you add the advice in an ongoing session?  If yes, then it you
should clear out existing duplicates first, so we can catch a "fresh"
instance.  Evaluating the below should do:

    (let ((htable (make-hash-table :test 'equal)))
      (save-current-buffer
        (dolist (buf (buffer-list))
          (set-buffer buf)
          (when (cdr uniquify-managed)
            (clrhash htable)
            (dolist (item (cdr uniquify-managed))
              (puthash item t htable))
            (let ((managed nil))
              (maphash (lambda (k _v)
                         (push k managed))
                       htable)
              (push (car uniquify-managed) managed)
              (setq uniquify-managed managed))))))

If that backtrace was actually from a new session (that is, the advice
was added at the beginning of the session), then it means the problem is
coming from some other unexpected spot.





  reply	other threads:[~2019-08-15 17:20 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 [this message]
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
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=85d0h6l50y.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=36877@debbugs.gnu.org \
    --cc=David.Biesack@Apiture.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).