]> git.eshelyaron.com Git - emacs.git/commitdiff
(end-of-defun): Consider the ".*\n" after the end of
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 19 Feb 2009 16:55:24 +0000 (16:55 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 19 Feb 2009 16:55:24 +0000 (16:55 +0000)
the function as being part of the function.

lisp/ChangeLog
lisp/emacs-lisp/lisp.el

index 2fc4d1ee310f9ac49f9f5a5806a05982d0b4da78..72672d8efe6b57b41bdcaad0df9ff9690f4a577d 100644 (file)
@@ -1,6 +1,11 @@
+2009-02-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/lisp.el (end-of-defun): Consider the ".*\n" after the end of
+       the function as being part of the function.
+
 2009-02-19  Nick Roberts  <nickrob@snap.net.nz>
 
-       * progmodes/compile.el (compilation-error-regexp-alist-alist): 
+       * progmodes/compile.el (compilation-error-regexp-alist-alist):
        Move entry for maven (alphabetical order).
 
 2009-02-19  Glenn Morris  <rgm@gnu.org>
index 219f0253ff42c0f2a0c70ebc25e102356c71b8f9..79fb8377f23cbb1c34d59d918ee30016b5e90917 100644 (file)
@@ -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.