From unknown Tue Jun 24 01:41:25 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4878: 23.1; linum mode fails to work with Rmail correctly Reply-To: mark.lillibridge@hp.com, 4878@debbugs.gnu.org Resent-From: Mark Lillibridge Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 06 Nov 2009 06:55:12 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 4878 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125749014816262 (code B ref -1); Fri, 06 Nov 2009 06:55:12 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 6 Nov 2009 06:49:08 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA66n5xN016259 for ; Thu, 5 Nov 2009 22:49:07 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6Id6-0007pw-CG for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 01:49:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6Id0-0007kf-Ge for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 01:49:02 -0500 Received: from [199.232.76.173] (port=37798 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6Id0-0007kL-8F for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 01:48:58 -0500 Received: from gundega.hpl.hp.com ([192.6.19.190]:62377) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N6Icz-00042p-Eo for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 01:48:58 -0500 Received: from mailhub-pa1.hpl.hp.com (mailhub-pa1.hpl.hp.com [15.25.115.25]) by gundega.hpl.hp.com (8.14.3/8.14.1/HPL-PA Relay) with ESMTP id nA66mlsR018020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 5 Nov 2009 22:48:47 -0800 (PST) Received: from ts-rhel4.hpl.hp.com (ts-rhel4.hpl.hp.com [15.25.118.24]) by mailhub-pa1.hpl.hp.com (8.14.3/8.14.3/HPL-PA Hub) with ESMTP id nA66mjiA019689; Thu, 5 Nov 2009 22:48:45 -0800 Date: Thu, 5 Nov 2009 22:48:45 -0800 Message-Id: <200911060648.nA66mjiA019689@mailhub-pa1.hpl.hp.com> From: Mark Lillibridge To: bug-gnu-emacs@gnu.org X-MailScanner-ID: nA66mlsR018020 X-HPL-MailScanner: Found to be clean X-HPL-MailScanner-From: mark.lillibridge@hp.com X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: [Emacs version 23.1 for Microsoft Windows, but should fail also for Linux, etc.] * Turn on linum mode via global-linum-mode * start Rmail. * use 'i' to open an existing Rmail file with multiple messages * type 'h' to open and go to the Rmail summary buffer * move between messages in the summary via the up and down arrows * observe that the associated Rmail buffer window shows the current message as you move around in the summary buffer, but its line numbers are not updated (BUG) I believe I understand the cause of this problem: linum.el relies on a post-command-hook to determine when to update a buffer: linum.el:79: (if linum-eager (add-hook 'post-command-hook (if linum-delay 'linum-schedule 'linum-update-current) nil t) (add-hook 'after-change-functions 'linum-after-change nil t)) linum.el:113: (defun linum-update-current () "Update line numbers for the current buffer." (linum-update (current-buffer))) (by default, linum-eager is t and linum-delay is nil). The Rmail summary buffer also relies on a post-command-hook to update the associated Rmail buffer: rmailsum.el:901: (defun rmail-summary-enable () (use-local-map rmail-summary-mode-map) (add-hook 'post-command-hook 'rmail-summary-rmail-update nil t) (setq revert-buffer-function 'rmail-update-summary)) When you type an arrow key in the Rmail summary buffer, rmail-summary-rmail-update updates the associated Rmail buffer; if linum-update-current runs afterwards (by default it seems to run before hand, but I manually made run afterwords via remove/add-hook), it updates the Rmail summary buffer but not the Rmail buffer itself. Linum seems to incorrectly assume that no command ever modifies any buffer other than the current one, which is definitely false in this case. As an attempted fix, I added the linum after-change-functions hook to the Rmail buffer. This also failed to solve the problem, presumably because changing the currently displayed message only involves altering the restriction, not changing the buffer itself. Since I am guessing Rmail is not the only subsystem where one command alters a different buffer or only changes a restriction in a different buffer, linum should be fixed rather than Rmail. The safest solution is probably to have linum-update-current just update all buffers. This strikes me as expensive if there are a lot of buffers, so maybe you can find a better solution. - Mark If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file c:/Program Files (x86)/Emacs/etc/DEBUG for instructions. In GNU Emacs 23.1.1 (i386-mingw-nt6.0.6002) of 2009-07-29 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 6.0.6002 configured using `configure --with-gcc (4.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENU value of $XMODIFIERS: nil locale-coding-system: cp1252 default-enable-multibyte-characters: t Major mode: RMAIL Summary Minor modes in effect: global-linum-mode: t linum-mode: t delete-selection-mode: t pc-selection-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: v C-h v C-x o C-x o C-x 1 . n n n n p p p p p n n : C-y C-x o C-x o C-x o t t t t t t t t SPC SPC SPC SPC SPC SPC SPC \ SPC SPC C-h a h o o k C-h ? d h o o k C-x 1 C-x b C-h d h o o k s C-x 1 C-h f n a r r o w r e C-h v C-S-g x v c e r s e r s x r e p o r Recent messages: Showing message 7 Showing message 7...done Type C-x 1 to remove help window. Making completion list... Type C-x 1 to delete the help window. Quit GNU Emacs 23.1.1 (i386-mingw-nt6.0.6002) of 2009-07-29 on SOFT-MJASON Showing message 7 Showing message 7...done Making completion list... From unknown Tue Jun 24 01:41:25 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: mark.lillibridge@hp.com Subject: bug#4878 closed by Chong Yidong (Re: 23.1; linum mode fails to work with Rmail correctly) Message-ID: References: <87k4y2p5mi.fsf@stupidchicken.com> <200911060648.nA66mjiA019689@mailhub-pa1.hpl.hp.com> X-Emacs-PR-Message: they-closed 4878 X-Emacs-PR-Package: emacs Reply-To: 4878@debbugs.gnu.org Date: Sat, 07 Nov 2009 18:15:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1257617704-20669-1" This is a multi-part message in MIME format... ------------=_1257617704-20669-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #4878: 23.1; linum mode fails to work with Rmail correctly It has been closed by Chong Yidong . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Chong Yidong by replying to this email. --=20 4878: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D4878 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1257617704-20669-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 4878-done) by emacsbugs.donarmstrong.com; 7 Nov 2009 18:11:25 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.4 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pantheon-po44.its.yale.edu (pantheon-po44.its.yale.edu [130.132.50.78]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA7IBNll020053 for <4878-done@emacsbugs.donarmstrong.com>; Sat, 7 Nov 2009 10:11:24 -0800 Received: from furry (dhcp128036014244.central.yale.edu [128.36.14.244]) (authenticated bits=0) by pantheon-po44.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id nA7IBHPx029175 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 7 Nov 2009 13:11:17 -0500 Received: by furry (Postfix, from userid 1000) id BB093C070; Sat, 7 Nov 2009 13:11:17 -0500 (EST) From: Chong Yidong To: Mark Lillibridge Cc: 4878-done@debbugs.gnu.org Subject: Re: 23.1; linum mode fails to work with Rmail correctly Date: Sat, 07 Nov 2009 13:11:17 -0500 Message-ID: <87k4y2p5mi.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) > Since I am guessing Rmail is not the only subsystem where one command > alters a different buffer or only changes a restriction in a different > buffer, linum should be fixed rather than Rmail. The safest solution > is probably to have linum-update-current just update all buffers. > This strikes me as expensive if there are a lot of buffers, so maybe > you can find a better solution. I think this is enough of a corner case that we can patch up Rmail to call linum-update specially (we can reconsider if more such cases pop up). I've checked such a fix into CVS. Thanks for the bug report. ------------=_1257617704-20669-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 6 Nov 2009 06:49:08 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA66n5xN016259 for ; Thu, 5 Nov 2009 22:49:07 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6Id6-0007pw-CG for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 01:49:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6Id0-0007kf-Ge for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 01:49:02 -0500 Received: from [199.232.76.173] (port=37798 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6Id0-0007kL-8F for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 01:48:58 -0500 Received: from gundega.hpl.hp.com ([192.6.19.190]:62377) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N6Icz-00042p-Eo for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 01:48:58 -0500 Received: from mailhub-pa1.hpl.hp.com (mailhub-pa1.hpl.hp.com [15.25.115.25]) by gundega.hpl.hp.com (8.14.3/8.14.1/HPL-PA Relay) with ESMTP id nA66mlsR018020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 5 Nov 2009 22:48:47 -0800 (PST) Received: from ts-rhel4.hpl.hp.com (ts-rhel4.hpl.hp.com [15.25.118.24]) by mailhub-pa1.hpl.hp.com (8.14.3/8.14.3/HPL-PA Hub) with ESMTP id nA66mjiA019689; Thu, 5 Nov 2009 22:48:45 -0800 Date: Thu, 5 Nov 2009 22:48:45 -0800 Message-Id: <200911060648.nA66mjiA019689@mailhub-pa1.hpl.hp.com> From: Mark Lillibridge To: bug-gnu-emacs@gnu.org Subject: 23.1; linum mode fails to work with Rmail correctly Reply-to: mark.lillibridge@hp.com X-MailScanner-ID: nA66mlsR018020 X-HPL-MailScanner: Found to be clean X-HPL-MailScanner-From: mark.lillibridge@hp.com X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: [Emacs version 23.1 for Microsoft Windows, but should fail also for Linux, etc.] * Turn on linum mode via global-linum-mode * start Rmail. * use 'i' to open an existing Rmail file with multiple messages * type 'h' to open and go to the Rmail summary buffer * move between messages in the summary via the up and down arrows * observe that the associated Rmail buffer window shows the current message as you move around in the summary buffer, but its line numbers are not updated (BUG) I believe I understand the cause of this problem: linum.el relies on a post-command-hook to determine when to update a buffer: linum.el:79: (if linum-eager (add-hook 'post-command-hook (if linum-delay 'linum-schedule 'linum-update-current) nil t) (add-hook 'after-change-functions 'linum-after-change nil t)) linum.el:113: (defun linum-update-current () "Update line numbers for the current buffer." (linum-update (current-buffer))) (by default, linum-eager is t and linum-delay is nil). The Rmail summary buffer also relies on a post-command-hook to update the associated Rmail buffer: rmailsum.el:901: (defun rmail-summary-enable () (use-local-map rmail-summary-mode-map) (add-hook 'post-command-hook 'rmail-summary-rmail-update nil t) (setq revert-buffer-function 'rmail-update-summary)) When you type an arrow key in the Rmail summary buffer, rmail-summary-rmail-update updates the associated Rmail buffer; if linum-update-current runs afterwards (by default it seems to run before hand, but I manually made run afterwords via remove/add-hook), it updates the Rmail summary buffer but not the Rmail buffer itself. Linum seems to incorrectly assume that no command ever modifies any buffer other than the current one, which is definitely false in this case. As an attempted fix, I added the linum after-change-functions hook to the Rmail buffer. This also failed to solve the problem, presumably because changing the currently displayed message only involves altering the restriction, not changing the buffer itself. Since I am guessing Rmail is not the only subsystem where one command alters a different buffer or only changes a restriction in a different buffer, linum should be fixed rather than Rmail. The safest solution is probably to have linum-update-current just update all buffers. This strikes me as expensive if there are a lot of buffers, so maybe you can find a better solution. - Mark If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file c:/Program Files (x86)/Emacs/etc/DEBUG for instructions. In GNU Emacs 23.1.1 (i386-mingw-nt6.0.6002) of 2009-07-29 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 6.0.6002 configured using `configure --with-gcc (4.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENU value of $XMODIFIERS: nil locale-coding-system: cp1252 default-enable-multibyte-characters: t Major mode: RMAIL Summary Minor modes in effect: global-linum-mode: t linum-mode: t delete-selection-mode: t pc-selection-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: v C-h v C-x o C-x o C-x 1 . n n n n p p p p p n n : C-y C-x o C-x o C-x o t t t t t t t t SPC SPC SPC SPC SPC SPC SPC \ SPC SPC C-h a h o o k C-h ? d h o o k C-x 1 C-x b C-h d h o o k s C-x 1 C-h f n a r r o w r e C-h v C-S-g x v c e r s e r s x r e p o r Recent messages: Showing message 7 Showing message 7...done Type C-x 1 to remove help window. Making completion list... Type C-x 1 to delete the help window. Quit GNU Emacs 23.1.1 (i386-mingw-nt6.0.6002) of 2009-07-29 on SOFT-MJASON Showing message 7 Showing message 7...done Making completion list... ------------=_1257617704-20669-1--