From c4179117afd37a03a7ba322e66b5bd6bae5637bd Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Tue, 11 Oct 2022 10:03:33 +0200 Subject: [PATCH] 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. --- lisp/progmodes/js.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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) -- 2.39.2