0

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.

enter image description here

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?

3
  • See the relevant section of 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:57
  • Now that I have a little more free time this evening, I am at a complete loss regarding how a user could achieve the results depicted in the GIF animation by using a default installation of Emacs -- i.e., without any user-configuration and/or additional third-party libraries. Are you able to reproduce the issue with a barbones installation with no user-configuration; aka emacs -Q? – lawlist Nov 16 '20 at 1:52
  • The Emacs I show in the gif was opened by executing emacs -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, execute grep on a set of files so that next-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-liner for 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.