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

* Re: [PATCH] Make saving and restoring of hidden threads work with overlays.
  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-04  8:23   ` Lawrence Mitchell
  0 siblings, 2 replies; 6+ messages in thread
From: Ted Zlatanov @ 2010-08-03 18:52 UTC (permalink / raw)
  To: ding

On Fri, 30 Jul 2010 17:47:49 +0100 Lawrence Mitchell <wence@gmx.li> wrote: 

LM> * gnus-sum.el (gnus-hidden-threads-configuration)
LM> (gnus-restore-hidden-threads-configuration): Update to deal with text
LM> properties, rather than searching for a magic character.

Thank you for your contribution.  It's a small change so I don't believe
you need papers on file.  Can someone please test this against XEmacs?

Thanks
Ted




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

* Re: [PATCH] Make saving and restoring of hidden threads work with overlays.
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2010-08-04  1:12 UTC (permalink / raw)
  To: ding

Ted Zlatanov wrote:
> On Fri, 30 Jul 2010 17:47:49 +0100 Lawrence Mitchell <wence@gmx.li> wrote:

LM> * gnus-sum.el (gnus-hidden-threads-configuration)
LM> (gnus-restore-hidden-threads-configuration): Update to deal with text
LM> properties, rather than searching for a magic character.

> Thank you for your contribution.  It's a small change so I don't believe
> you need papers on file.  Can someone please test this against XEmacs?

Tested it with XEmacs briefly.  Works fine (the hidden thread is
left hidden).



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

* Re: [PATCH] Make saving and restoring of hidden threads work with overlays.
  2010-08-03 18:52 ` Ted Zlatanov
  2010-08-04  1:12   ` Katsumi Yamaoka
@ 2010-08-04  8:23   ` Lawrence Mitchell
  2010-08-04 11:08     ` Tassilo Horn
  1 sibling, 1 reply; 6+ messages in thread
From: Lawrence Mitchell @ 2010-08-04  8:23 UTC (permalink / raw)
  To: ding

Ted Zlatanov wrote:
> On Fri, 30 Jul 2010 17:47:49 +0100 Lawrence Mitchell <wence@gmx.li> wrote:

> LM> * gnus-sum.el (gnus-hidden-threads-configuration)
> LM> (gnus-restore-hidden-threads-configuration): Update to deal with text
> LM> properties, rather than searching for a magic character.

> Thank you for your contribution.  It's a small change so I don't believe
> you need papers on file.  Can someone please test this against XEmacs?

FWIW, I have papers on file for Emacs.  I don't know if that
covers contributions to Gnus though.

Cheers,
Lawrence
-- 
Lawrence Mitchell <wence@gmx.li>




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

* Re: [PATCH] Make saving and restoring of hidden threads work with overlays.
  2010-08-04  8:23   ` Lawrence Mitchell
@ 2010-08-04 11:08     ` Tassilo Horn
  0 siblings, 0 replies; 6+ messages in thread
From: Tassilo Horn @ 2010-08-04 11:08 UTC (permalink / raw)
  To: ding; +Cc: Lawrence Mitchell

On Wednesday 04 August 2010 10:23:47 Lawrence Mitchell wrote:

> > Thank you for your contribution.  It's a small change so I don't
> > believe you need papers on file.  Can someone please test this
> > against XEmacs?
> 
> FWIW, I have papers on file for Emacs.  I don't know if that covers
> contributions to Gnus though.

Because Gnus is (also) a part of Emacs, contributions to it are covered.

Bye,
Tassilo



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

* Re: [PATCH] Make saving and restoring of hidden threads work with overlays.
  2010-08-04  1:12   ` Katsumi Yamaoka
@ 2010-08-12 20:47     ` Ted Zlatanov
  0 siblings, 0 replies; 6+ messages in thread
From: Ted Zlatanov @ 2010-08-12 20:47 UTC (permalink / raw)
  To: ding

On Wed, 04 Aug 2010 10:12:59 +0900 Katsumi Yamaoka <yamaoka@jpl.org> wrote: 

KY> Ted Zlatanov wrote:
>> On Fri, 30 Jul 2010 17:47:49 +0100 Lawrence Mitchell <wence@gmx.li> wrote:

LM> * gnus-sum.el (gnus-hidden-threads-configuration)
LM> (gnus-restore-hidden-threads-configuration): Update to deal with text
LM> properties, rather than searching for a magic character.

>> Thank you for your contribution.  It's a small change so I don't believe
>> you need papers on file.  Can someone please test this against XEmacs?

KY> Tested it with XEmacs briefly.  Works fine (the hidden thread is
KY> left hidden).

I comitted this today.

Ted




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