From 8e911f6f933455fd1d6709dd60965fb9191e81d6 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 23 Feb 2012 03:13:48 -0500 Subject: [PATCH] * lisp/emacs-lisp/lisp.el (beginning-of-defun-raw): Don't call end-of-defun when it might call us back infinitely. Fixes: debbugs:10797 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/lisp.el | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ee3c486d5ff..4f8fd60deaa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-02-23 Dmitry Gutov + + * 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 * minibuffer.el (completion-table-with-context): Fix inf-loop. diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 8c53ad58612..4efdc3240cd 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -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)) -- 2.39.2