[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1082953 24/68: ace-window.el: add custom buffer ignoring
From: |
Oleh Krehel |
Subject: |
[elpa] master 1082953 24/68: ace-window.el: add custom buffer ignoring |
Date: |
Sat, 21 Mar 2015 19:06:55 +0000 |
branch: master
commit 10829530238766ce7a6be210a9c59cdf5ca88b02
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ace-window.el: add custom buffer ignoring
* ace-window.el (aw-ignored-buffers): New custom variable. Set this to
a list of buffer names that are often around, but you don't want to
switch to them.
(aw-ignore-on): New custom variable. This value can be toggled with
M-0 `ace-window'.
(aw-ignored-p): New function.
(aw-list-visual-area): Don't return ignored windows.
(aw-generic): Add ignoring.
(ace-window): With 0 prefix argument, toggle `aw-ignore-on'.
---
ace-window.el | 46 +++++++++++++++++++++++++++++++++++++---------
1 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/ace-window.el b/ace-window.el
index 80ece68..8f212f6 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -74,6 +74,21 @@
(const :tag "global" global)
(const :tag "frame" frame)))
+(defcustom aw-ignored-buffers '("*Calc Trail*")
+ "List of buffers to ignore when selecting window."
+ :group 'ace-window)
+
+(defcustom aw-ignore-on t
+ "When t, `ace-window' will ignore `aw-ignored-buffers'.
+Use M-0 `ace-window' to toggle this value."
+ :group 'ace-window)
+
+(defun aw-ignored-p (window)
+ "Return t if WINDOW should be ignored."
+ (and aw-ignore-on
+ (member (buffer-name (window-buffer window))
+ aw-ignored-buffers)))
+
;;;###autoload
(defun aw-list-visual-area ()
"Forward to `ace-jump-list-visual-area', removing invisible frames."
@@ -83,7 +98,8 @@
(or (not (and (frame-live-p f)
(frame-visible-p f)))
(and (= (frame-height f) 10)
- (= (frame-width f) 10)))))
+ (= (frame-width f) 10))
+ (aw-ignored-p (aj-visual-area-window x)))))
(ace-jump-list-visual-area)))
;; ——— Macros
——————————————————————————————————————————————————————————————————
@@ -146,9 +162,19 @@ HANDLER is a function that takes a window argument."
'aw-visual-area<)))
(cl-case (length visual-area-list)
(0)
- (1)
+ (1
+ (when (aw-ignored-p (selected-window))
+ (other-window 1)))
(2
- (,handler (next-window nil nil next-window-scope)))
+ (if (aw-ignored-p (selected-window))
+ (other-window 1)
+ (let ((sw (selected-window))
+ (w (next-window nil nil next-window-scope)))
+ (while (aw-ignored-p w)
+ (select-window w)
+ (setq w (next-window nil nil next-window-scope)))
+ (select-window sw)
+ (,handler w))))
(t
(let ((candidate-list
(mapcar (lambda (va)
@@ -217,15 +243,17 @@ Variations are described below.
By default, behaves like extended `other-window'.
-Prefixed with one \\[universal-argument], does a swap between
- selected window and current window, so that the selected buffer
- moves to current window (and current buffer moves to selected
- window).
+Prefixed with one \\[universal-argument], does a swap between selected window
+ and current window, so that the selected buffer moves to current window (and
+ current buffer moves to selected window).
-Prefixed with two \\[universal-argument]'s, deletes the selected
- window."
+Prefixed with two \\[universal-argument]'s, deletes the selected window."
(interactive "p")
(cl-case arg
+ (0
+ (setq aw-ignore-on
+ (not aw-ignore-on))
+ (ace-select-window))
(4 (ace-swap-window))
(16 (ace-delete-window))
(t (ace-select-window))))
- [elpa] master c3a9242 06/68: ace-window.el: add move and delete functionality, (continued)
- [elpa] master c3a9242 06/68: ace-window.el: add move and delete functionality, Oleh Krehel, 2015/03/21
- [elpa] master fc95979 14/68: Remove ace-jump-mode-make-indirect-buffer, Oleh Krehel, 2015/03/21
- [elpa] master 4de62ee 15/68: Merge pull request #8 from kyleam/ace-jump-update, Oleh Krehel, 2015/03/21
- [elpa] master dd44ece 13/68: ace-window.el (aw-delete-window): allow to delete current window, Oleh Krehel, 2015/03/21
- [elpa] master 18f300a 12/68: Merge pull request #5 from kyleam/fix-selection, Oleh Krehel, 2015/03/21
- [elpa] master f0b55c8 18/68: Merge pull request #9 from demon386/master, Oleh Krehel, 2015/03/21
- [elpa] master 8f20278 16/68: ace-window.el (aw-generic): switch to cl-position, Oleh Krehel, 2015/03/21
- [elpa] master 6053545 17/68: Respect `aw-scope' when jumping with `next-window', Oleh Krehel, 2015/03/21
- [elpa] master 5127bfd 20/68: ace-window.el (aw-generic): finalize improve for hscroll, Oleh Krehel, 2015/03/21
- [elpa] master 12a34df 19/68: ace-window.el (aw-generic): improve for hscroll, Oleh Krehel, 2015/03/21
- [elpa] master 1082953 24/68: ace-window.el: add custom buffer ignoring,
Oleh Krehel <=
- [elpa] master c351368 23/68: ace-window.el (aw-visual-area<): improve., Oleh Krehel, 2015/03/21
- [elpa] master 9020f42 22/68: ace-window.el (ace-window): update doc, Oleh Krehel, 2015/03/21
- [elpa] master 56d4aee 27/68: ace-window.el: tag 0.5.0, Oleh Krehel, 2015/03/21
- [elpa] master 5174ca2 25/68: ace-window.el (aw-generic): handle zero-length read-only buffers better, Oleh Krehel, 2015/03/21
- [elpa] master 0e821a2 29/68: ace-window.el (aw-offset): use inhibit-field-text-motion t, Oleh Krehel, 2015/03/21
- [elpa] master e0531fd 26/68: ace-window.el: add work-around for autoload, Oleh Krehel, 2015/03/21
- [elpa] master b7b8e72 28/68: ace-window.el (aw-list-visual-area): improve, Oleh Krehel, 2015/03/21
- [elpa] master f7001fb 33/68: ace-window.el (aw-background): new custom, Oleh Krehel, 2015/03/21
- [elpa] master 038a426 31/68: ace-window.el: whitespace, Oleh Krehel, 2015/03/21
- [elpa] master c8d7ae1 21/68: ace-window.el: change version to 0.3.0, Oleh Krehel, 2015/03/21