[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master fa74c7f88a8: Detect DEFUNs as outline-minor-mode headings in Emac
From: |
Juri Linkov |
Subject: |
master fa74c7f88a8: Detect DEFUNs as outline-minor-mode headings in Emacs sources in c-ts-mode. |
Date: |
Wed, 14 Feb 2024 02:21:44 -0500 (EST) |
branch: master
commit fa74c7f88a8f3216665ea386c5b6355e3660fb79
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>
Detect DEFUNs as outline-minor-mode headings in Emacs sources in c-ts-mode.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--outline-predicate): When
c-ts-mode-emacs-sources-support is t, use c-ts-mode--emacs-defun-p
(bug#68824).
---
lisp/progmodes/c-ts-mode.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index c4b48f03d12..4ef17daf876 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -926,12 +926,12 @@ Return nil if NODE is not a defun node or doesn't have a
name."
(defun c-ts-mode--outline-predicate (node)
"Match outlines on lines with function names."
- (and (treesit-node-match-p
- node "\\`function_declarator\\'" t)
- (when-let ((parent (treesit-node-parent node)))
- (treesit-node-match-p
- parent
- "\\`function_definition\\'" t))))
+ (or (and (equal (treesit-node-type node) "function_declarator")
+ (equal (treesit-node-type (treesit-node-parent node))
+ "function_definition"))
+ ;; DEFUNs in Emacs sources.
+ (and c-ts-mode-emacs-sources-support
+ (c-ts-mode--emacs-defun-p node))))
;;; Defun navigation
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master fa74c7f88a8: Detect DEFUNs as outline-minor-mode headings in Emacs sources in c-ts-mode.,
Juri Linkov <=