From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#9438: grep regressions Date: Wed, 07 Sep 2011 15:09:24 +0300 Organization: JURTA Message-ID: <87mxeg4kqz.fsf@mail.jurta.org> References: <87vct8gmjj.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1315399401 32251 80.91.229.12 (7 Sep 2011 12:43:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 7 Sep 2011 12:43:21 +0000 (UTC) Cc: 9438@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 07 14:43:17 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R1HTI-0005ZQ-3m for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Sep 2011 14:43:16 +0200 Original-Received: from localhost ([::1]:41841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1HTH-0006cq-MC for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Sep 2011 08:43:15 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1HTE-0006Ye-Pp for bug-gnu-emacs@gnu.org; Wed, 07 Sep 2011 08:43:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1HTD-0004st-Ic for bug-gnu-emacs@gnu.org; Wed, 07 Sep 2011 08:43:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1HTD-0004sn-Gf for bug-gnu-emacs@gnu.org; Wed, 07 Sep 2011 08:43:11 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R1HWx-000836-GN; Wed, 07 Sep 2011 08:47:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Sep 2011 12:47:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9438-submit@debbugs.gnu.org id=B9438.131539962230930 (code B ref 9438); Wed, 07 Sep 2011 12:47:03 +0000 Original-Received: (at 9438) by debbugs.gnu.org; 7 Sep 2011 12:47:02 +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 1R1HWv-00082j-FR for submit@debbugs.gnu.org; Wed, 07 Sep 2011 08:47:01 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R1HWr-00082P-8L for 9438@debbugs.gnu.org; Wed, 07 Sep 2011 08:46:57 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 3BC186E806E; Wed, 7 Sep 2011 05:43:04 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 212D3451C430; Wed, 7 Sep 2011 05:43:02 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Tue, 06 Sep 2011 21:22:30 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 07 Sep 2011 08:47:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:50663 Archived-At: >> + (when grep-highlight-matches >> + (setq compilation-error-screen-columns nil) > > Why set it here? I know it used to be set similarly, but I think it > should be set once and for all in grep-mode instead. I just discovered `grep-error-screen-columns', a defcustom added in 2004. Its default value is nil, so I suppose its purpose was to override `compilation-error-screen-columns'. It's currently unused because it misses the following lines in `grep-mode': (set (make-local-variable 'compilation-error-screen-columns) grep-error-screen-columns) I added that to `grep-mode'. > Or better yet: > > (let* ((beg (match-end 0)) > (end (save-excursion (goto-char beg) (line-end-position))) Yes, this is better. I installed these changes. Beside `grep-error-screen-columns', I discovered two more unused defcustoms in grep.el: (defcustom grep-window-height nil "*Number of lines in a grep window. If nil, use `compilation-window-height'." :type '(choice (const :tag "Default" nil) integer) :version "22.1" :group 'grep) (defcustom grep-scroll-output nil "*Non-nil to scroll the *grep* buffer window as output appears. Setting it causes the grep commands to put point at the end of their output window so that the end of the output is always visible rather than the begining." :type 'boolean :version "22.1" :group 'grep) IIUC, since the docstring says "If nil, use `compilation-window-height'" they should be used in `grep-mode' only when the value is non-nil like: (when grep-window-height (set (make-local-variable 'compilation-window-height) grep-window-height)) (when grep-scroll-output (set (make-local-variable 'compilation-scroll-output) grep-scroll-output))