emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#36832: closed (Supply option to suppress scrolling


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#36832: closed (Supply option to suppress scrolling in compilation mode buffers.)
Date: Tue, 03 Sep 2019 17:45:02 +0000

Your message dated Tue, 3 Sep 2019 17:44:07 +0000
with message-id <20190903174407.GA16090@ACM>
and subject line Re: bug#36832: Supply option to suppress scrolling in 
compilation mode buffers.
has caused the debbugs.gnu.org bug report #36832,
regarding Supply option to suppress scrolling in compilation mode buffers.
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden.)


-- 
36832: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36832
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Supply option to suppress scrolling in compilation mode buffers. Date: Sun, 28 Jul 2019 20:32:21 +0000 User-agent: Mutt/1.10.1 (2018-07-13)
Hello, Emacs.

In a compilation mode buffer, hit CR on one of the error lines so as to
go to the pertinent line in the erroneous source code.

WHAM!  The compilation mode buffer is unavoidably scrolled so that the
line CR'd upon is at the top of the window.  Well, it's unavoidable
unless you're running under a GUI and have fringes enabled.

This forced scrolling is irritating for at least one Emacs developer.

I propose enhancing the customisation variable compilation-context-lines
with the extra value t meaning "never scroll the compilation mode buffer".

Here is a patch to achieve this:



diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 4b2fc516c3..5a8680fd0c 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -2546,26 +2546,30 @@ compilation-context-lines
   "Display this many lines of leading context before the current message.
 If nil and the left fringe is displayed, don't scroll the
 compilation output window; an arrow in the left fringe points to
-the current message.  If nil and there is no left fringe, the message
-displays at the top of the window; there is no arrow."
-  :type '(choice integer (const :tag "No window scrolling" nil))
+the current message.  If nil and there is no left fringe, the
+message displays at the top of the window; there is no arrow.  If
+t, don't scroll the compilation output window at all."
+  :type '(choice integer
+                 (const :tag "Scroll window when no fringe" nil)
+                 (const :tag  "No window scrolling" t))
   :version "22.1")
 
 (defsubst compilation-set-window (w mk)
-  "Align the compilation output window W with marker MK near top."
-  (if (integerp compilation-context-lines)
-      (set-window-start w (save-excursion
-                           (goto-char mk)
-                           (compilation-beginning-of-line
-                            (- 1 compilation-context-lines))
-                           (point)))
+  "Maybe align the compilation output window W with marker MK near top."
+  (cond ((integerp compilation-context-lines)
+         (set-window-start w (save-excursion
+                              (goto-char mk)
+                              (compilation-beginning-of-line
+                               (- 1 compilation-context-lines))
+                              (point))))
+        ((eq compilation-context-lines t))
     ;; If there is no left fringe.
-    (when (equal (car (window-fringes w)) 0)
-      (set-window-start w (save-excursion
-                            (goto-char mk)
-                           (beginning-of-line 1)
-                           (point)))))
-    (set-window-point w mk))
+        ((equal (car (window-fringes w)) 0)
+         (set-window-start w (save-excursion
+                               (goto-char mk)
+                              (beginning-of-line 1)
+                              (point)))
+         (set-window-point w mk))))
 
 (defvar next-error-highlight-timer)
 

-- 
Alan Mackenzie (Nuremberg, Germany).



--- End Message ---
--- Begin Message --- Subject: Re: bug#36832: Supply option to suppress scrolling in compilation mode buffers. Date: Tue, 3 Sep 2019 17:44:07 +0000 User-agent: Mutt/1.10.1 (2018-07-13)
Bug fixed by implementing the proposed feature, incorporating
modification suggested in the bug thread.

-- 
Alan Mackenzie (Nuremberg, Germany).


--- End Message ---

reply via email to

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