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).
This commit is contained in:
Noam Postavsky 2020-08-11 16:02:11 +02:00 committed by Lars Ingebrigtsen
parent 2a47ef86e9
commit 9b9473ad75
2 changed files with 57 additions and 1 deletions

View file

@ -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.