diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2009-02-19 16:55:24 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2009-02-19 16:55:24 +0000 |
commit | f2a8252af4cca4d4f72638408279dec0c5f4251c (patch) | |
tree | cdba83332f64a246f8a387ee99252a55627dd08d /lisp/emacs-lisp | |
parent | 7b96ff9a00561c03b017c15837e7aecbb3a34073 (diff) | |
download | emacs-f2a8252af4cca4d4f72638408279dec0c5f4251c.tar.gz emacs-f2a8252af4cca4d4f72638408279dec0c5f4251c.tar.bz2 emacs-f2a8252af4cca4d4f72638408279dec0c5f4251c.zip |
(end-of-defun): Consider the ".*\n" after the end of
the function as being part of the function.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 219f0253ff4..79fb8377f23 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -345,6 +345,14 @@ is called as a function to find the defun's end." (let ((pos (point)) (beg (progn (end-of-line 1) (beginning-of-defun-raw 1) (point)))) (funcall end-of-defun-function) + ;; When comparing point against pos, we want to consider that if + ;; point was right after the end of the function, it's still + ;; considered as "in that function". + ;; E.g. `eval-defun' from right after the last close-paren. + (unless (bolp) + (skip-chars-forward " \t") + (if (looking-at "\\s<\\|\n") + (forward-line 1))) (cond ((> arg 0) ;; Moving forward. |