From 7a1272168af1a5b82979efa29451147c5d867981 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 20 Mar 2023 20:18:42 +0200 Subject: * lisp/treesit.el (treesit-end-of-defun): Guard arg against nil (bug#62158). --- lisp/treesit.el | 1 + 1 file changed, 1 insertion(+) 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. -- cgit v1.2.1