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

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

[nongnu] elpa/meow d037525455: Add selection fallback to meow-expand wit


From: ELPA Syncer
Subject: [nongnu] elpa/meow d037525455: Add selection fallback to meow-expand with meow-digit-argument as default
Date: Sat, 26 Oct 2024 07:00:28 -0400 (EDT)

branch: elpa/meow
commit d037525455fec181bbf14f24e058cf0205a441e1
Author: DogLooksGood <doglooksgood@hotmail.com>
Commit: DogLooksGood <doglooksgood@hotmail.com>

    Add selection fallback to meow-expand with meow-digit-argument as default
---
 meow-command.el | 37 +++++++++++++++++++------------------
 meow-var.el     |  3 ++-
 2 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/meow-command.el b/meow-command.el
index e21a5e739c..5be17b3b26 100644
--- a/meow-command.el
+++ b/meow-command.el
@@ -1616,24 +1616,25 @@ Argument ARG if not nil, switching in a new window."
 
 (defun meow-expand (&optional n)
   (interactive)
-  (when (and meow--expand-nav-function
-             (region-active-p)
-             (meow--selection-type))
-    (let* ((n (or n (string-to-number (char-to-string last-input-event))))
-           (n (if (= n 0) 10 n))
-           (sel-type (cons meow-expand-selection-type (cdr 
(meow--selection-type)))))
-      (thread-first
-        (meow--make-selection sel-type (mark)
-                              (save-mark-and-excursion
-                                (let ((meow--expanding-p t))
-                                  (dotimes (_ n)
-                                    (funcall
-                                     (if (meow--direction-backward-p)
-                                         (car meow--expand-nav-function)
-                                       (cdr meow--expand-nav-function)))))
-                                (point)))
-        (meow--select))
-      (meow--maybe-highlight-num-positions meow--expand-nav-function))))
+  (meow--with-selection-fallback
+   (when (and meow--expand-nav-function
+              (region-active-p)
+              (meow--selection-type))
+     (let* ((n (or n (string-to-number (char-to-string last-input-event))))
+            (n (if (= n 0) 10 n))
+            (sel-type (cons meow-expand-selection-type (cdr 
(meow--selection-type)))))
+       (thread-first
+         (meow--make-selection sel-type (mark)
+                               (save-mark-and-excursion
+                                 (let ((meow--expanding-p t))
+                                   (dotimes (_ n)
+                                     (funcall
+                                      (if (meow--direction-backward-p)
+                                          (car meow--expand-nav-function)
+                                        (cdr meow--expand-nav-function)))))
+                                 (point)))
+         (meow--select))
+       (meow--maybe-highlight-num-positions meow--expand-nav-function)))))
 
 (defun meow-expand-1 () (interactive) (meow-expand 1))
 (defun meow-expand-2 () (interactive) (meow-expand 2))
diff --git a/meow-var.el b/meow-var.el
index e0aa3eb21f..073643372e 100644
--- a/meow-var.el
+++ b/meow-var.el
@@ -51,7 +51,8 @@ This will affect how selection is displayed."
     (meow-kill . meow-C-k)
     (meow-cancel-selection . keyboard-quit)
     (meow-pop-selection . meow-pop-grab)
-    (meow-beacon-change . meow-beacon-change-char))
+    (meow-beacon-change . meow-beacon-change-char)
+    (meow-expand . meow-digit-argument))
   "Fallback commands for selection commands when there is no available 
selection."
   :group 'meow
   :type '(alist :key-type (function :tag "Command")



reply via email to

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