[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ace-window 2f433c8 29/92: Added ability to specify a ne
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ace-window 2f433c8 29/92: Added ability to specify a new frame window as the target |
Date: |
Wed, 17 Mar 2021 18:39:15 -0400 (EDT) |
branch: externals/ace-window
commit 2f433c870024519c2d7cca42b506c862ae64fb35
Author: Bob Weiner <rsw@gnu.org>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
Added ability to specify a new frame window as the target
* ace-window.el (aw-dispatch-alist): Bind to "z".
The location and size of the new frame are controlled by `aw-frame-offset'
and `aw-frame-size'.
Re #114
---
ace-window.el | 43 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 2 deletions(-)
diff --git a/ace-window.el b/ace-window.el
index e347776..af8e3f0 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -118,6 +118,17 @@ This will make `ace-window' act different from
`other-window' for
the reverse of `frame-list'"
:type 'boolean)
+(defcustom aw-frame-offset '(13 . 23)
+ "Increase in pixel offset for new ace-window frames relative to the selected
frame.
+Its value is an (x-offset . y-offset) pair in pixels."
+ :type '(cons integer integer))
+
+(defcustom aw-frame-size nil
+ "Frame size to make new ace-window frames.
+Its value is a (width . height) pair in pixels or nil for the default frame
size.
+(0 . 0) is special and means make the frame size the same as the last selected
frame size."
+ :type '(cons integer integer))
+
(defface aw-leading-char-face
'((((class color)) (:foreground "red"))
(((background dark)) (:foreground "gray100"))
@@ -279,19 +290,47 @@ LEAF is (PT . WND)."
(?b aw-split-window-horz "Split Horz Window")
(?i delete-other-windows "Delete Other Windows")
(?o delete-other-windows)
- (?? aw-show-dispatch-help))
+ (?? aw-show-dispatch-help)
+ (?z aw-use-frame "Use new frame"))
"List of actions for `aw-dispatch-default'.")
(defun aw--dispatch-action (char)
"Return item from `aw-dispatch-alist' matching CHAR."
(assoc char aw-dispatch-alist))
+(defun aw-make-frame ()
+ "Make a new Emacs frame using the values of `aw-frame-size' and
`aw-frame-offset'."
+ (make-frame
+ (delq nil
+ (list (when aw-frame-size
+ (cons 'width
+ (if (zerop (car aw-frame-size))
+ (frame-width)
+ (car aw-frame-size))))
+ (when aw-frame-size
+ (cons 'height
+ (if (zerop (cdr aw-frame-size))
+ (frame-height)
+ (car aw-frame-size))))
+ (cons 'left (+ (car aw-frame-offset)
+ (car (frame-position))))
+ (cons 'top (+ (cdr aw-frame-offset)
+ (cdr (frame-position))))))))
+
+(defun aw-use-frame (window)
+ "Create a new frame using the contents of WINDOW.
+
+The same size as the previous frame, offset by `aw-frame-offset'
+pixels."
+ (aw-switch-to-window window)
+ (aw-make-frame))
+
(defun aw-dispatch-default (char)
"Perform an action depending on CHAR."
(if (= char (aref (kbd "C-g") 0))
(throw 'done 'exit)
(let ((action (aw--dispatch-action char)))
- (cl-destructuring-bind (_key fn &optional description)
(aw--dispatch-action char)
+ (cl-destructuring-bind (_key fn &optional description) action
(if action
(if (and fn description)
(prog1 (setq aw-action fn)
- [elpa] externals/ace-window 6aaf1e6 13/92: Fix typo in docstring of aw-background, (continued)
- [elpa] externals/ace-window 6aaf1e6 13/92: Fix typo in docstring of aw-background, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 77cc05f 07/92: Add 'visible option for aw-scope, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 056abfe 14/92: ace-window.el (aw-switch-buffer-in-window): Add and bind to "j", Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 91d736e 15/92: ace-window.el (aw-dispatch-default): Clarify through destructuring, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window a488657 17/92: ace-window.el (aw-show-dispatch-help): Call ace-window, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 2701919 18/92: ace-window.el (aw-key-face): Add, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window a037b7a 19/92: Cask: Remove dependency, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 3665daf 24/92: ace-window.el (aw-dispatch-default): No error on "C-g", Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 74c9cef 25/92: ace-window.el (aw-dispatch-when-more-than): New defcustom, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 9bec357 28/92: ace-window.el: Fix compiler warning, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 2f433c8 29/92: Added ability to specify a new frame window as the target,
Stefan Monnier <=
- [elpa] externals/ace-window 6d3a6a0 23/92: ace-window.el (aw-switch-buffer-in-window): Use ivy if available, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 137af0d 32/92: ace-window.el: Make "z" open a frame right away, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window be3a885 38/92: Fix so ace-window-display-mode ids are displayed in new frames, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 4ab92e1 39/92: Fix up the previous commit, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window c0fbdd5 40/92: ace-window.el: Fix compiler warning, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window de873d1 09/92: Add `aw-reverse-frame-list` variable, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window d92320e 10/92: Add fair window split., Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 0a59342 12/92: ace-window.el (aw-keys): Add custom type, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window ad7c0fb 21/92: test/make-plain.el: Add, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 5e733ff 35/92: ace-window.el: Documentation and minor changes, Stefan Monnier, 2021/03/17