]> git.eshelyaron.com Git - emacs.git/commitdiff
(end-of-defun): Don't skip to next line after
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 12 Feb 2009 04:16:14 +0000 (04:16 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 12 Feb 2009 04:16:14 +0000 (04:16 +0000)
calling end-of-defun-function if it already moved to BOL.

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

index bb113227b68e30480c7cde216c7e4238c0a3ffe3..73f01a0daa69ae46b2913aa426142db177425927 100644 (file)
@@ -1,3 +1,8 @@
+2009-02-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/lisp.el (end-of-defun): Don't skip to next line after
+       calling end-of-defun-function if it already moved to BOL.
+
 2009-02-12  Richard M Stallman  <rms@gnu.org>
 
        * mail/rmail.el (rmail-show-message-verbose-min): New option.
 2009-02-09  Ulf Jasper  <ulf.jasper@web.de>
 
        * net/newst-treeview.el (newsticker-treeview-save)
-       (newsticker--treeview-load): Kill groups buffer after
-       saving/loading.
+       (newsticker--treeview-load): Kill groups buffer after saving/loading.
 
 2009-02-09  Tassilo Horn  <tassilo@member.fsf.org>
 
index ba1546980ae67a58a76300860980a8718c1db858..b53c98acb7e219a46636e632ed559e5df7015356 100644 (file)
@@ -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)