From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.bugs Subject: bug#5324: 23.1.90; Selective display in Gnus summary broken Date: Tue, 05 Jan 2010 21:41:39 +0100 Message-ID: References: Reply-To: Andreas Schwab , 5324@debbugs.gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1262735778 14023 80.91.229.12 (5 Jan 2010 23:56:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Jan 2010 23:56:18 +0000 (UTC) Cc: ding@gnus.org To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 06 00:56:10 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NSJFt-00077x-HT for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jan 2010 00:56:10 +0100 Original-Received: from localhost ([127.0.0.1]:48196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSJE6-0007IZ-3l for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jan 2010 18:54:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSGKu-0005Sm-73 for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2010 15:49:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSGKo-0005JU-Ho for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2010 15:49:03 -0500 Original-Received: from [199.232.76.173] (port=39625 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSGKo-0005JF-Cf for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2010 15:48:58 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46168) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NSGKn-0008Pf-Jt for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2010 15:48:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NSGE5-00077I-Qf; Tue, 05 Jan 2010 15:42:01 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: Andreas Schwab , 5324@debbugs.gnu.org Resent-From: Andreas Schwab Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Jan 2010 20:42:01 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: report 5324 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@debbugs.gnu.org id=B.126272411227345 (code B ref -1); Tue, 05 Jan 2010 20:42:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Jan 2010 20:41:52 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSGDw-00076z-0C for submit@debbugs.gnu.org; Tue, 05 Jan 2010 15:41:52 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSGDu-00076u-0o for submit@debbugs.gnu.org; Tue, 05 Jan 2010 15:41:50 -0500 Original-Received: from mx10.gnu.org ([199.232.76.166]:47155) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NSGDp-0003tF-R1 for emacs-pretest-bug@gnu.org; Tue, 05 Jan 2010 15:41:45 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NSGDo-0005fk-An for emacs-pretest-bug@gnu.org; Tue, 05 Jan 2010 15:41:45 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.9]:40331) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSGDn-0005fQ-O0 for emacs-pretest-bug@gnu.org; Tue, 05 Jan 2010 15:41:44 -0500 Original-Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 262741C15558; Tue, 5 Jan 2010 21:41:40 +0100 (CET) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id C2E2D90073; Tue, 5 Jan 2010 21:41:40 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.3.149]) by localhost (dynscan1.mnet-online.de [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id v2v9dG35fgwV; Tue, 5 Jan 2010 21:41:39 +0100 (CET) Original-Received: from igel.home (DSL01.83.171.163.130.ip-pool.NEFkom.net [83.171.163.130]) by mail.mnet-online.de (Postfix) with ESMTP; Tue, 5 Jan 2010 21:41:39 +0100 (CET) Original-Received: by igel.home (Postfix, from userid 501) id 9BFE4CA28C; Tue, 5 Jan 2010 21:41:39 +0100 (CET) X-Yow: I like the IMPUDENT NOSE on that car.. Are you a TEEN-AGER? In-Reply-To: (Andreas Schwab's message of "Mon, 21 Dec 2009 17:59:17 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.6 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -6.6 (------) Resent-Date: Tue, 05 Jan 2010 15:42:01 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:33963 Archived-At: I have now checked this patch into the emacs repo to fix the bug. Andreas. 2010-01-05 Andreas Schwab * gnus-sum.el (gnus-forward-line-ignore-invisible): New function. (gnus-summary-recenter): Use it instead of forward-line. (Bug#5257) === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-01-04 05:35:18 +0000 +++ lisp/gnus/gnus-sum.el 2010-01-05 20:29:46 +0000 @@ -6727,6 +6727,26 @@ Also do horizontal recentering." (put 'gnus-recenter 'isearch-scroll t) +(defun gnus-forward-line-ignore-invisible (n) + "Move N lines forward (backward if N is negative). +Like forward-line, but skip over (and don't count) invisible lines." + (let (done) + (while (and (> n 0) (not done)) + ;; If the following character is currently invisible, + ;; skip all characters with that same `invisible' property value. + (while (invisible-p (point)) + (goto-char (next-char-property-change (point)))) + (forward-line 1) + (if (eobp) + (setq done t) + (setq n (1- n)))) + (while (and (< n 0) (not done)) + (forward-line -1) + (if (bobp) (setq done t) + (setq n (1+ n)) + (while (and (not (bobp)) (invisible-p (1- (point)))) + (goto-char (previous-char-property-change (point)))))))) + (defun gnus-summary-recenter () "Center point in the summary window. If `gnus-auto-center-summary' is nil, or the article buffer isn't @@ -6742,16 +6762,19 @@ displayed, no centering will be performe gnus-auto-center-summary (/ (1- (window-height)) 2))))) (height (1- (window-height))) - (bottom (save-excursion (goto-char (point-max)) - (forward-line (- height)) - (point))) + (bottom (save-excursion + (goto-char (point-max)) + (gnus-forward-line-ignore-invisible (- height)) + (point))) (window (get-buffer-window (current-buffer)))) (when (get-buffer-window gnus-article-buffer) ;; Only do recentering when the article buffer is displayed, ;; Set the window start to either `bottom', which is the biggest ;; possible valid number, or the second line from the top, ;; whichever is the least. - (let ((top-pos (save-excursion (forward-line (- top)) (point)))) + (let ((top-pos (save-excursion + (gnus-forward-line-ignore-invisible (- top)) + (point)))) (if (> bottom top-pos) ;; Keep the second line from the top visible (set-window-start window top-pos) @@ -6760,12 +6783,12 @@ displayed, no centering will be performe ;; visible, or revert to using TOP-POS. (save-excursion (goto-char (point-max)) - (forward-line -1) + (gnus-forward-line-ignore-invisible -1) (let ((last-line-start (point))) (goto-char bottom) (set-window-start window (point) t) (when (not (pos-visible-in-window-p last-line-start window)) - (forward-line 1) + (gnus-forward-line-ignore-invisible 1) (set-window-start window (min (point) top-pos) t))))))) ;; Do horizontal recentering while we're at it. (when (and (get-buffer-window (current-buffer) t) -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."