From: Theodor Thornhill Date: Tue, 11 Oct 2022 08:03:33 +0000 (+0200) Subject: Fix byte-compile warning for js--treesit-defun-type-regexp X-Git-Tag: emacs-29.0.90~1838 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c4179117afd37a03a7ba322e66b5bd6bae5637bd;p=emacs.git Fix byte-compile warning for js--treesit-defun-type-regexp * lisp/progmodes/js.el (js--treesit-defun-type-regexp): Move before js--treesit-beginning-of-defun. --- diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index d831a6cf7a2..1b82e204b91 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3582,6 +3582,14 @@ This function can be used as a value in `which-func-functions'" do (setq node (treesit-node-parent node)) finally return (string-join name-list ".")))) +(defvar js--treesit-defun-type-regexp + (rx (or "class_declaration" + "method_definition" + "function_declaration" + "lexical_declaration")) + "Regular expression that matches type of defun nodes. +Used in `js--treesit-beginning-of-defun' and friends.") + (defun js--treesit-beginning-of-defun (&optional arg) "Tree-sitter `beginning-of-defun' function. ARG is the same as in `beginning-of-defun." @@ -3614,14 +3622,6 @@ ARG is the same as in `end-of-defun." js--treesit-defun-type-regexp 'end)) (setq arg (1- arg)))))) -(defvar js--treesit-defun-type-regexp - (rx (or "class_declaration" - "method_definition" - "function_declaration" - "lexical_declaration")) - "Regular expression that matches type of defun nodes. -Used in `js--treesit-beginning-of-defun' and friends.") - (defun js--treesit-can-enable-p () (if (and js-use-tree-sitter (treesit-can-enable-p)