From a70f169e5f5d224d46b421cb800f24ea75f3709f Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Sat, 3 Jan 2015 00:55:59 +0100 Subject: [PATCH] Fix trailing ... in outline * lisp/outline.el (outline-next-preface): Don't go backward char when at end of buffer. This will fix the problem of calling `outline-toggle-children' twice in a row for the file's last heading. --- lisp/outline.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/outline.el b/lisp/outline.el index 11d71fb..260073d 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -420,9 +420,10 @@ or else the number of characters matched by `outline-regexp'." If there's no following heading line, stop before the newline at the end of the buffer." (if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)") - nil 'move) + nil 'move) (goto-char (match-beginning 0))) - (if (and (bolp) (or outline-blank-line (eobp)) (not (bobp))) + (if (and (bolp) (or outline-blank-line (eobp)) + (not (bobp)) (not (eobp))) (forward-char -1))) (defun outline-next-heading () -- 1.9.1