[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 47bd115 52/68: Allow customizing the leading char face
From: |
Oleh Krehel |
Subject: |
[elpa] master 47bd115 52/68: Allow customizing the leading char face |
Date: |
Sat, 21 Mar 2015 19:07:06 +0000 |
branch: master
commit 47bd115fe7d189dbc9b187821f7af26aa1a5b7aa
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Allow customizing the leading char face
* ace-window.el (aw-leading-char-face): New face.
(aw-keys):
(aw-ignore-on):
(aw-background):
(aw-scope): No need for :group.
(aw-ignored-buffers): Add type.
(ace-window-end-hook): Remove deprecated var.
(ace-window-end-once-hook): Remove deprecated var.
(aw-select): Inline `ace-jump-populate-overlay-to-search-tree'.
Fixes #19.
Example of customization:
(custom-set-faces
'(aw-leading-char-face
((t (:inherit ace-jump-face-foreground :height 2.0)))))
You can customize interactively with "M-x" `customize-group'
`ace-window'.
---
ace-window.el | 51 ++++++++++++++++++++++++++++-----------------------
1 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/ace-window.el b/ace-window.el
index af966ff..7185af7 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -69,43 +69,30 @@
:prefix "aw-")
(defcustom aw-keys '(?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9)
- "Keys for selecting window."
- :group 'ace-window)
+ "Keys for selecting window.")
(defcustom aw-scope 'global
"The scope used by `ace-window'."
- :group 'ace-window
:type '(choice
(const :tag "global" global)
(const :tag "frame" frame)))
(defcustom aw-ignored-buffers '("*Calc Trail*" "*LV*")
"List of buffers to ignore when selecting window."
- :group 'ace-window)
+ :type '(repeat string))
(defcustom aw-ignore-on t
"When t, `ace-window' will ignore `aw-ignored-buffers'.
Use M-0 `ace-window' to toggle this value."
- :type 'boolean
- :group 'ace-window)
+ :type 'boolean)
(defcustom aw-background t
"When t, `ace-window' will dim out all buffers temporarily when used.'."
- :type 'boolean
- :group 'ace-window)
-
-(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")
+ :type 'boolean)
+
+(defface aw-leading-char-face
+ '((t (:inherit ace-jump-face-foreground)))
+ "Face for each window's leading char.")
(defun aw-ignored-p (window)
"Return t if WINDOW should be ignored."
@@ -199,8 +186,26 @@ Amend MODE-LINE to the mode line for the duration of the
selection."
(ace-jump-tree-breadth-first-construct
(length candidate-list)
(length aw-keys)))
- (ace-jump-populate-overlay-to-search-tree
- ace-jump-search-tree candidate-list)
+ (let ((s (list ace-jump-search-tree)))
+ (while s
+ (let ((node (pop s)))
+ (cond
+ ((eq (car node) 'branch)
+ ;; push all child node into stack
+ (setq s (append (cdr node) s)))
+ ((eq (car node) 'leaf)
+ (let* ((p (pop candidate-list))
+ (o (aj-position-offset p))
+ (ol (make-overlay
+ o (1+ o)
+ (aj-position-buffer p))))
+ ;; update leaf node to remember the ol
+ (setf (cdr node) ol)
+ (overlay-put ol 'face 'aw-leading-char-face)
+ (overlay-put ol 'window (aj-position-window p))
+ (overlay-put ol 'aj-data p)))
+ (t
+ (message "Failure in traversal"))))))
(ace-jump-update-overlay-in-search-tree
ace-jump-search-tree aw-keys)
(setq ace-jump-mode mode-line)
- [elpa] master 352c33a 43/68: Finalize transition to `read-char', (continued)
- [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
- [elpa] master 47bd115 52/68: Allow customizing the leading char face,
Oleh Krehel <=
- [elpa] master c897759 55/68: Update avy interface, Oleh Krehel, 2015/03/21
- [elpa] master 574b3bd 57/68: Add `aw-leading-char-style' extra-awesome custom var, Oleh Krehel, 2015/03/21
- [elpa] master 8b5f10a 53/68: Update outlines, Oleh Krehel, 2015/03/21
- [elpa] master d7cafcb 56/68: avy-jump.el: add example commands using avy, Oleh Krehel, 2015/03/21
- [elpa] master fcc64ab 59/68: avy-jump.el (avi--regex-candidates): Add optional bounds, Oleh Krehel, 2015/03/21
- [elpa] master d932090 60/68: avy-jump.el (avi--overlay): Fix bug, Oleh Krehel, 2015/03/21
- [elpa] master f0050fb 62/68: avy.el (avy-read): Give a more precise error, Oleh Krehel, 2015/03/21
- [elpa] master 4e5ca87 58/68: avy-jump.el: Major update, Oleh Krehel, 2015/03/21
- [elpa] master ee0fa60 64/68: Add show keys on mode line feature., Oleh Krehel, 2015/03/21
- [elpa] master 30abc92 61/68: avy-jump.el (avi-goto-word-0): Simplify, Oleh Krehel, 2015/03/21