]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/lisp.el (beginning-of-defun-raw): Don't call end-of-defun
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 23 Feb 2012 08:13:48 +0000 (03:13 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 23 Feb 2012 08:13:48 +0000 (03:13 -0500)
when it might call us back infinitely.

Fixes: debbugs:10797
lisp/ChangeLog
lisp/emacs-lisp/lisp.el

index ee3c486d5ffbe5c26a398fb86c5af6e24bbce92f..4f8fd60deaa2717bc1f41ef6ca319c5008e66c85 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-23  Dmitry Gutov  <dgutov@yandex.ru>
+
+       * emacs-lisp/lisp.el (beginning-of-defun-raw): Don't call end-of-defun
+       when it might call us back infinitely (bug#10797).
+
 2012-02-23  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * minibuffer.el (completion-table-with-context): Fix inf-loop.
index 8c53ad5861257ee955dbd95d445f1f53f0ea0833..4efdc3240cd723ec838be37adf3033f650abad8c 100644 (file)
@@ -257,9 +257,8 @@ is called as a function to find the defun's beginning."
        (if (> arg 0)
            (dotimes (i arg)
              (funcall beginning-of-defun-function))
-         ;; Better not call end-of-defun-function directly, in case
-         ;; it's not defined.
-         (end-of-defun (- arg))))))
+        (dotimes (i (- arg))
+          (funcall end-of-defun-function))))))
 
    ((or defun-prompt-regexp open-paren-in-column-0-is-defun-start)
     (and (< arg 0) (not (eobp)) (forward-char 1))