From bojohan+mail@dd.chalmers.se Tue Aug 19 12:29:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.1 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 19 Aug 2008 19:29:51 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7JJTl81010959 for ; Tue, 19 Aug 2008 12:29:49 -0700 Received: from mx10.gnu.org ([199.232.76.166]:50097) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KVWsW-0007K0-9u for emacs-pretest-bug@gnu.org; Tue, 19 Aug 2008 15:28:28 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KVWtj-0002nO-6T for emacs-pretest-bug@gnu.org; Tue, 19 Aug 2008 15:29:46 -0400 Received: from atum.ita.chalmers.se ([129.16.4.148]:33445) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KVWti-0002ms-Sx for emacs-pretest-bug@gnu.org; Tue, 19 Aug 2008 15:29:43 -0400 Received: from remote5.student.chalmers.se (remote5.student.chalmers.se [129.16.29.83]) by atum.ita.chalmers.se (Postfix) with ESMTP id 5EDB61D24D for ; Tue, 19 Aug 2008 21:29:39 +0200 (CEST) Received: by remote5.student.chalmers.se (Postfix, from userid 61540) id 5282E2005C; Tue, 19 Aug 2008 21:29:39 +0200 (CEST) From: bojohan+mail@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) To: emacs-pretest-bug@gnu.org Subject: 23.0.60; linum-mode margin display wrong Date: Tue, 19 Aug 2008 21:29:39 +0200 Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) $ emacs -Q -eval '(progn (linum-mode 1) (insert-char ?\n 100) (goto-line 12= ) (redisplay) (kill-line 10))' The numbering in the margin of the first lines looks like: | | | | | | | | | 1| 1| 1| 13| 14| ... The first 12 lines have a display margin string that is 3 characters long (space padded), but the margin is only 2 columns wide, so the last digit is lost. --=20 Johan Bockg=C3=A5rd From cyd@stupidchicken.com Wed Aug 20 15:26:29 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.5 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 743) by emacsbugs.donarmstrong.com; 20 Aug 2008 22:26:29 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7KMQQYi005482 for <743@emacsbugs.donarmstrong.com>; Wed, 20 Aug 2008 15:26:27 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 1643457E32F; Wed, 20 Aug 2008 18:27:40 -0400 (EDT) To: Markus Triska Cc: 743@debbugs.gnu.org Subject: Re: 23.0.60; linum-mode margin display wrong From: Chong Yidong Date: Wed, 20 Aug 2008 18:27:40 -0400 Message-ID: <87ej4js4o3.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hi Markus, Could you try to debug this? I'm not sure if it's a linum.el bug or a redisplay bug. > $ emacs -Q -eval '(progn (linum-mode 1) (insert-char ?\n 100) (goto-line 12) (redisplay) (kill-line 10))' > > The numbering in the margin of the first lines looks like: > > | > | > | > | > | > | > | > | > | > 1| > 1| > 1| > 13| > 14| > ... > > The first 12 lines have a display margin string that is 3 characters > long (space padded), but the margin is only 2 columns wide, so the last > digit is lost. From markus.triska@gmx.at Wed Aug 20 22:16:47 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.2 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 743) by emacsbugs.donarmstrong.com; 21 Aug 2008 05:16:47 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m7L5GgkV005853 for <743@emacsbugs.donarmstrong.com>; Wed, 20 Aug 2008 22:16:44 -0700 Received: (qmail invoked by alias); 21 Aug 2008 05:16:36 -0000 Received: from v254-118.vps.tuwien.ac.at (EHLO v254-118.vps.tuwien.ac.at) [128.131.254.118] by mail.gmx.net (mp064) with SMTP; 21 Aug 2008 07:16:36 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX19z5Khhoz5zPK68i+KmYp7lXOsmlMjvq/Zn2a9Tpr 25qcbxWkt1pnU8 Received: by mt-computer.local (Postfix, from userid 502) id 33D6FA37DAB; Thu, 21 Aug 2008 01:16:31 -0400 (EDT) From: Markus Triska To: Chong Yidong Cc: 743@debbugs.gnu.org Subject: Re: 23.0.60; linum-mode margin display wrong References: <87ej4js4o3.fsf@cyd.mit.edu> Date: Thu, 21 Aug 2008 01:16:31 -0400 In-Reply-To: <87ej4js4o3.fsf@cyd.mit.edu> (Chong Yidong's message of "Wed, 20 Aug 2008 18:27:40 -0400") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.79 Chong Yidong writes: > Could you try to debug this? I'm not sure if it's a linum.el bug or a > redisplay bug. I cannot reproduce this when I add "-nw". Does that help? From markus.triska@gmx.at Thu Aug 21 05:16:25 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 743) by emacsbugs.donarmstrong.com; 21 Aug 2008 12:16:26 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m7LCGLJq010234 for <743@emacsbugs.donarmstrong.com>; Thu, 21 Aug 2008 05:16:22 -0700 Received: (qmail invoked by alias); 21 Aug 2008 12:16:15 -0000 Received: from host.225.229.mtl.residential.vdn.ca (EHLO mt-computer.vdn.ca) [206.223.225.229] by mail.gmx.net (mp014) with SMTP; 21 Aug 2008 14:16:15 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX19ij+QZ+pxiC3Tr2Wn6Fyu1kpPzw3DTFOk5XUEOPZ nyO0xDNfADd5WI Received: by mt-computer.local (Postfix, from userid 502) id ED819A37EC5; Thu, 21 Aug 2008 08:16:09 -0400 (EDT) From: Markus Triska To: Chong Yidong Cc: 743@debbugs.gnu.org Subject: Re: 23.0.60; linum-mode margin display wrong References: <87ej4js4o3.fsf@cyd.mit.edu> Date: Thu, 21 Aug 2008 08:16:09 -0400 In-Reply-To: (Markus Triska's message of "Thu, 21 Aug 2008 01:16:31 -0400") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.85 > I cannot reproduce this when I add "-nw". I've now found a similar problem that occurs with "-nw" - this is definitely a linum.el problem, and I will provide a fix soon. From markus.triska@gmx.at Thu Aug 21 18:49:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.5 required=4.0 tests=AWL,BAYES_00,FVGT_m_MULTI_ODD, IMPRONONCABLE_2,MURPHY_DRUGS_REL8 autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 743) by emacsbugs.donarmstrong.com; 22 Aug 2008 01:49:17 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m7M1nCi8010713 for <743@emacsbugs.donarmstrong.com>; Thu, 21 Aug 2008 18:49:14 -0700 Received: (qmail invoked by alias); 22 Aug 2008 01:49:07 -0000 Received: from host.225.229.mtl.residential.vdn.ca (EHLO mt-computer.vdn.ca) [206.223.225.229] by mail.gmx.net (mp033) with SMTP; 22 Aug 2008 03:49:07 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX19GUj4hTkBGnvE1CHVQ/jhBSmZ8xXVLDNpN1lj5Bf VBRbX05SbNZQ34 Received: by mt-computer.vdn.ca (Postfix, from userid 502) id CDE35A3874E; Thu, 21 Aug 2008 21:49:00 -0400 (EDT) From: Markus Triska To: Chong Yidong Cc: 743@debbugs.gnu.org Subject: Re: 23.0.60; linum-mode margin display wrong References: <87ej4js4o3.fsf@cyd.mit.edu> Date: Thu, 21 Aug 2008 21:49:00 -0400 In-Reply-To: <87ej4js4o3.fsf@cyd.mit.edu> (Chong Yidong's message of "Wed, 20 Aug 2008 18:27:40 -0400") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.48 Chong Yidong writes: > Could you try to debug this? I'm not sure if it's a linum.el bug or a > redisplay bug. The following patch fixes this problem for me. One remaining issue is that overlays for line numbers inherit text properties. For example: $ emacs -Q -f fundamental-mode -f linum-mode M-o u then insert anything, and the line number is also underlined. How to best fix this? Maybe overlays should not inherit properties if they only affect the display margins. 2008-08-22 Markus Triska * linum.el (linum-delay): Disable - it should no longer be necessary, and can lead to longer delays. (linum-update-window): Renumber if margin width has changed. diff --git a/lisp/linum.el b/lisp/linum.el index 41fe2de..db07b00 100644 --- a/lisp/linum.el +++ b/lisp/linum.el @@ -30,7 +30,7 @@ ;;; Code: -(defconst linum-version "0.9wx") +(defconst linum-version "0.9wz") (defvar linum-overlays nil "Overlays used in this buffer.") (defvar linum-available nil "Overlays available for reuse.") @@ -65,7 +65,7 @@ and you have to scroll or press \\[recenter-top-bottom] to update the numbers." :group 'linum :type 'boolean) -(defcustom linum-delay t +(defcustom linum-delay nil "Delay updates to give Emacs a chance for other changes." :group 'linum :type 'boolean) @@ -131,39 +131,38 @@ and you have to scroll or press \\[recenter-top-bottom] to update the numbers." "Update line numbers for the portion visible in window WIN." (goto-char (window-start win)) (let ((line (line-number-at-pos)) - (limit (1+ (window-end win t))) + (limit (window-end win t)) (fmt (cond ((stringp linum-format) linum-format) ((eq linum-format 'dynamic) (let ((w (length (number-to-string (count-lines (point-min) (point-max)))))) (concat "%" (number-to-string w) "d"))))) - (width 0) - visited - ov) + (width 0)) (run-hooks 'linum-before-numbering-hook) ;; Create an overlay (or reuse an existing one) for each ;; line visible in this window, if necessary. - (while (and (not (eobp)) (< (point) limit)) - (setq visited nil) - (dolist (o (overlays-in (point) (point))) - (when (eq (overlay-get o 'linum-line) line) - (unless (memq o linum-overlays) - (push o linum-overlays)) - (setq linum-available (delete o linum-available)) - (setq visited t))) - (let ((str (if fmt - (propertize (format fmt line) 'face 'linum) - (funcall linum-format line)))) + (while (and (not (eobp)) (<= (point) limit)) + (let* ((str (if fmt + (propertize (format fmt line) 'face 'linum) + (funcall linum-format line))) + (visited (catch 'visited + (dolist (o (overlays-in (point) (point))) + (when (string= (overlay-get o 'linum-str) str) + (unless (memq o linum-overlays) + (push o linum-overlays)) + (setq linum-available (delete o linum-available)) + (throw 'visited t)))))) (setq width (max width (length str))) (unless visited - (if (null linum-available) - (setq ov (make-overlay (point) (point))) - (setq ov (pop linum-available)) - (move-overlay ov (point) (point))) - (push ov linum-overlays) - (setq str (propertize " " 'display `((margin left-margin) ,str))) - (overlay-put ov 'before-string str) - (overlay-put ov 'linum-line line))) + (let (ov) + (if (null linum-available) + (setq ov (make-overlay (point) (point))) + (setq ov (pop linum-available)) + (move-overlay ov (point) (point))) + (push ov linum-overlays) + (overlay-put ov 'before-string + (propertize " " 'display `((margin left-margin) ,str))) + (overlay-put ov 'linum-str str)))) (forward-line) (setq line (1+ line))) (set-window-margins win width))) From bojohan+mail@dd.chalmers.se Fri Aug 22 11:41:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.4 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 743) by emacsbugs.donarmstrong.com; 22 Aug 2008 18:41:37 +0000 Received: from atum.ita.chalmers.se (atum.ita.chalmers.se [129.16.4.148]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7MIfXkw011615 for <743@emacsbugs.donarmstrong.com>; Fri, 22 Aug 2008 11:41:35 -0700 Received: from remote5.student.chalmers.se (remote5.student.chalmers.se [129.16.29.83]) by atum.ita.chalmers.se (Postfix) with ESMTP id 262AF1CB2E for <743@emacsbugs.donarmstrong.com>; Fri, 22 Aug 2008 20:41:32 +0200 (CEST) Received: by remote5.student.chalmers.se (Postfix, from userid 61540) id 185182005C; Fri, 22 Aug 2008 20:41:32 +0200 (CEST) From: bojohan+mail@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) To: 743@debbugs.gnu.org Subject: Re: bug#743: 23.0.60; linum-mode margin display wrong References: <87ej4js4o3.fsf@cyd.mit.edu> Date: Fri, 22 Aug 2008 20:41:31 +0200 In-Reply-To: (Markus Triska's message of "Thu, 21 Aug 2008 21:49:00 -0400") Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Markus Triska writes: > One remaining issue is that overlays for line numbers inherit text > properties. For example: > > $ emacs -Q -f fundamental-mode -f linum-mode > > M-o u > > then insert anything, and the line number is also underlined. How to > best fix this? Try this: (defface linum '((t :inherit (shadow default))) "Face for displaying line numbers in the display margin." :group 'linum) --=20 Johan Bockg=C3=A5rd From cyd@stupidchicken.com Tue Aug 26 13:51:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.1 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 743-done) by emacsbugs.donarmstrong.com; 26 Aug 2008 20:51:31 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7QKpSxA001991 for <743-done@emacsbugs.donarmstrong.com>; Tue, 26 Aug 2008 13:51:29 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 3BBDD57E34E; Tue, 26 Aug 2008 16:53:13 -0400 (EDT) To: Markus Triska Cc: bojohan+mail@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=), 743-done@debbugs.gnu.org Subject: Re: bug#743: 23.0.60; linum-mode margin display wrong From: Chong Yidong Date: Tue, 26 Aug 2008 16:53:13 -0400 Message-ID: <87sksrqz0m.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > The following patch fixes this problem for me. I've checked in the patch, together with Johan's suggestion of inheriting the remaining face attributes of `linum' from the default face. Thanks. From unknown Fri Jun 20 07:27:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Wed, 24 Sep 2008 14:24:03 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator