Skip to content

Instantly share code, notes, and snippets.

@mecab
Last active December 11, 2015 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mecab/4672769 to your computer and use it in GitHub Desktop.
Save mecab/4672769 to your computer and use it in GitHub Desktop.
window-resizer ( http://d.hatena.ne.jp/mooz/20100119/p1 )のxyzzy移植版
(defun my-window-resizer ()
"Control window size and position."
(interactive)
(let ((window-obj (selected-window))
(current-width (window-width))
(current-height (window-height))
(dx (if (= (nth 0 (window-coordinate)) 0) 1
-1))
(dy (if (= (nth 1 (window-coordinate)) 0) 1
-1))
action c)
(catch 'end-flag
(while t
(minibuffer-prompt "size[~dx~d]"
(window-width) (window-height))
(setq c (read-char *keyboard*))
(handler-case(cond ((eq c #\l)
(enlarge-window-horizontally dx))
((eq c #\h)
(shrink-window-horizontally dx))
((eq c #\j)
(enlarge-window dy))
((eq c #\k)
(shrink-window dy))
;; otherwise
(t
(message "Quit")
(throw 'end-flag t)))(error))))))
(global-set-key '(#\C-c #\C-r) 'my-window-resizer) ; キーバインドはお好みで
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment