summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblais <blais@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-11-21 02:43:33 +0000
committerblais <blais@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-11-21 02:43:33 +0000
commit656b4fab28abdf9a2d3361c385fd20b313fd114d (patch)
treefbd13d264038c863530fd545b377f577a4137aeb
parentb7fab505d144ab05bb37a7f0c5352c1f2cb23150 (diff)
downloaddocutils-656b4fab28abdf9a2d3361c385fd20b313fd114d.tar.gz
Fixed bug with TOC update when it is at the end of a file.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@4091 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r--tools/editors/emacs/rst.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/editors/emacs/rst.el b/tools/editors/emacs/rst.el
index efebb349c..5bb8f18bf 100644
--- a/tools/editors/emacs/rst.el
+++ b/tools/editors/emacs/rst.el
@@ -1548,10 +1548,11 @@ delete that region. Return t if found and the cursor is left after the comment."
;; Look for the first line that starts at the first column.
(forward-line 1)
(beginning-of-line)
- (while (or (and (looking-at "[ \t]+[^ \t]")
- (setq last-real (point)) t)
- (looking-at "\\s-*$"))
- (forward-line 1)
+ (while (and
+ (< (point) (point-max))
+ (or (and (looking-at "[ \t]+[^ \t]") (setq last-real (point)) t)
+ (looking-at "\\s-*$")))
+ (forward-line 1)
)
(if last-real
(progn