gorry@liuida.UUCP (06/14/87)
References:
Hi there! The following init file source will set the compile window
to the size specified in the variable compile-window-height.
\C-x\C-e initiates compile-command
\C-x\C-r initiates a separate command in the compile window
;; compilation
(defvar compile-window-height 12)
(global-set-key "\C-x\C-e" 'special-compile)
(setq compile-command "cc foo.c")
;; execution
(global-set-key "\C-x\C-r" 'special-exec)
(defvar run-command "a.out")
(load "compile")
(defun special-compile (command)
"Compile the program including the current buffer. Default: run make.
The compile window is set to the variable compile-window-height"
(interactive (list (read-string "Compile command: " compile-command)))
(setq compile-command command)
(compile1 compile-command "No more errors")
(enlarge-window (- (- (screen-height) (window-height)) compile-window-height)
nil))
(defun special-exec (command)
"Execute a command, in the compile window"
(interactive (list (read-string "Run command: " run-command)))
(setq run-command command)
(compile1 run-command "No more errors")
(enlarge-window (- (- (screen-height) (window-height)) compile-window-height)
nil))
An improvement would be to emulate the actions taken by Emacs when
ESC-x compile is invoked - compile is loaded if not present.
gorr\/ gorry@majestix.liu.se
/
-- An editor with less than 2503217 commands has no self respect!