diff options
| author | Stefan Monnier | 2013-07-22 18:51:29 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-07-22 18:51:29 -0400 |
| commit | 9b2607e821843c26fab866b2ebec7befef696c6b (patch) | |
| tree | 3b161e2ba19ff990ee4f466dc26b377b8eb29ef0 | |
| parent | c43a861814c2cbe65c67d0bfa5523b50eba1419f (diff) | |
| download | emacs-9b2607e821843c26fab866b2ebec7befef696c6b.tar.gz emacs-9b2607e821843c26fab866b2ebec7befef696c6b.zip | |
* lisp/winner.el (winner-hook-installed-p): Remove.
(winner-mode): Simplify accordingly.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/winner.el | 17 |
2 files changed, 5 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 38c79fc4279..7e104ad69b9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2013-07-22 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2013-07-22 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * winner.el (winner-hook-installed-p): Remove. | ||
| 4 | (winner-mode): Simplify accordingly. | ||
| 5 | |||
| 3 | * subr.el (add-to-list): Fix compiler-macro when `append' is | 6 | * subr.el (add-to-list): Fix compiler-macro when `append' is |
| 4 | not constant. Don't use `cl-member' for the base case. | 7 | not constant. Don't use `cl-member' for the base case. |
| 5 | 8 | ||
diff --git a/lisp/winner.el b/lisp/winner.el index f521ba0521b..e7e7d0614b4 100644 --- a/lisp/winner.el +++ b/lisp/winner.el | |||
| @@ -342,31 +342,18 @@ You may want to include buffer names such as *Help*, *Apropos*, | |||
| 342 | map) | 342 | map) |
| 343 | "Keymap for Winner mode.") | 343 | "Keymap for Winner mode.") |
| 344 | 344 | ||
| 345 | ;; Check if `window-configuration-change-hook' is working. | ||
| 346 | (defun winner-hook-installed-p () | ||
| 347 | (save-window-excursion | ||
| 348 | (let ((winner-var nil) | ||
| 349 | (window-configuration-change-hook | ||
| 350 | '((lambda () (setq winner-var t))))) | ||
| 351 | (split-window) | ||
| 352 | winner-var))) | ||
| 353 | |||
| 354 | 345 | ||
| 355 | ;;;###autoload | 346 | ;;;###autoload |
| 356 | (define-minor-mode winner-mode nil :global t ; let d-m-m make the doc | 347 | (define-minor-mode winner-mode nil :global t ; let d-m-m make the doc |
| 357 | (if winner-mode | 348 | (if winner-mode |
| 358 | (progn | 349 | (progn |
| 359 | (if (winner-hook-installed-p) | 350 | (add-hook 'window-configuration-change-hook 'winner-change-fun) |
| 360 | (progn | 351 | (add-hook 'post-command-hook 'winner-save-old-configurations) |
| 361 | (add-hook 'window-configuration-change-hook 'winner-change-fun) | ||
| 362 | (add-hook 'post-command-hook 'winner-save-old-configurations)) | ||
| 363 | (add-hook 'post-command-hook 'winner-save-conditionally)) | ||
| 364 | (add-hook 'minibuffer-setup-hook 'winner-save-unconditionally) | 352 | (add-hook 'minibuffer-setup-hook 'winner-save-unconditionally) |
| 365 | (setq winner-modified-list (frame-list)) | 353 | (setq winner-modified-list (frame-list)) |
| 366 | (winner-save-old-configurations)) | 354 | (winner-save-old-configurations)) |
| 367 | (remove-hook 'window-configuration-change-hook 'winner-change-fun) | 355 | (remove-hook 'window-configuration-change-hook 'winner-change-fun) |
| 368 | (remove-hook 'post-command-hook 'winner-save-old-configurations) | 356 | (remove-hook 'post-command-hook 'winner-save-old-configurations) |
| 369 | (remove-hook 'post-command-hook 'winner-save-conditionally) | ||
| 370 | (remove-hook 'minibuffer-setup-hook 'winner-save-unconditionally))) | 357 | (remove-hook 'minibuffer-setup-hook 'winner-save-unconditionally))) |
| 371 | 358 | ||
| 372 | ;; Inspired by undo (simple.el) | 359 | ;; Inspired by undo (simple.el) |