emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112178: * progmodes/subword.el (supe


From: Ted Zlatanov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112178: * progmodes/subword.el (superword-mode): Use `forward-sexp' instead of `forward-symbol'.
Date: Fri, 29 Mar 2013 09:24:19 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112178
committer: Ted Zlatanov <address@hidden>
branch nick: quickfixes
timestamp: Fri 2013-03-29 09:24:19 -0400
message:
  * progmodes/subword.el (superword-mode): Use `forward-sexp' instead of 
`forward-symbol'.
modified:
  lisp/ChangeLog
  lisp/progmodes/subword.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-03-28 16:33:06 +0000
+++ b/lisp/ChangeLog    2013-03-29 13:24:19 +0000
@@ -1,3 +1,8 @@
+2013-03-29  Teodor Zlatanov  <address@hidden>
+
+       * progmodes/subword.el (superword-mode): Use `forward-sexp'
+       instead of `forward-symbol'.
+
 2013-03-28  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/edebug.el (edebug-mode): Make it a minor mode.

=== modified file 'lisp/progmodes/subword.el'
--- a/lisp/progmodes/subword.el 2013-03-27 14:04:34 +0000
+++ b/lisp/progmodes/subword.el 2013-03-29 13:24:19 +0000
@@ -154,7 +154,7 @@
   "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 @@
 
 (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 @@
 ;;
 (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 @@
 
 (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)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]