emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 4570578 46/68: ace-window.el (aw--doit): simplify


From: Oleh Krehel
Subject: [elpa] master 4570578 46/68: ace-window.el (aw--doit): simplify
Date: Sat, 21 Mar 2015 19:07:03 +0000

branch: master
commit 4570578844d1a5647966d7efe273dfebc0ba97a4
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ace-window.el (aw--doit): simplify
---
 ace-window.el |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ace-window.el b/ace-window.el
index 77aa5d6..cd28c42 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -148,8 +148,7 @@ Set mode line to MODE-LINE during the selection process."
             ('global 'visible)
             ('frame 'frame)))
          (visual-area-list
-          (sort (aw-list-visual-area)
-                'aw-visual-area<))
+          (sort (aw-list-visual-area) 'aw-visual-area<))
          (visual-area-list
           (if (<= (length visual-area-list) 2)
               visual-area-list
@@ -226,19 +225,20 @@ Set mode line to MODE-LINE during the selection process."
                 (catch 'done
                   (while t
                     (setq char (read-char))
-                    (setq node (nth (or (cl-position char aw-keys) (length 
aw-keys))
-                                    (cdr ace-jump-search-tree)))
+                    (setq node (cl-position char aw-keys))
+                    (when node
+                      (setq node (nth node (cdr ace-jump-search-tree))))
                     (cond ((null node)
                            (message "No such position candidate.")
                            (throw 'done nil))
 
                           ((eq (car node) 'branch)
                            (let ((old-tree ace-jump-search-tree))
-                             (setq ace-jump-search-tree (cons 'branch (cdr 
node)))
+                             (setq ace-jump-search-tree
+                                   (cons 'branch (cdr node)))
                              (ace-jump-update-overlay-in-search-tree
                               ace-jump-search-tree aw-keys)
-                             (setf (cdr node)
-                                   nil)
+                             (setf (cdr node) nil)
                              (ace-jump-delete-overlay-in-search-tree 
old-tree)))
 
                           ((eq (car node) 'leaf)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]