branch: elpa/xah-fly-keys commit 1b9c07644d796add7113521e63fc1a1525d11719 Author: Xah Lee <x...@xahlee.org> Commit: Xah Lee <x...@xahlee.org>
xah-delete-backward-char-or-bracket-text hack fix a bug. this is a mess to be figured out later. problem is, elisp syntax-ppss can't tell comment when at beginning of a 2 char comment. --- xah-fly-keys.el | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/xah-fly-keys.el b/xah-fly-keys.el index e8d5b8c3c6..568b6dced4 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: 17.15.20220627044859 +;; Version: 17.15.20220628130211 ;; Created: 10 Sep 2013 ;; Package-Requires: ((emacs "24.1")) ;; Keywords: convenience, emulations, vim, ergoemacs @@ -633,26 +633,30 @@ Version: 2017-07-02 2022-06-23" (delete-region (region-beginning) (region-end)) (cond ((looking-back "\\s)" 1) - (let ($isComment ($p0 (point))) - (backward-char) - (setq $isComment (nth 4 (syntax-ppss))) - (goto-char $p0) - (if $isComment - (if (forward-comment -1) - (kill-region (point) $p0) - (message "error GSNN2:parsing comment failed.")) + (if (string-equal major-mode "xah-wolfram-mode") + (let ($isComment ($p0 (point))) + (backward-char) + (setq $isComment (nth 4 (syntax-ppss))) + (goto-char $p0) + (if $isComment + (if (forward-comment -1) + (kill-region (point) $p0) + (message "error GSNN2:parsing comment failed.")) + (if current-prefix-arg + (xah-delete-backward-bracket-pair) + (xah-delete-backward-bracket-text)))) + (progn (if current-prefix-arg (xah-delete-backward-bracket-pair) (xah-delete-backward-bracket-text))))) ((looking-back "\\s(" 1) (message "left of cursor is opening bracket") (let ($pOpenBracketLeft - ($pOpenBracketRight (point)) $p1 $isComment) + ($pOpenBracketRight (point)) $isComment) (backward-char) (setq $pOpenBracketLeft (point)) (goto-char $pOpenBracketRight) (forward-char) - (setq $p1 (point)) (setq $isComment (nth 4 (syntax-ppss))) (if $isComment (progn