diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2009-02-12 04:16:14 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2009-02-12 04:16:14 +0000 |
commit | 6bffddf43b6cae67d1b36eeae07d6227a8c6b8a1 (patch) | |
tree | a4007ddbd5d5fd060f295e85436a0f7d35482be4 /lisp/emacs-lisp/lisp.el | |
parent | 51584624eee2e282fbd7a299b6cc57fa7dd3747e (diff) | |
download | emacs-6bffddf43b6cae67d1b36eeae07d6227a8c6b8a1.tar.gz |
(end-of-defun): Don't skip to next line after
calling end-of-defun-function if it already moved to BOL.
Diffstat (limited to 'lisp/emacs-lisp/lisp.el')
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index ba1546980ae..b53c98acb7e 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -348,9 +348,10 @@ is called as a function to find the defun's end." (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 @@ is called as a function to find the defun's end." (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) |