Mercurial > emacs
diff lisp/emacs-lisp/lisp.el @ 101956:6ad8cdf501c1
(end-of-defun): Don't skip to next line after
calling end-of-defun-function if it already moved to BOL.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 12 Feb 2009 04:16:14 +0000 |
parents | 7d131969b5e2 |
children | db03a07a8e3e |
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp.el Thu Feb 12 04:01:11 2009 +0000 +++ b/lisp/emacs-lisp/lisp.el Thu Feb 12 04:16:14 2009 +0000 @@ -348,9 +348,10 @@ (beginning-of-defun-raw 1) (while (unless (eobp) (funcall end-of-defun-function) - (skip-chars-forward " \t") - (if (looking-at "\\s<\\|\n") - (forward-line 1)) + (unless (bolp) + (skip-chars-forward " \t") + (if (looking-at "\\s<\\|\n") + (forward-line 1))) ;; If we started after the end of the previous ;; function, try again with the next one. (unless (or (> (point) pos) @@ -370,9 +371,10 @@ (let ((beg (point)) retry-point) (funcall end-of-defun-function) - (skip-chars-forward " \t") - (if (looking-at "\\s<\\|\n") - (forward-line 1)) + (unless (bolp) + (skip-chars-forward " \t") + (if (looking-at "\\s<\\|\n") + (forward-line 1))) ;; If we started from within the function just found, ;; try again with the previous one. (unless (or (< (point) pos)