Skip to content

Instantly share code, notes, and snippets.

@Khady
Last active October 23, 2017 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Khady/d569687312e4950f86b0335e81ac60c0 to your computer and use it in GitHub Desktop.
Save Khady/d569687312e4950f86b0335e81ac60c0 to your computer and use it in GitHub Desktop.
Reproduction for problem with compilation buffer in emacs

How to trigger the problem:

  • put mybuffer.el and Makefile in one directory (/tmp/emacs_problem for example)
  • open file mybuffer.el
  • go to end of the create-my-buffers function and execute the code (C-x C-e)
  • execute the create-my-buffers function with M-x create-my-buffers
  • execute M-x compile RET RET

How to see the expected behavior:

  • open file mybuffer.el
  • execute M-x compile RET RET
default:
ls -1 /bin
(defun create-my-buffers ()
(interactive)
(delete-other-windows)
(setq total-window-size (window-width (frame-selected-window)))
(setq total-window-height (window-height (frame-selected-window)))
(split-window-vertically)
(other-window 1)
(switch-to-buffer (get-buffer-create "*compilation*"))
(setq second-window-height (window-height (frame-selected-window)))
(setq expected-window-height (* 0.10 total-window-height))
(setq expand-window-height (- expected-window-height second-window-height))
(enlarge-window (round expand-window-height))
(other-window 1)
)
@Khady
Copy link
Author

Khady commented Oct 23, 2017

Final result
emacs-compilation-1

Final result if don't create the *compilation* buffer by hand:
emacs-compilation-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment