Repository navigation
Honor compilation-scroll-output in ghostel-compile - #600
Merged
Merged
Conversation
ghostel-compile buffers always followed the live output: the buffer stays in ghostel-mode during the run and its windows are re-anchored to the tail on every redraw. Users coming from M-x compile expect compilation-scroll-output to control this instead. Honor the option for compilation-style runs: a new buffer-local ghostel-compile--anchor-inhibit entry on ghostel-inhibit-anchor-functions vetoes output-following while the option is nil, with point and window-start parked at the top of the buffer like compilation-start does, and finalize leaves point alone. first-error follows the output during the run and at finalize lands point on the first error message in the compile buffer, re-establishing the window start so the sentinel-time tail anchor's pending forced start cannot clamp it back; the search begins one char before the scan start because compilation-next-error skips a message point is already on. Other non-nil values keep the previous tail behavior. Interactive runs (and the C-c C-j toggle, which now bottom-anchors the window on switch) always follow the live cursor. evil-ghostel's insert/emacs-state cursor drag follows the same veto hook, so it no longer pulls point to the terminal cursor in a nil-scroll compile buffer. Fixes #599
A child's exit is recorded asynchronously by SIGCHLD and becomes visible to process-live-p on read, but sentinels only run inside accept-process-output. When the exit landed between one accept call and the loop's liveness check, the wait failed before the sentinel could satisfy the predicate — a race that hits hardest for children that exit without trailing output (no output event pulls the status change into an accept call), e.g. the raw-mode echo-guard test's one-byte dd. When the loop exits with the process dead and the predicate still false, drain events for up to a second so sentinel-driven predicates get their chance before the wait fails.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #599.
ghostel-compilebuffers always followed the live output — the buffer stays inghostel-modeduring the run and its windows are re-anchored to the tail on every redraw.compilation-scroll-outputnow controls this for compilation-style runs, makingghostel-compilea drop-in forM-x compilehere too (as suggested by @emil-e in the issue):ghostel-compile--anchor-inhibitentry onghostel-inhibit-anchor-functionsvetoes output-following, point andwindow-startare parked at the top likecompilation-startdoes, and finalize leaves point alone. Note this changes the previous always-scroll default; setcompilation-scroll-outputtotto keep the old behavior.first-error: follows the output during the run; at finalize point lands on the first error message in the compile buffer and the window recenters on it (tail when the run had no errors). The finalize branch also re-establishes the window start — the sentinel-time tail anchor leaves a forcedwindow-startpending, and the next redisplay would otherwise clamp a bareset-window-pointback into the tail view. The error search starts one char before the scan marker becausecompilation-next-errorskips a message point is already on.Interactive runs (
C-u M-x ghostel-compile,MODE=tunder the global mode) always follow the live cursor, andC-c C-jnow bottom-anchors the window when toggling to interactive mid-run.evil-ghostel's insert/emacs-state cursor drag (
evil-ghostel--around-redraw) is gated on the same veto hook, so it no longer pulls point to the terminal cursor in a nil-scroll compile buffer; its own veto entry returns nil in insert state, so plain terminals are unaffected.Tests: finalize matrix for all three values (plus interactive-tails and error-at-scan-start edge cases), veto installation across the recompile reuse path, and an end-to-end nil-scroll run keeping point at the top. Also verified live (terminal Emacs, non-selected compile window): nil / t / first-error / interactive, and the evil-ghostel scenarios including normal-state roaming regression guards.