Skip to content

Instantly share code, notes, and snippets.

@kiwanami
Created June 3, 2010 15:19
Show Gist options
  • Save kiwanami/424000 to your computer and use it in GitHub Desktop.
Save kiwanami/424000 to your computer and use it in GitHub Desktop.
;; for widen-window.el
(defun ewm:fix-widen-window-pre-start ()
;; widen-window でエラーを起きないようする
(defadvice wlf:layout-internal (around disable-ww-mode activate)
(ad-deactivate-regexp "widen-window")
(unwind-protect
ad-do-it
(ad-activate-regexp "widen-window")))
;; widen-window を ewm では全く使わない場合
(defadvice widen-current-window (around ewm:disable-ww-mode activate)
(unless (ewm:managed-p)
ad-do-it
)))
(defun ewm:fix-widen-window-post-stop ()
;; ewm が終わったら widen-window を戻す
(ad-deactivate-regexp "ewm:disable-ww-mode"))
(defun ewm:fix-widen-window ()
(interactive)
(when (featurep 'widen-window)
(add-hook 'ewm:pre-start-hook 'ewm:fix-widen-window-pre-start)
(add-hook 'ewm:post-stop-hook 'ewm:fix-widen-window-post-stop))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment