Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH] Make saving and restoring of hidden threads work with overlays.
@ 2010-07-30 16:47 Lawrence Mitchell
  2010-08-03 18:52 ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Lawrence Mitchell @ 2010-07-30 16:47 UTC (permalink / raw)
  To: ding

* gnus-sum.el (gnus-hidden-threads-configuration)
(gnus-restore-hidden-threads-configuration): Update to deal with text
properties, rather than searching for a magic character.
---
 lisp/ChangeLog   |    6 ++++++
 lisp/gnus-sum.el |   12 ++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

Hi there,

34d3c95 broke usage of gnus-save-hidden-threads, notably when
attempting to fetch a thread's parent.  Example:

Enter a group with multiple collapsed threads.

Select an article with a parent you wish to fetch.

Hit '^'.

Note how all threads are left expanded, rather than being hidden
again.  This is because gnus-hidden-threads-configuration and
gnus-restore-hidden-threads-configuration have not been updated
to deal with the 'gnus-sum 'invisible overlay.

The patch below fixes things for me.

Cheers,
Lawrence

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bbf42d3..1726429 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-30  Lawrence Mitchell  <wence@gmx.li>
+
+	* gnus-sum.el (gnus-hidden-threads-configuration)
+	(gnus-restore-hidden-threads-configuration): Update to deal with text
+	properties, rather than searching for a magic character.
+
 2010-07-30  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* nnmail.el (nnmail-get-new-mail-1): Encode group names possibly
diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el
index 93024e0..53a2470 100644
--- a/lisp/gnus-sum.el
+++ b/lisp/gnus-sum.el
@@ -3406,8 +3406,10 @@ marks of articles."
   (save-excursion
     (let (config)
       (goto-char (point-min))
-      (while (search-forward "\r" nil t)
-	(push (1- (point)) config))
+      (while (not (eobp))
+        (when (eq (get-char-property (point-at-eol) 'invisible) 'gnus-sum)
+          (push (save-excursion (forward-line 0) (point)) config))
+        (forward-line 1))
       config)))
 
 (defun gnus-restore-hidden-threads-configuration (config)
@@ -3415,10 +3417,8 @@ marks of articles."
   (save-excursion
     (let (point (inhibit-read-only t))
       (while (setq point (pop config))
-	(when (and (< point (point-max))
-		   (goto-char point)
-		   (eq (char-after) ?\n))
-	  (subst-char-in-region point (1+ point) ?\n ?\r))))))
+        (goto-char point)
+        (gnus-summary-hide-thread)))))
 
 ;; Various summary mode internalish functions.
 
-- 
1.7.2.1.6.g61bf12




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-12 20:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-30 16:47 [PATCH] Make saving and restoring of hidden threads work with overlays Lawrence Mitchell
2010-08-03 18:52 ` Ted Zlatanov
2010-08-04  1:12   ` Katsumi Yamaoka
2010-08-12 20:47     ` Ted Zlatanov
2010-08-04  8:23   ` Lawrence Mitchell
2010-08-04 11:08     ` Tassilo Horn

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).