From defed5b5af25f89b31e37e8880f63132fa7d7034 Mon Sep 17 00:00:00 2001 From: blais Date: Mon, 21 Nov 2005 02:43:33 +0000 Subject: [PATCH] Fixed bug with TOC update when it is at the end of a file. git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk/docutils@4091 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- tools/editors/emacs/rst.el | 9 +++++---- 1 file 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 -- 2.11.4.GIT