Function: treesit-add-log-current-defun

treesit-add-log-current-defun is a byte-compiled function defined in treesit.el.gz.

Signature

(treesit-add-log-current-defun)

Documentation

Return the name of the defun at point.

Used for add-log-current-defun-function.

The delimiter between nested defun names is controlled by treesit-add-log-defun-delimiter.

Source Code

;; Defined in /usr/src/emacs/lisp/treesit.el.gz
(defun treesit-add-log-current-defun ()
  "Return the name of the defun at point.

Used for `add-log-current-defun-function'.

The delimiter between nested defun names is controlled by
`treesit-add-log-defun-delimiter'."
  (let ((node (treesit-defun-at-point))
        (name nil))
    (while node
      (when-let ((new-name (treesit-defun-name node)))
        (if name
            (setq name (concat new-name
                               treesit-add-log-defun-delimiter
                               name))
          (setq name new-name)))
      (setq node (treesit-node-parent node)))
    name))