summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Zlatanov <tzz@lifelogs.com>2013-03-29 09:24:19 -0400
committerTed Zlatanov <tzz@lifelogs.com>2013-03-29 09:24:19 -0400
commit75a2f9811394920a246bd7f8402bfb60adf9a368 (patch)
tree599c7edeb259bea7154daea6d0f4fd8039b84f56
parentaa534cb70bfabdc7312cb4d0cf244c2ce4ec0d50 (diff)
downloademacs-75a2f9811394920a246bd7f8402bfb60adf9a368.tar.gz
* progmodes/subword.el (superword-mode): Use `forward-sexp' instead of `forward-symbol'.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/subword.el24
2 files changed, 22 insertions, 7 deletions
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 <tzz@lifelogs.com>
+
+ * progmodes/subword.el (superword-mode): Use `forward-sexp'
+ instead of `forward-symbol'.
+
2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
* 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)))