The context
In the gif shown below, I demostrate that the way next-error
show the current error in a new window depends on the size of the font.
- When using the font
Fira Code 20
, a single window is used to show the selected error. - When using the font
Fira Code 10
, 3 windows are used to show the selected error. - When using the font
Misc Fixed:pixelsize=7
, 7 windows are used to show the selected error.
The question
How can I change the behavior of next-error
and previous-error
so that a single window is opened on the right of the compilation buffer (i.e. the *grep*
buffer) and make this behavior not to be affected by the size of the font being used?
compilation-goto-locus
; i.e.,(if from-compilation-buffer (let ((pop-up-windows t)) (pop-to-buffer (marker-buffer mk) 'other-window)) (switch-to-buffer (marker-buffer mk)))
[comments from code omitted]. I have other projects on my plate at the moment, so perhaps another forum participant can write up an answer ... – lawlist Nov 15 '20 at 20:57emacs -Q
? – lawlist Nov 16 '20 at 1:52emacs -Q
. As seen in the gif, I only use commands which are bundled with Emacs, namely,grep
,set-frame-font
,next-error
. To achieve the results, executegrep
on a set of files so thatnext-error
have multiple files to open and make sure you have a big and a small font. You can create ten files containing only numbers (as seen in the gif) by executing the following one-linerfor i in $(seq 1 10); do seq 1 100 > $i.txt; done
just make sure to execute that command in an empty folder so that you could remove those files easily. – doltes Nov 16 '20 at 2:01