emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/beardbolt ebbdebc66f 239/323: Improve compilation buffe


From: ELPA Syncer
Subject: [elpa] externals/beardbolt ebbdebc66f 239/323: Improve compilation buffer display UX
Date: Thu, 9 Mar 2023 10:58:34 -0500 (EST)

branch: externals/beardbolt
commit ebbdebc66fa4f04771e8112db05ff96c1800fa61
Author: Erik Arvstedt <erik.arvstedt@gmail.com>
Commit: Erik Arvstedt <erik.arvstedt@gmail.com>

    Improve compilation buffer display UX
    
    - Always move the point to the first error in the compilation buffer
    
    - Handle buffer display like this:
      - If the compilation was manually started, show and select the
        compilation buffer in another window.
        This way, the user can just press enter to jump to the line where the
        error occured.
    
      - If the compilation was auto-started, display the compilation
        buffer, but don't select it so that the typing flow is not interrupted.
        This makes it obvious that the compilation failed and helpful
        error information is shown automatically.
        godbolt also removes the assembly display on compilation failures.
---
 rmsbolt.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 1b829da910..b20bda0c53 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1389,9 +1389,13 @@ Argument OVERRIDE-BUFFER asm src buffer to use instead 
of reading
                  (setq rmsbolt-src-buffer src-buffer)
                  (display-buffer (current-buffer))
                  (run-at-time 0 nil #'rmsbolt-update-overlays))))
-            ((not rmsbolt--automated-compile)
-             ;; Display compilation output
-             (display-buffer buffer)
+            (t ; Compilation failed
+             ;; Display compilation buffer
+             (if rmsbolt--automated-compile
+                 (display-buffer buffer)
+               ;; If the compilation was directly started by the user,
+               ;; select the compilation buffer.
+               (pop-to-buffer buffer))
              ;; TODO find a cleaner way to disable overlays.
              (with-current-buffer src-buffer
                (setq rmsbolt-line-mapping nil))
@@ -1536,10 +1540,13 @@ and return it."
       (setq cmd (rmsbolt--demangle-command cmd lang src-buffer))
       (with-current-buffer ; With compilation buffer
           (let ((shell-file-name (or (executable-find rmsbolt--shell)
-                                     shell-file-name)))
+                                     shell-file-name))
+                (compilation-auto-jump-to-first-error t))
             ;; TODO should this be configurable?
             (rmsbolt-with-display-buffer-no-window
              (compilation-start cmd nil (lambda (&rest _) 
"*rmsbolt-compilation*"))))
+        ;; Only jump to errors, skip over warnings
+        (setq-local compilation-skip-threshold 2)
         (add-hook 'compilation-finish-functions
                   #'rmsbolt--handle-finish-compile nil t)
         (setq rmsbolt-src-buffer src-buffer))))))



reply via email to

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