[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: current compile.el issues

From: Juri Linkov
Subject: Re: current compile.el issues
Date: Wed, 28 Apr 2004 08:22:29 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

address@hidden (Daniel Pfeiffer) writes:
>> >  * I think `compilation-context-lines' should default to 0, per
>> >    previous behaviour.  That way you can tell what the current error
>> >    line is.
>> Several people have asked for that.  I have no preference and it's just
>> a change of the default value of a variable, so anybody can do it.
> I think doing this the same way as scrolling is a good idea, but I can always
> set this option if it defaults to 0.  This is however the first request since
> the fringe arrow appeared, so I don't know if many people still want this.

It seems that inconvenience most people are complaining about
caused both by putting the current line several lines down from
the top and by scrolling the compilation window at the same time.
It's difficult to find the line in the middle when the window scrolls.

An option to disable window scrolling could be added as in the patch
below.  But I still can't definitely say if it should be default.
Perhaps, the default 0 value is better.

(For me it seems strange that exactly the same behavior in the Gnus
Summary causes no problem, but in the compilation buffer putting the
error message two lines down from the top makes it hard to locate.
Perhaps, the reason is that the Gnus Summary has the small window

BTW, did you look at adding fontification of grep matches to compile.el?
I've been using the simple code for some time and I found it very
useful!  But it seems that processing ANSI sequences (and fontifying
the matches with some new special face) should be added to the compile
process filter as Stefan suggested.

Patch for option to disable scrolling:

Index: lisp/progmodes/compile.el
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.308
diff -u -r1.308 compile.el
--- lisp/progmodes/compile.el   25 Apr 2004 12:54:50 -0000      1.308
+++ lisp/progmodes/compile.el   28 Apr 2004 04:24:28 -0000
@@ -1473,17 +1473,19 @@
 (defcustom compilation-context-lines next-screen-context-lines
-  "*Display this many lines of leading context before message."
-  :type 'integer
+  "*Display this many lines of leading context before message.
+If nil, don't scroll the compilation output window."
+  :type '(choice integer (const :tag "No scrolling" nil))
   :group 'compilation
   :version "21.4")
 (defsubst compilation-set-window (w mk)
   "Align the compilation output window W with marker MK near top."
-  (set-window-start w (save-excursion
-                       (goto-char mk)
-                       (beginning-of-line (- 1 compilation-context-lines))
-                       (point)))
+  (if (integerp compilation-context-lines)
+      (set-window-start w (save-excursion
+                            (goto-char mk)
+                            (beginning-of-line (- 1 compilation-context-lines))
+                            (point))))
   (set-window-point w mk))
 (defun compilation-goto-locus (msg mk end-mk)

Juri Linkov

reply via email to

[Prev in Thread] Current Thread [Next in Thread]