From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 30 06:07:38 2012 Received: (at submit) by debbugs.gnu.org; 30 Apr 2012 10:07:38 +0000 Received: from localhost ([127.0.0.1]:58532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SOnW6-0002Qh-5I for submit@debbugs.gnu.org; Mon, 30 Apr 2012 06:07:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60909) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SOnW4-0002QW-8W for submit@debbugs.gnu.org; Mon, 30 Apr 2012 06:07:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SOnUe-0007Sy-8z for submit@debbugs.gnu.org; Mon, 30 Apr 2012 06:06:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:60822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOnUe-0007Sa-2x for submit@debbugs.gnu.org; Mon, 30 Apr 2012 06:06:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOnUc-0004Px-57 for bug-gnu-emacs@gnu.org; Mon, 30 Apr 2012 06:06:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SOnUa-0007Ro-5m for bug-gnu-emacs@gnu.org; Mon, 30 Apr 2012 06:06:05 -0400 Received: from mail-qa0-f48.google.com ([209.85.216.48]:63150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOnUZ-0007RN-Ul for bug-gnu-emacs@gnu.org; Mon, 30 Apr 2012 06:06:04 -0400 Received: by qady23 with SMTP id y23so1585059qad.14 for ; Mon, 30 Apr 2012 03:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=B8bH+IWK2ULvgT4zg33p/Hnj2G370UvCw4zkSr4YmBM=; b=hugmd9L3AaBN+aqVKB5a/J+J/Xg4ost+GrkiGL4EXsxqRVKqunFEitYYIgBCORKL5s 8D4mIDchCJKVN7BinGt9DMMPitXgoVQz0KujhSn964i/zOdHJ6xsSbry5phViSHgj+H0 HqInAa69oueeTIwhedW+JvC52348qbFYvfAMpUi+Klrqk1H4ZQZmDzPKSSZJI22oasPv 3WJSuRlXNH/j69Mej5jV/aHTaZ+KnMFV1GvmFtDi6cltEUX1tdg6+2KGiobWSkHy08fW vCqslKThK2ksLgyGT2+8QJBDG24JO+z9giLTz3FtWmaXYFEBlPcSorK0zST/9zUwSryw qp4g== MIME-Version: 1.0 Received: by 10.224.182.201 with SMTP id cd9mr3642974qab.90.1335780360536; Mon, 30 Apr 2012 03:06:00 -0700 (PDT) Received: by 10.229.39.208 with HTTP; Mon, 30 Apr 2012 03:06:00 -0700 (PDT) Date: Mon, 30 Apr 2012 12:06:00 +0200 Message-ID: Subject: M-x grep sometimes mark matches erroneously From: Troels Nielsen To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Hi all, and thanks for all the good work with emacs! When running M-x grep and getting many matches, when walking through the *grep* buffer (with for example) eventually the matches will fail to be highlighted appropriately. To reproduce e.g. 1. emacs -Q 2. goto emacs trunk/src directory 3. M-x grep 4. Enter the command: grep -nH -e .c bytecode.c 5. Walk through the *grep* buffer with n, and notice erroneous highlights in bytecode.c-buffer. This patch fixes the problem for me. It works by calculating the start-position correctly when end-col, but not end-line is set. I've also taken the liberty of not using loc for line in the upper part of compilation-internal-error-properties, as I think that use is a little confusing and possibly the cause of some bugs. Regards Troels === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2012-04-09 13:05:48 +0000 +++ lisp/progmodes/compile.el 2012-04-30 09:57:39 +0000 @@ -1068,14 +1068,14 @@ end-marker loc end-loc) (if (not (and marker (marker-buffer marker))) (setq marker nil) ; no valid marker for this file - (setq loc (or line 1)) ; normalize no linenumber to line 1 + (unless line (setq line 1)) ; normalize no linenumber to line 1 (catch 'marker ; find nearest loc, at least one exists (dolist (x (cddr (compilation--file-struct->loc-tree file-struct))) ; Loop over remaining lines. - (if (> (car x) loc) ; Still bigger. + (if (> (car x) line) ; Still bigger. (setq marker-line x) - (if (> (- (or (car marker-line) 1) loc) - (- loc (car x))) ; Current line is nearer. + (if (> (- (or (car marker-line) 1) line) + (- line (car x))) ; Current line is nearer. (setq marker-line x)) (throw 'marker t)))) (setq marker (compilation--loc->marker (cadr marker-line)) @@ -1093,15 +1093,18 @@ (save-restriction (widen) (goto-char (marker-position marker)) - (when (or end-col end-line) - (beginning-of-line (- (or end-line line) marker-line -1)) - (if (or (null end-col) (< end-col 0)) - (end-of-line) - (compilation-move-to-column end-col screen-columns)) - (setq end-marker (point-marker))) - (beginning-of-line (if end-line - (- line end-line -1) - (- loc marker-line -1))) + + ; set end-marker if appropriate and goto line + (if (not (or end-col end-line)) + (beginning-of-line (- line marker-line -1)) + + (beginning-of-line (- (or end-line line) marker-line -1)) + (if (or (null end-col) (< end-col 0)) + (end-of-line) + (compilation-move-to-column end-col screen-columns)) + (setq end-marker (point-marker)) + (when end-line (beginning-of-line (- line end-line -1)))) + (if col (compilation-move-to-column col screen-columns) (forward-to-indentation 0)) From debbugs-submit-bounces@debbugs.gnu.org Sun May 06 00:57:00 2012 Received: (at 11382) by debbugs.gnu.org; 6 May 2012 04:57:00 +0000 Received: from localhost ([127.0.0.1]:37633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SQtWm-0001RS-3F for submit@debbugs.gnu.org; Sun, 06 May 2012 00:57:00 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:54613 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SQtWj-0001RK-L2 for 11382@debbugs.gnu.org; Sun, 06 May 2012 00:56:58 -0400 Received: from bb116-15-158-8.singnet.com.sg ([116.15.158.8]:51587 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SQtUs-0002ML-Gz; Sun, 06 May 2012 00:55:03 -0400 From: Chong Yidong To: Troels Nielsen Subject: Re: bug#11382: M-x grep sometimes mark matches erroneously References: Date: Sun, 06 May 2012 12:54:55 +0800 In-Reply-To: (Troels Nielsen's message of "Mon, 30 Apr 2012 12:06:00 +0200") Message-ID: <871umxgb8g.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.96 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 11382 Cc: 11382@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Troels Nielsen writes: > This patch fixes the problem for me. It works by calculating the > start-position correctly when end-col, but not end-line is set. > > I've also taken the liberty of not using loc for line in the upper > part of compilation-internal-error-properties, as I think that use is > a little confusing and possibly the cause of some bugs. Committed to trunk. Thank you. We're approaching the extent of the contributions we can accept form you without a copyright assignment. If you intend to submit more patches in the future, would you be willing to sign a copyright assignment? From debbugs-submit-bounces@debbugs.gnu.org Sun May 13 05:19:03 2012 Received: (at control) by debbugs.gnu.org; 13 May 2012 09:19:03 +0000 Received: from localhost ([127.0.0.1]:51108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1STUxC-0004qg-Dp for submit@debbugs.gnu.org; Sun, 13 May 2012 05:19:03 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:32961 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1STUxA-0004qD-Uo for control@debbugs.gnu.org; Sun, 13 May 2012 05:19:01 -0400 Received: from cm162.gamma80.maxonline.com.sg ([202.156.80.162]:57998 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1STUwu-0007Xo-N5 for control@debbugs.gnu.org; Sun, 13 May 2012 05:18:45 -0400 From: Chong Yidong To: control@debbugs.gnu.org Subject: close 11382 Date: Sun, 13 May 2012 17:18:40 +0800 Message-ID: <87zk9cbfrj.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) close 11382 thanks From unknown Sat Jun 21 12:31:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 10 Jun 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator