Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the frame width in Emacs, Interactively

Tags:

emacs

I know you can change the frame size in the .emacs file with set-frame-width or (add-to-list 'default-frame-alist '(width . 80)) but how can I change the width after Emacs has started up (aside from dragging the edge of the frame)?

like image 778
Cristian Avatar asked Mar 13 '09 22:03

Cristian


2 Answers

In addition to Charlie Martin's suggestions, you can do

M-: (set-frame-width (selected-frame) N)
like image 182
Chris Conway Avatar answered Oct 22 '22 21:10

Chris Conway


Well, go to the *scratch* buffer and use set-frame-width.

(set-frame-width (selected-frame) 100)  ;; ^J to execute.

set-frame-width isn't interactive, so you can't run it with M-x but you could trivially write a set-frame-width-interactive, something like

(defun set-frame-width-interactive (arg)
   (interactive "p")
   (set-frame-width (selected-frame) arg))

Now C-u 8 0 M-x set-frame-width-interactive will set the width to 80.

Is this what you're trying to do?

like image 34
Charlie Martin Avatar answered Oct 22 '22 19:10

Charlie Martin