[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/symbol-overlay 17cac32ea9 090/152: Added support to ignore
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/symbol-overlay 17cac32ea9 090/152: Added support to ignore keywords from c and c++ modes |
Date: |
Thu, 7 Jul 2022 12:04:17 -0400 (EDT) |
branch: elpa/symbol-overlay
commit 17cac32ea96c272f3c210e2ea2ddc6ada93c37bd
Author: Leandro Cardoso <leandrocardoso@gmail.com>
Commit: Leandro Cardoso <leandrocardoso@gmail.com>
Added support to ignore keywords from c and c++ modes
---
symbol-overlay.el | 37 ++++++++++++++++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
diff --git a/symbol-overlay.el b/symbol-overlay.el
index 2252f0eb40..eedec9f639 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -152,7 +152,9 @@ You can add more colors whatever you like."
:type 'float)
(defcustom symbol-overlay-ignore-functions
- '((python-mode . symbol-overlay-ignore-function-python))
+ '((c-mode . symbol-overlay-ignore-function-c)
+ (c++-mode . symbol-overlay-ignore-function-c++)
+ (python-mode . symbol-overlay-ignore-function-python))
"Functions to determine whether a symbol should be ignored.
This is an association list that maps a MAJOR-MODE symbol to a
@@ -365,6 +367,39 @@ If SHOW-COLOR is non-nil, display the color used by
current overlay."
(+ count 1)
(+ count (length after))))))
+(defvar c-font-lock-extra-types)
+(defun symbol-overlay-ignore-function-c (symbol)
+ "Determine whether SYMBOL should be ignored (C Language)."
+ (let ((keywords (append c-font-lock-extra-types
+ '("auto" "break" "case" "char" "const" "continue"
+ "default" "do" "double" "else" "enum" "extern"
+ "float" "for" "goto" "if" "inline" "int" "long"
+ "register" "restrict" "return" "short" "signed"
+ "sizeof" "static" "struct" "switch" "typedef"
+ "union" "unsigned" "void" "volatile" "while"))))
+ (string-match-p (concat "\\_<\\(" (mapconcat 'identity keywords "\\|")
"\\)\\_>") symbol)))
+
+(defvar c++-font-lock-extra-types)
+(defun symbol-overlay-ignore-function-c++ (symbol)
+ "Determine whether SYMBOL should be ignored (C++)."
+ (let ((keywords (append c++-font-lock-extra-types
+ '("alignas" "alignof" "asm" "auto" "bool" "break"
+ "case" "catch" "char" "char16_t" "char32_t" "class"
+ "const" "const_cast" "constexpr" "continue"
+ "decltype" "default" "delete" "do" "double"
+ "dynamic_cast" "else" "enum" "explicit" "export"
+ "extern" "false" "final" "float" "for" "friend"
+ "goto" "if" "inline" "int" "long" "mutable"
+ "namespace" "new" "noexcept" "nullptr" "operator"
+ "override" "private" "protected" "public" "register"
+ "reinterpret_cast" "return" "short" "signed"
+ "sizeof" "static" "static_assert" "static_cast"
+ "struct" "switch" "template" "this" "thread_local"
+ "throw" "true" "try" "typedef" "typeid" "typename"
+ "union" "unsigned" "using" "virtual" "void"
+ "volatile" "wchar_t" "while"))))
+ (string-match-p (concat "\\_<\\(" (mapconcat 'identity keywords "\\|")
"\\)\\_>") symbol)))
+
(defvar python-font-lock-keywords)
(defun symbol-overlay-ignore-function-python (symbol)
"Determine whether SYMBOL should be ignored (Python)."
- [nongnu] elpa/symbol-overlay dbe35b271d 056/152: bind jump-and-switch keys to p/n, (continued)
- [nongnu] elpa/symbol-overlay dbe35b271d 056/152: bind jump-and-switch keys to p/n, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay fcd6ffe97a 059/152: delete symbol-overlay-narrow-function, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay b6f4bc4aa6 060/152: v3.6: remove put-temp-one and mark, improve refresh for temp, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 02b6ea82ac 063/152: better logic, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 75e59b5d63 068/152: Give the minor-mode a keymap, so users can bind M-n/M-p there if they prefer, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay de2bf06202 066/152: Turn overlay colors list and idle time into custom vars, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 6076319f57 079/152: add default text when replacing, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 7f9de8e93f 081/152: Do not enable symbol-overlay-mode when keyword not found, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 1d610fa502 082/152: Merge pull request #14 from yulapshun/master, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 7ced9edc76 084/152: Merge pull request #16 from emacswatcher/master, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 17cac32ea9 090/152: Added support to ignore keywords from c and c++ modes,
ELPA Syncer <=
- [nongnu] elpa/symbol-overlay b76f510037 089/152: little adjustment after merging, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay b6dba39f02 094/152: Merge pull request #24 from purcell/patch-4, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 2b565ba9ec 096/152: Fix error in symbol-overlay-ignore-function-python, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay d146404278 101/152: Bump version (fixes #19), ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay c630dbd5ce 105/152: Split code into sections, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 1fb712d4a8 114/152: typo fix, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay ff16ccf472 118/152: Merge pull request #44 from walseb/lisp-to-c-primitive, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 75c6ba66c0 116/152: Don't log navigation steps to *Messages* (fixes #37), ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay ad77d6cd1e 113/152: add symbol-overlay-jump-first/last, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 8aa6b11a73 135/152: Maintain timer buffer-locally, ELPA Syncer, 2022/07/07