From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/69851 Path: news.gmane.org!not-for-mail From: Lawrence Mitchell Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Make saving and restoring of hidden threads work with overlays. Date: Fri, 30 Jul 2010 17:47:49 +0100 Message-ID: <87eiekor0q.fsf@gmx.li> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1280616792 10417 80.91.229.12 (31 Jul 2010 22:53:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 31 Jul 2010 22:53:12 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M18239@lists.math.uh.edu Sun Aug 01 00:53:11 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OfKvT-0006hZ-II for ding-account@gmane.org; Sun, 01 Aug 2010 00:53:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1OfKtZ-0007Jt-Gc; Sat, 31 Jul 2010 17:51:09 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1OeskR-0007zD-84 for ding@lists.math.uh.edu; Fri, 30 Jul 2010 11:47:51 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1OeskO-0007WJ-L4 for ding@lists.math.uh.edu; Fri, 30 Jul 2010 11:47:50 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1OeskN-0007Mv-00 for ; Fri, 30 Jul 2010 18:47:47 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OeskM-000051-4o for ding@gnus.org; Fri, 30 Jul 2010 18:47:46 +0200 Original-Received: from e4300lm.epcc.ed.ac.uk ([129.215.63.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 30 Jul 2010 18:47:46 +0200 Original-Received: from wence by e4300lm.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 30 Jul 2010 18:47:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 75 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: e4300lm.epcc.ed.ac.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:Bs6pvQXQ0807rXinhx6XBh4uZO8= X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:69851 Archived-At: * 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 + + * 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 * 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