[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting a window's size?
From: |
Ehud Karni |
Subject: |
Re: Setting a window's size? |
Date: |
Mon, 12 Mar 2001 23:57:30 +0200 |
On Mon, 12 Mar 2001 15:11:46 -0500, Mike Schiraldi <raldi@research.netsol.com>
wrote:
>
> I know there are functions to shrink or enlarge a window by x lines, but is
> there any simple way to set a window to x lines?
Here is a little defun that will do exactly that:
(defun set-window-lines (arg)
(let ((lns (1- (window-height))))
(shrink-window (- lns arg))))
[It will enlarge when arg > current window size]
> I'd like to have a macro that launches gdb and makes its window 8 lines
> tall. Here's what i'm currently using:
>
> (fset 'good-gdb
> [?\C-x ?2
> ?\C-x ?o
> ?\M-x ?g ?d ?b return ?\C-u ?\C-x ?q escape ?\C-c
> ?\C-x ?- ])
>
> Unfortunately, C-x - doesn't do the job since gdb hasn't yet output anything
> by the time emacs gets to that part of the macro.
I think it is better to write a dedicated function that does exactly
what you want instead of relying on keyboard macro which may depend
on key binding and the current configuration (anyway that is the way
I work)
> Perhaps i should use the window-height function somehow?
Sure (see mu defun above).
Ehud.
--
@@@@@@ @@@ @@@@@@ @ @ Ehud Karni Simon & Wiesel Insurance agency
@ @ @ @@ @ Tel: +972-3-6212-757 Fax: +972-3-6292-544
@ @ @ @ @ @@ (USA) Fax and voice mail: 1-815-5509341
@ @ @ @ @ @ Better Safe Than Sorry
http://www.simonwiesel.co.il mailto:ehud@unix.simonwiesel.co.il