summaryrefslogtreecommitdiffstats
path: root/Misc/python-mode.el
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-09-22 19:51:47 (GMT)
committerBarry Warsaw <barry@python.org>1998-09-22 19:51:47 (GMT)
commit218eb75ba712d28e8999b270666fd18b25d128fd (patch)
treeb063a4a5594225796900bb043c45be860fe88ef0 /Misc/python-mode.el
parent0238a25b20357f34f8b678373264c5ead2aecc5a (diff)
downloadcpython-218eb75ba712d28e8999b270666fd18b25d128fd.zip
cpython-218eb75ba712d28e8999b270666fd18b25d128fd.tar.gz
cpython-218eb75ba712d28e8999b270666fd18b25d128fd.tar.bz2
(py-block-comment-prefix): Remove trailing space. Also explain that
this string should not end with whitespace. (py-compute-indentation): Append whitespace regexp to py-block-comment-prefix so that any combination of intervening whitespace will be recognized.
Diffstat (limited to 'Misc/python-mode.el')
-rw-r--r--Misc/python-mode.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index b666c06..0a7982f 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -156,12 +156,12 @@ lines are aligned to column zero."
(const :tag "Align to column zero" nil))
:group 'python)
-(defcustom py-block-comment-prefix "## "
+(defcustom py-block-comment-prefix "##"
"*String used by \\[comment-region] to comment out a block of code.
This should follow the convention for non-indenting comment lines so
that the indentation commands won't get confused (i.e., the string
should be of the form `#x...' where `x' is not a blank or a tab, and
-`...' is arbitrary)."
+`...' is arbitrary). However, this string should not end in whitespace."
:type 'string
:group 'python)
@@ -1710,14 +1710,15 @@ dedenting."
(if (and (eq py-honor-comment-indentation nil)
(fboundp 'forward-comment))
(forward-comment (- (point-max)))
- (let (done)
+ (let ((prefix-re (concat py-block-comment-prefix "[ \t]*"))
+ done)
(while (not done)
(re-search-backward "^[ \t]*\\([^ \t\n#]\\|#\\)" nil 'move)
(setq done (or (bobp)
(and (eq py-honor-comment-indentation t)
(save-excursion
(back-to-indentation)
- (not (looking-at py-block-comment-prefix))
+ (not (looking-at prefix-re))
))
(and (not (eq py-honor-comment-indentation t))
(save-excursion