From: Dmitry Gutov Date: Mon, 20 Mar 2023 18:18:42 +0000 (+0200) Subject: * lisp/treesit.el (treesit-end-of-defun): Guard arg against nil (bug#62158). X-Git-Tag: emacs-29.0.90~121 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7a1272168af1a5b82979efa29451147c5d867981;p=emacs.git * lisp/treesit.el (treesit-end-of-defun): Guard arg against nil (bug#62158). --- diff --git a/lisp/treesit.el b/lisp/treesit.el index c118f5d52a4..b271a1f0c4b 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1882,6 +1882,7 @@ this function depends on `treesit-defun-type-regexp' and `treesit-defun-skipper'." (interactive "^p\nd") (let ((orig-point (point))) + (if (or (null arg) (= arg 0)) (setq arg 1)) (catch 'done (dotimes (_ 2) ; Not making progress is better than infloop.