branch: elpa/xah-fly-keys
commit 9ca43eff25e1c4b7114f27241d429a2aa3c0c5ba
Author: Xah Lee <x...@xahlee.org>
Commit: Xah Lee <x...@xahlee.org>

    xah-smart-delete now when deleting whitespaces, put into kill-ring. this 
allow repeated call to collect deleted text into one piece that can be pasted 
later.
---
 xah-fly-keys.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/xah-fly-keys.el b/xah-fly-keys.el
index 4873b5cad4..f3a9b355b2 100644
--- a/xah-fly-keys.el
+++ b/xah-fly-keys.el
@@ -4,7 +4,7 @@
 
 ;; Author: Xah Lee ( http://xahlee.info/ )
 ;; Maintainer: Xah Lee <x...@xahlee.org>
-;; Version: 25.8.20240606205522
+;; Version: 25.8.20240608142416
 ;; Created: 2013-09-10
 ;; Package-Requires: ((emacs "27"))
 ;; Keywords: convenience, vi, vim, ergoemacs, keybinding
@@ -869,10 +869,14 @@ Version: 2024-06-05"
       (message "calling cdr of %s" xfun)
       (funcall (cdr xfun)))
      ((region-active-p) (delete-region (region-beginning) (region-end)))
-     ;; 32 is space, 9 is tab, 10 is linefeed
-     ((eq (char-before) 32) (while (eq (char-before) 32) (delete-char -1)))
-     ((eq (char-before) 9) (while (eq (char-before) 9) (delete-char -1)))
-     ((eq (char-before) 10) (while (eq (char-before) 10) (delete-char -1)))
+     ((or
+       ;; 32 is space, 9 is tab, 10 is newline
+       (eq (char-before) 32)
+       (eq (char-before) 10)
+       (eq (char-before) 9))
+      (let ((xp0 (point)))
+        (skip-chars-backward " \t\n")
+        (kill-region (point) xp0)))
      ((prog2 (backward-char) (looking-at "\\s(\\|\\s)") (forward-char))
       (message "calling xah-delete-bracket-text-backward")
       (xah-delete-bracket-text-backward))

Reply via email to