Permalink
Browse files

* add sr-split-window-below, for emacs23 compatibility

  • Loading branch information...
1 parent 5e4c2db commit 081193b918102a04faba7f73c00d014c08d76925 djcb committed Feb 21, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 sauron.el
View
@@ -461,12 +461,20 @@ current frame."
(setq mode-line-format nil))
(set-window-dedicated-p (selected-window) t)))
+(defun sr-split-window-below (new-win-size)
+ "Split the window, return the new window below. We need this
+function because emacs 23 does not support the negative size
+argument to split-window."
+ (split-window
+ (frame-root-window)
+ (- (window-height (frame-root-window)) new-win-size)))
+
(defun sr-show-embedded ()
"Show the sauron buffer embedded in the current frame."
(setq sr-buffer (sr-create-buffer-maybe))
(let* ((win (or (get-buffer-window sr-buffer)
- (split-window (frame-root-window) -8 'below))))
+ (sr-split-window-below 8))))
(with-selected-window win
(switch-to-buffer sr-buffer)
(if sauron-hide-mode-line

0 comments on commit 081193b

Please sign in to comment.