help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any way to control which articles Gnus summary shows by default?


From: Eric Abrahamsen
Subject: Re: Any way to control which articles Gnus summary shows by default?
Date: Fri, 06 Apr 2018 11:06:22 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> On 04/06/18 16:52 PM, Michael Heerdegen wrote:
>>> Michael Heerdegen <michael_heerdegen@web.de> writes:
>>>
>>>> I then opened my .gnus.registry.eieio (with "kate", if you care), and I
>>>> again saw some lines with "quote" corruption (you know what I mean).
>>>
>>> My impression is that the Gnus registry itself contains some hashtables
>>> as values, and the fix does only handle the top level hash values, while
>>> the quote problem persists for the sub-hashtables.
>>>
>>> Does that make sense?
>>
>> Thanks for the hint. I was setting the cleaned values for the subtables,
>> but not then re-setting the tables themselves: they were getting fixed,
>> then thrown away. I can't believe how long this is taking to get
>> right... I'll post to gnus.general again once I'm confident (ha) I've
>> got it fixed.
>
> Or maybe no, that's not what was happening. Does your quote corruption
> look like multiple nested "quote"s, or does it look more like "quote
> ("val" quote ("val" quote...", like that? It's probably a bug in the
> strip-quotes part of the fix.

Michael, would you give this new version a whirl (backup first,
obviously!)? For someone who writes as much lisp as I do, I'm actually
terrible at reasoning about list manipulation...

(defun gnus-registry-strip-quotes (lst)
  (let (acc)
    (when (consp lst)
      (while (eq (car lst) 'quote)
        (setq lst (cadr lst)))
      (while (consp lst)
        (if (eq (car lst) 'quote)
            (setq lst (cadr lst))
          (push (gnus-registry-strip-quotes (car lst)) acc)
          (setq lst (cdr lst)))))
    (nconc (nreverse (delete-dups 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))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]