aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Zlatanov2013-03-29 09:24:19 -0400
committerTed Zlatanov2013-03-29 09:24:19 -0400
commit75a2f9811394920a246bd7f8402bfb60adf9a368 (patch)
tree599c7edeb259bea7154daea6d0f4fd8039b84f56
parentaa534cb70bfabdc7312cb4d0cf244c2ce4ec0d50 (diff)
downloademacs-75a2f9811394920a246bd7f8402bfb60adf9a368.tar.gz
emacs-75a2f9811394920a246bd7f8402bfb60adf9a368.zip
* 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 @@
12013-03-29 Teodor Zlatanov <tzz@lifelogs.com>
2
3 * progmodes/subword.el (superword-mode): Use `forward-sexp'
4 instead of `forward-symbol'.
5
12013-03-28 Stefan Monnier <monnier@iro.umontreal.ca> 62013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * emacs-lisp/edebug.el (edebug-mode): Make it a minor mode. 8 * 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.
154 "Do the same as `forward-word' but on subwords. 154 "Do the same as `forward-word' but on subwords.
155See the command `subword-mode' for a description of subwords. 155See the command `subword-mode' for a description of subwords.
156Optional argument ARG is the same as for `forward-word'." 156Optional argument ARG is the same as for `forward-word'."
157 (interactive "p") 157 (interactive "^p")
158 (unless arg (setq arg 1)) 158 (unless arg (setq arg 1))
159 (cond 159 (cond
160 ((< 0 arg) 160 ((< 0 arg)
@@ -168,16 +168,26 @@ Optional argument ARG is the same as for `forward-word'."
168 168
169(put 'subword-forward 'CUA 'move) 169(put 'subword-forward 'CUA 'move)
170 170
171(defalias 'subword-right 'subword-forward)
172
173(defun subword-backward (&optional arg) 171(defun subword-backward (&optional arg)
174 "Do the same as `backward-word' but on subwords. 172 "Do the same as `backward-word' but on subwords.
175See the command `subword-mode' for a description of subwords. 173See the command `subword-mode' for a description of subwords.
176Optional argument ARG is the same as for `backward-word'." 174Optional argument ARG is the same as for `backward-word'."
177 (interactive "p") 175 (interactive "^p")
178 (subword-forward (- (or arg 1)))) 176 (subword-forward (- (or arg 1))))
179 177
180(defalias 'subword-left 'subword-backward) 178(defun subword-right (&optional arg)
179 "Do the same as `right-word' but on subwords."
180 (interactive "^p")
181 (if (eq (current-bidi-paragraph-direction) 'left-to-right)
182 (subword-forward arg)
183 (subword-backward arg)))
184
185(defun subword-left (&optional arg)
186 "Do the same as `left-word' but on subwords."
187 (interactive "^p")
188 (if (eq (current-bidi-paragraph-direction) 'left-to-right)
189 (subword-backward arg)
190 (subword-forward arg)))
181 191
182(defun subword-mark (arg) 192(defun subword-mark (arg)
183 "Do the same as `mark-word' but on subwords. 193 "Do the same as `mark-word' but on subwords.
@@ -299,7 +309,7 @@ edit them as words.
299;; 309;;
300(defun subword-forward-internal () 310(defun subword-forward-internal ()
301 (if superword-mode 311 (if superword-mode
302 (forward-symbol 1) 312 (forward-sexp 1)
303 (if (and 313 (if (and
304 (save-excursion 314 (save-excursion
305 (let ((case-fold-search nil)) 315 (let ((case-fold-search nil))
@@ -315,7 +325,7 @@ edit them as words.
315 325
316(defun subword-backward-internal () 326(defun subword-backward-internal ()
317 (if superword-mode 327 (if superword-mode
318 (forward-symbol -1) 328 (forward-sexp -1)
319 (if (save-excursion 329 (if (save-excursion
320 (let ((case-fold-search nil)) 330 (let ((case-fold-search nil))
321 (re-search-backward subword-backward-regexp nil t))) 331 (re-search-backward subword-backward-regexp nil t)))