xahlee / xah-fly-keys

the most efficient keybinding for emacs
http://xahlee.info/emacs/misc/xah-fly-keys.html
469 stars 80 forks source link

xah-smart-delete related fixes and improved customization #170

Closed maxwestrom closed 1 month ago

maxwestrom commented 1 month ago

xah-delete-backward-bracket-text xah-delete-backward-bracket-pair xah-delete-bracket-text-backward

If DeletePrefix is non-nil, also delete any prefix characters before the opening bracket.

If the Alist contains a value pair of the form (default . ‹function-name›) Then that function replaces the `xah-smart-delete' default behavior.

((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)))