From: Ted Zlatanov Date: Fri, 29 Mar 2013 13:24:19 +0000 (-0400) Subject: * progmodes/subword.el (superword-mode): Use `forward-sexp' instead of `forward-symbol'. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~526^2~49 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=75a2f9811394920a246bd7f8402bfb60adf9a368;p=emacs.git * progmodes/subword.el (superword-mode): Use `forward-sexp' instead of `forward-symbol'. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a3ef9b2ae6d..1865491d382 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-03-29 Teodor Zlatanov + + * progmodes/subword.el (superword-mode): Use `forward-sexp' + instead of `forward-symbol'. + 2013-03-28 Stefan Monnier * emacs-lisp/edebug.el (edebug-mode): Make it a minor mode. diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el index 24abfa8a053..91c3a88680a 100644 --- a/lisp/progmodes/subword.el +++ b/lisp/progmodes/subword.el @@ -154,7 +154,7 @@ as words. "Do the same as `forward-word' but on subwords. See the command `subword-mode' for a description of subwords. Optional argument ARG is the same as for `forward-word'." - (interactive "p") + (interactive "^p") (unless arg (setq arg 1)) (cond ((< 0 arg) @@ -168,16 +168,26 @@ Optional argument ARG is the same as for `forward-word'." (put 'subword-forward 'CUA 'move) -(defalias 'subword-right 'subword-forward) - (defun subword-backward (&optional arg) "Do the same as `backward-word' but on subwords. See the command `subword-mode' for a description of subwords. Optional argument ARG is the same as for `backward-word'." - (interactive "p") + (interactive "^p") (subword-forward (- (or arg 1)))) -(defalias 'subword-left 'subword-backward) +(defun subword-right (&optional arg) + "Do the same as `right-word' but on subwords." + (interactive "^p") + (if (eq (current-bidi-paragraph-direction) 'left-to-right) + (subword-forward arg) + (subword-backward arg))) + +(defun subword-left (&optional arg) + "Do the same as `left-word' but on subwords." + (interactive "^p") + (if (eq (current-bidi-paragraph-direction) 'left-to-right) + (subword-backward arg) + (subword-forward arg))) (defun subword-mark (arg) "Do the same as `mark-word' but on subwords. @@ -299,7 +309,7 @@ edit them as words. ;; (defun subword-forward-internal () (if superword-mode - (forward-symbol 1) + (forward-sexp 1) (if (and (save-excursion (let ((case-fold-search nil)) @@ -315,7 +325,7 @@ edit them as words. (defun subword-backward-internal () (if superword-mode - (forward-symbol -1) + (forward-sexp -1) (if (save-excursion (let ((case-fold-search nil)) (re-search-backward subword-backward-regexp nil t)))