summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1996-08-05 21:53:02 (GMT)
committerBarry Warsaw <barry@python.org>1996-08-05 21:53:02 (GMT)
commitc5a8cbd35d24f44808dd5bf3525befaa729cbd61 (patch)
tree25f134ec1f0a3058cfd3a21c532b352dbb5c357a /Misc
parent6aadd26419e95c46d3f8e70e2b1a5d0bd04bda01 (diff)
downloadcpython-c5a8cbd35d24f44808dd5bf3525befaa729cbd61.zip
cpython-c5a8cbd35d24f44808dd5bf3525befaa729cbd61.tar.gz
cpython-c5a8cbd35d24f44808dd5bf3525befaa729cbd61.tar.bz2
(py-forward-into-nomenclature): Slightly better regex for stopping on
underscore.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/python-mode.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index e4b6e67..feaf7af 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -1728,10 +1728,12 @@ A `nomenclature' is a fancy way of saying AWordWithMixedCaseNotUnderscores."
(interactive "p")
(let ((case-fold-search nil))
(if (> arg 0)
- (re-search-forward "\\W*\\([A-Z_]*[a-z0-9]*\\)" (point-max) t arg)
+ (re-search-forward
+ "\\(\\W\\|[_]\\)*\\([A-Z]*[a-z0-9]*\\)"
+ (point-max) t arg)
(while (and (< arg 0)
(re-search-backward
- "\\(\\(\\W\\|[a-z0-9]\\)[A-Z]+\\|\\W\\w+\\)"
+ "\\(\\W\\|[a-z0-9]\\)[A-Z]+\\|\\(\\W\\|[_]\\)\\w+"
(point-min) 0))
(forward-char 1)
(setq arg (1+ arg)))))