Heinz Tuechler <[EMAIL PROTECTED]> writes:

> not being an expert of Emacs, I could not find a way to change the size of
> an existing frame by a function.
> I know to set the initial size by initial-frame-alist. Is there a similar
> function to change an existing frame?
> I would like to enlage the frame, in case I run R from within Emacs. At the
> moment, I do this by creating a new frame, but may be, there is a better
> method.

I use this in my ~/.emacs:

(defun sk-grow-frame-height (&optional increment frame)
  "Increase the height of FRAME (default: selected-frame) by INCREMENT.
Interactively, INCREMENT is given by the prefix argument."
  (interactive "p")
  (set-frame-height frame (+ (frame-height frame) increment)))

(defun sk-grow-frame-width (&optional increment frame)
  "Increase the width of FRAME (default: selected-frame) by INCREMENT.
Interactively, INCREMENT is given by the prefix argument."
  (interactive "p")
  (set-frame-width frame (+ (frame-width frame) increment)))

(global-set-key [(control meta down)] (quote sk-grow-frame-height))
(global-set-key [(control meta up)]
                (lambda () (interactive) (sk-grow-frame-height -1)))
(global-set-key [(control meta right)] (quote sk-grow-frame-width))
(global-set-key [(control meta left)]
                (lambda () (interactive) (sk-grow-frame-width -1)))

Sarir


Reply via email to