Scott Bold
Scott Bold

Reputation: 145

Emacs mini-buffer command with parameter

I'd like to use the command to resize split windows via the mini-buffer. In the GNU documentation I found the description (Resizing-Windows):

Example: enlarge-window-horizontally size &optional horizontal. 

If I type M-x enlarge-window-horizontally the window will get resized by one column. But it is not possible to add a number for the size in the mini-buffer, as on pressing spacebar emacs tries to complete the command.

Does someone know how to use the optional parameters in mini-buffer? Respectively how to resize a window by more than one column at once.

Thanks.

Upvotes: 5

Views: 2080

Answers (2)

unutbu
unutbu

Reputation: 879501

Passing parameters to interactive command like this uses the universal argument.

You can enlarge the window by 10 columns by typing C-u 10 M-x enlarge-window-horizontally. You can change 10 to any integer. By the way, typing C-u num to supply a numeric argument works with all interactive emacs commands that expect an argument.

Note there is also a keyboard short cut: C-u 10 C-x }. And to shrink the window: C-u 10 C-x {.

You can also specify numbers by typing holding down the meta key M-10 C-x {

Upvotes: 10

Colin Cochrane
Colin Cochrane

Reputation: 2615

What you are looking for is eval-expression.

M-: (enlarge-window-horizontally horizontal)

M-: will change the minibuffer to an eval prompt that lets you enter in a Lisp expression to be evaluated.

Upvotes: 6

Related Questions