[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master bb9da9c 44/68: Update `aw--doit' signature
From: |
Oleh Krehel |
Subject: |
[elpa] master bb9da9c 44/68: Update `aw--doit' signature |
Date: |
Sat, 21 Mar 2015 19:07:03 +0000 |
branch: master
commit bb9da9c452a0627bd9df907d6f272451b9e2b6f0
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Update `aw--doit' signature
* ace-window.el (ace-window-end-hook): Now obsolete.
(ace-window-end-once-hook): Now obsolete.
(aw--current-op): Remove.
(aw--doit): Take a function to call, once the window is selected, as the
first arg.
(ace-select-window): Update.
(ace-delete-window): Update.
(ace-swap-window): Update.
(ace-maximize-window): Update.
---
ace-window.el | 41 +++++++++++++++++++++--------------------
1 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/ace-window.el b/ace-window.el
index 4076495..6160065 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -4,7 +4,7 @@
;; Author: Oleh Krehel <address@hidden>
;; URL: https://github.com/abo-abo/ace-window
-;; Version: 0.6.1
+;; Version: 0.7.0
;; Package-Requires: ((ace-jump-mode "2.0"))
;; Keywords: cursor, window, location
@@ -91,10 +91,16 @@ Use M-0 `ace-window' to toggle this value."
(defvar ace-window-end-hook nil
"Function(s) to call after `ace-window' is done.")
+(make-obsolete-variable
+ 'ace-window-end-hook
+ "Don't use `ace-window-end-hook', just call what you need right after
`ace-window'" "0.7.0")
(defvar ace-window-end-once-hook nil
"Function(s) to call once after `ace-window' is done.
This hook is set to nil with each call to `ace-window'.")
+(make-obsolete-variable
+ 'ace-window-end-once-hook
+ "Don't use `ace-window-end-once-hook', just call what you need right after
`ace-window'" "0.7.0")
(defun aw-ignored-p (window)
"Return t if WINDOW should be ignored."
@@ -113,9 +119,6 @@ This hook is set to nil with each call to `ace-window'.")
(aw-ignored-p (aj-visual-area-window x)))))
(ace-jump-list-visual-area)))
-(defvar aw--current-op nil
- "A function of one argument to call.")
-
(defun aw--done ()
(setq ace-jump-query-char nil)
(setq ace-jump-current-mode nil)
@@ -134,8 +137,9 @@ This hook is set to nil with each call to `ace-window'.")
(ace-jump-delete-overlay-in-search-tree ace-jump-search-tree)
(setq ace-jump-search-tree nil)))
-(defun aw--doit (mode-line)
- "Select a window and eventually call `aw--current-op' for it.
+(defun aw--doit (function mode-line)
+ "Select a window and call FUNCTION for it.
+FUNCTION should accept a single `aj-position' structure.
Set mode line to MODE-LINE during the selection process."
(let* ((ace-jump-mode-scope aw-scope)
(next-window-scope
@@ -172,7 +176,7 @@ Set mode line to MODE-LINE during the selection process."
(select-window w)
(setq w (next-window nil nil next-window-scope)))
(select-window sw)
- (funcall aw--current-op
+ (funcall function
(make-aj-position
:offset 0
:visual-area (make-aj-visual-area
@@ -241,7 +245,7 @@ Set mode line to MODE-LINE during the selection process."
(ace-jump-done)
(ace-jump-push-mark)
(run-hooks 'ace-jump-mode-before-jump-hook)
- (funcall aw--current-op aj-data))
+ (funcall function aj-data))
(throw 'done t))
(t
@@ -253,33 +257,30 @@ Set mode line to MODE-LINE during the selection process."
(defun ace-select-window ()
"Ace select window."
(interactive)
- (setq aw--current-op 'aw-switch-to-window)
- (aw--doit " Ace - Window"))
+ (aw--doit #'aw-switch-to-window " Ace - Window"))
;;;###autoload
(defun ace-delete-window ()
"Ace delete window."
(interactive)
- (setq aw--current-op 'aw-delete-window)
- (aw--doit " Ace - Delete Window"))
+ (aw--doit #'aw-delete-window " Ace - Delete Window"))
;;;###autoload
(defun ace-swap-window ()
"Ace swap window."
(interactive)
- (setq aw--current-op 'aw-swap-window)
- (aw--doit " Ace - Swap Window"))
+ (aw--doit #'aw-swap-window " Ace - Swap Window"))
;;;###autoload
(defun ace-maximize-window ()
"Ace maximize window."
(interactive)
- (setq aw--current-op
- (lambda (aj)
- (let ((wnd (aj-position-window aj)))
- (select-window wnd)
- (delete-other-windows))))
- (aw--doit " Ace - Maximize Window"))
+ (aw--doit
+ (lambda (aj)
+ (let ((wnd (aj-position-window aj)))
+ (select-window wnd)
+ (delete-other-windows)))
+ " Ace - Maximize Window"))
;;;###autoload
(defun ace-window (arg)
- [elpa] master c8d7ae1 21/68: ace-window.el: change version to 0.3.0, (continued)
- [elpa] master c8d7ae1 21/68: ace-window.el: change version to 0.3.0, Oleh Krehel, 2015/03/21
- [elpa] master 5fb2caf 36/68: ace-window.el: mark two customs as boolean, Oleh Krehel, 2015/03/21
- [elpa] master 3a06c99 35/68: ace-window.el (aw--doit): fix conflict with helm, Oleh Krehel, 2015/03/21
- [elpa] master db5763f 32/68: ace-window.el (aw-swap-window): improve, Oleh Krehel, 2015/03/21
- [elpa] master 22ebc3a 34/68: ace-window.el (aw--doit): use map with most priority, Oleh Krehel, 2015/03/21
- [elpa] master e03ceb9 30/68: ace-window.el: remove aw-generic macro, Oleh Krehel, 2015/03/21
- [elpa] master 8d40101 39/68: ace-window.el (ace-window-end-hook): add, Oleh Krehel, 2015/03/21
- [elpa] master 752c2cc 37/68: README.md: update, Oleh Krehel, 2015/03/21
- [elpa] master b86d163 40/68: ace-window.el (ace-window-end-once-hook): Add, Oleh Krehel, 2015/03/21
- [elpa] master 6becad8 38/68: ace-window.el: bump version, Oleh Krehel, 2015/03/21
- [elpa] master bb9da9c 44/68: Update `aw--doit' signature,
Oleh Krehel <=
- [elpa] master 352c33a 43/68: Finalize transition to `read-char', Oleh Krehel, 2015/03/21
- [elpa] master 32911db 42/68: Start transition to `read-char', Oleh Krehel, 2015/03/21
- [elpa] master 50fafc5 45/68: ace-window.el (aw--doit): don't show anything in echo area, Oleh Krehel, 2015/03/21
- [elpa] master 4291989 41/68: ace-window.el (ace-maximize-window): Add, Oleh Krehel, 2015/03/21
- [elpa] master 064c4fb 49/68: ace-window.el (aw-select): Rename from `aw--doit', Oleh Krehel, 2015/03/21
- [elpa] master b351b51 48/68: Clean up code, Oleh Krehel, 2015/03/21
- [elpa] master 4570578 46/68: ace-window.el (aw--doit): simplify, Oleh Krehel, 2015/03/21
- [elpa] master df86665 51/68: ace-window.el (aw-ignored-buffers): add "*LV*", Oleh Krehel, 2015/03/21
- [elpa] master fa7cb4d 47/68: `aw--doit' simply returns a window now, Oleh Krehel, 2015/03/21
- [elpa] master e1ae6ba 50/68: Try not to end in `aw-ignored-p' when ace method isn't invoked, Oleh Krehel, 2015/03/21