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

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

[elpa] externals/ace-window 15b0639 34/92: ace-window.el (aw-make-frame-


From: Stefan Monnier
Subject: [elpa] externals/ace-window 15b0639 34/92: ace-window.el (aw-make-frame-char): New defcustom
Date: Wed, 17 Mar 2021 18:39:17 -0400 (EDT)

branch: externals/ace-window
commit 15b0639ba5ad6d196550ba615ab2804309fa38bb
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ace-window.el (aw-make-frame-char): New defcustom
    
    * ace-window.el (aw-set-make-frame-char): Add setter.
    (aw-dispatch-default): Update.
---
 ace-window.el | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/ace-window.el b/ace-window.el
index 0ca3e25..3ad836c 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -334,11 +334,30 @@ pixels."
   (aw-switch-to-window window)
   (aw-make-frame))
 
+(defcustom aw-make-frame-char ?z
+  "Character that triggers creation of a new single-window frame for display."
+  :set 'aw-set-make-frame-char
+  :type 'character)
+
+(defun aw-set-make-frame-char (symbol value)
+  "Set SYMBOL `aw-make-frame-char' to VALUE after checking it."
+  (when value
+    (cond ((not (characterp value))
+           (user-error
+            "must be a character, not `%s'" value))
+          ((memq value aw-keys)
+           (user-error
+            "`%c' conflicts with the same character in `aw-keys'" value))
+          ((assq value aw-dispatch-alist)
+           (user-error
+            "`%c' conflicts with the same character in `aw-dispatch-alist'" 
value))))
+  (set symbol value))
+
 (defun aw-dispatch-default (char)
   "Perform an action depending on CHAR."
   (cond ((= char (aref (kbd "C-g") 0))
          (throw 'done 'exit))
-        ((= char ?z)
+        ((= char aw-make-frame-char)
          (aw-use-frame (selected-window))
          (throw 'done 'exit))
         (t



reply via email to

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