1

In Emacs how can I resize a buffer so it only takes a small part of the screen ?

Is there any way ?

I would like to have the src taking 70% of the screen and a file manager in the other 30%

Cristiano Fontes
  • 4,920
  • 6
  • 43
  • 76
  • Possible duplicate of http://stackoverflow.com/questions/4987760/how-to-change-size-of-split-screen-emacs-windows – phils Oct 02 '11 at 00:19
  • Is it possible to have any way to make it happened when open emacs instead of inputting command after that. – Enze Chi Oct 25 '11 at 11:17

2 Answers2

3

Set width of current window on current frame to ~ 70%:

(window-resize nil (- (truncate (* 0.7 (frame-width))) (window-width)) t)

The other windows are shrunk automatically. If you want to adjust more than one it gets more difficult.

As command:

(defun window-resize-to-70-percent ()
  (interactive)
  (window-resize nil (- (truncate (* 0.7 (frame-width))) (window-width)) t))
Michael Markert
  • 3,986
  • 2
  • 19
  • 19
0

Use separate window-manager frames for individual buffers (by default). Automatically shrink-fit the frames to fit the buffer content.

See One-On-One Emacs, in particular, libraries fit-frame.el and autofit-frame.el.

Drew
  • 29,895
  • 7
  • 74
  • 104