GNU bug report logs - #36877
25.3; uniquify renaway uniquify-managed list

Previous Next

Package: emacs;

Reported by: David Biesack <David.Biesack <at> Apiture.com>

Date: Wed, 31 Jul 2019 16:08:04 UTC

Severity: normal

Tags: fixed, patch

Found in version 25.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: David Biesack <David.Biesack <at> Apiture.com>
Cc: "36877 <at> debbugs.gnu.org" <36877 <at> debbugs.gnu.org>
Subject: bug#36877: 25.3; uniquify renaway uniquify-managed list
Date: Thu, 15 Aug 2019 13:20:13 -0400
David Biesack <David.Biesack <at> 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.




This bug report was last modified 4 years and 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.