emacs - Make as much as possible of buffer visible in window instead of showing empty space after buffer -


it possible "scroll past end of buffer" in window. useful because emacs has somehow use space when buffer not fill whole area available window used display it.

however when whole buffer fit window top part still isn't displayed , more space necessary wasted below buffer content fill available space. better if window automatically scrolled show complete buffer or if bigger window as possible.

in other words time when window displays "below buffer end" when window big.

is there mode or option that?

enter image description here

edit: this?

(add-hook 'post-command-hook 'my-eob-recenter) (defun my-eob-recenter ()   (when (pos-visible-in-window-p (point-max))     (save-excursion       (goto-char (point-max))       (recenter -1)))) 

original answer:

if have window larger contents , want shrink fit, there's binding that.

c-x- runs shrink-window-if-larger-than-buffer

personally suspect annoying if happened automatically, might try this:

(defadvice split-window (after my-split-window-shrink)   "shrink selected window after window split if larger contents."   (shrink-window-if-larger-than-buffer)) (ad-activate 'split-window) 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -