diff --git a/meow-command.el b/meow-command.el index e21a5e7..5be17b3 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 e0aa3eb..0736433 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")