widen-window.elをインストール

id:rubikitchさんブログで知った widen-window.el をリリース - 日記を書く [・w・] はやみずさん をインストールした。
コレは便利♪
しかし、手元のEmacsだと起動時にエラーが発生してしまったので、adviceで対処。
どうやら、GNU Emacsバッファで(bw-r window-tree)が nil になっている瞬間があるらしい。

(defadvice widen-current-window (around widen-current-window-patch activate)
  (let* ((window-tree (bw-get-tree (selected-frame)))
         (right (bw-r window-tree))
         (left  (bw-l window-tree))
         (bottom (bw-b window-tree))
         (top (bw-t window-tree)))
    (if (and right left bottom top)
        ad-do-it)))




個人的にwindmov.elを使用しているので、widen-windowが反応する関数群にwindmov.elの物を追加した

(setq ww-advised-functions
  '(other-window
    split-window
    switch-to-buffer
    mouse-drag-region
    windmove-down
    windmove-up
    windmove-left
    windmove-right
    ))