From 24a67743bc52411fdc1366f8f8709c8dbfdd9ac8 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 24 Sep 2025 14:25:39 -0700 Subject: [PATCH] Don't hang when the beginning of the error can't be found Tools that interfere with rustc output can cause the line to be prefixed (see https://github.com/DioxusLabs/dioxus/issues/4547), which can cause the line never to be found, and the loop to continue until the user presses C-g --- rust-compile.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-compile.el b/rust-compile.el index cbdf43a..7813190 100644 --- a/rust-compile.el +++ b/rust-compile.el @@ -75,8 +75,8 @@ the compilation window until the top of the error is visible." (let ((start-of-error (save-excursion (beginning-of-line) - (while (not (looking-at "^[a-z]+:\\|^[a-z]+\\[E[0-9]+\\]:")) - (forward-line -1)) + (while (and (not (looking-at "^[a-z]+:\\|^[a-z]+\\[E[0-9]+\\]:")) + (equal (forward-line -1) 0))) (point)))) (set-window-start (selected-window) start-of-error))))))