From 9b9473ad755da13cb74bf33c99c081f39eec6e08 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 11 Aug 2020 16:02:11 +0200 Subject: Fix (end-of-defun N) for N >= 2 * lisp/emacs-lisp/lisp.el (end-of-defun): Only skip to next line when after end of defun when ARG is 1 or less. * test/lisp/emacs-lisp/lisp-tests.el (end-of-defun-twice): New test (bug#24427). --- lisp/emacs-lisp/lisp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/lisp.el') diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 043cf01d2e9..8c18557c79a 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -482,7 +482,8 @@ is called as a function to find the defun's end." (if (looking-at "\\s<\\|\n") (forward-line 1)))))) (funcall end-of-defun-function) - (funcall skip) + (when (<= arg 1) + (funcall skip)) (cond ((> arg 0) ;; Moving forward. -- cgit v1.2.3