Commit 9b2607e8 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/winner.el (winner-hook-installed-p): Remove.

(winner-mode): Simplify accordingly.
parent c43a8618
2013-07-22 Stefan Monnier <monnier@iro.umontreal.ca>
* winner.el (winner-hook-installed-p): Remove.
(winner-mode): Simplify accordingly.
* subr.el (add-to-list): Fix compiler-macro when `append' is
not constant. Don't use `cl-member' for the base case.
......
......@@ -342,31 +342,18 @@ You may want to include buffer names such as *Help*, *Apropos*,
map)
"Keymap for Winner mode.")
;; Check if `window-configuration-change-hook' is working.
(defun winner-hook-installed-p ()
(save-window-excursion
(let ((winner-var nil)
(window-configuration-change-hook
'((lambda () (setq winner-var t)))))
(split-window)
winner-var)))
;;;###autoload
(define-minor-mode winner-mode nil :global t ; let d-m-m make the doc
(if winner-mode
(progn
(if (winner-hook-installed-p)
(progn
(add-hook 'window-configuration-change-hook 'winner-change-fun)
(add-hook 'post-command-hook 'winner-save-old-configurations))
(add-hook 'post-command-hook 'winner-save-conditionally))
(add-hook 'window-configuration-change-hook 'winner-change-fun)
(add-hook 'post-command-hook 'winner-save-old-configurations)
(add-hook 'minibuffer-setup-hook 'winner-save-unconditionally)
(setq winner-modified-list (frame-list))
(winner-save-old-configurations))
(remove-hook 'window-configuration-change-hook 'winner-change-fun)
(remove-hook 'post-command-hook 'winner-save-old-configurations)
(remove-hook 'post-command-hook 'winner-save-conditionally)
(remove-hook 'minibuffer-setup-hook 'winner-save-unconditionally)))
;; Inspired by undo (simple.el)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment