Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Heads up: Gnus registry breakage on Emacs development versions
@ 2018-03-25  8:15 Eric Abrahamsen
  0 siblings, 0 replies; only message in thread
From: Eric Abrahamsen @ 2018-03-25  8:15 UTC (permalink / raw)
  To: ding; +Cc: info-gnus-english

Hi folks,

If you've been running Emacs from the development version of master or
the Emacs 26 branch over the past few months, and you're using the
registry, your registry has probably been corrupted by some bugs in the
way EIEIO objects are persisted to disk.

To know if you're affected, look at your gnus.registry.eieio file, and
see if the hash table values there are wrapped in huge numbers of
quotes: it may look like actual calls to `quote', or it may look like
piles of apostrophes. A single `quote' is normal.

The problem is now fixed in both master and emacs-26, so if you're using
a dev version of Emacs, please pull and re-build. After you've done
that, load the following code, and call M-x gnus-registry-fixit to fix
your registry.

Sorry!

Eric

#+begin_elisp
(defun gnus-registry-strip-quotes (lst)
  (let (acc)
    (when (consp lst)
      (while (eq (car lst) 'quote)
	(setq lst (cadr lst)))
      (while (consp lst)
	(push (gnus-registry-strip-quotes (car lst)) acc)
	(setq lst (cdr lst))))
    (nconc (nreverse acc)
	   lst)))

(defun gnus-registry-fixit ()
  "Fix Gnus registry after eieio-persistent patches.
For use with Emacs master branch, after installing 0afb43eeb, or
the 26 branch, after daa9e853bd."
  (interactive)
  (unless (gnus-alive-p)
    (gnus))
  (when gnus-registry-enabled
    (with-slots (tracker data) gnus-registry-db
      (maphash
       (lambda (track-sym hsh)
	 (maphash
	  (lambda (k v)
	    (setf (gethash k hsh)
		  (gnus-registry-strip-quotes v)))
	  hsh))
       tracker)
      (maphash
       (lambda (k v)
	 (setf (gethash k data) (gnus-registry-strip-quotes v)))
       data))))
#+end_elisp




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-25  8:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-25  8:15 Heads up: Gnus registry breakage on Emacs development versions Eric Abrahamsen

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 NNTP newsgroup(s).