[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/llama caa776b162 3/6: Activate fontification advices only
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/llama caa776b162 3/6: Activate fontification advices only when fontification mode is enabled |
Date: |
Wed, 12 Mar 2025 13:01:19 -0400 (EDT) |
branch: elpa/llama
commit caa776b16239e059b27c9eb03bd5eb510342db34
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Activate fontification advices only when fontification mode is enabled
Suggested-by: Daniel Mendler <mail@daniel-mendler.de>
---
llama.el | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/llama.el b/llama.el
index d1ae42ad78..c2fd2560b2 100644
--- a/llama.el
+++ b/llama.el
@@ -414,13 +414,21 @@ expansion, and the looks of this face should hint at
that.")
;;;###autoload
(define-minor-mode llama-fontify-mode
- "Highlight the `##' macro in Emacs Lisp mode."
+ "In Emacs Lisp mode, highlight the `##' macro and its special arguments."
:lighter llama-fontify-mode-lighter
:global t
(cond
(llama-fontify-mode
+ (advice-add 'lisp--el-match-keyword :override
+ #'lisp--el-match-keyword@llama '((depth . -80)))
+ (advice-add 'elisp-mode-syntax-propertize :override
+ #'elisp-mode-syntax-propertize@llama)
(add-hook 'emacs-lisp-mode-hook #'llama--add-font-lock-keywords))
(t
+ (advice-remove 'lisp--el-match-keyword
+ #'lisp--el-match-keyword@llama)
+ (advice-remove 'elisp-mode-syntax-propertize
+ #'elisp-mode-syntax-propertize@llama)
(remove-hook 'emacs-lisp-mode-hook #'llama--add-font-lock-keywords)))
(dolist (buffer (buffer-list))
(with-current-buffer buffer
@@ -436,7 +444,8 @@ expansion, and the looks of this face should hint at that.")
(define-obsolete-function-alias 'global-llama-fontify-mode
#'llama-fontify-mode "Llama 0.6.2")
-(define-advice lisp--el-match-keyword (:override (limit) llama -80)
+(defun lisp--el-match-keyword@llama (limit)
+ "Highlight symbols following \"(##\" the same as if they followed \"(\"."
(catch 'found
(while (re-search-forward
(concat "(\\(?:## ?\\)?\\("
@@ -457,9 +466,9 @@ expansion, and the looks of this face should hint at that.")
(match-beginning 0)))))
(throw 'found t))))))
-(define-advice elisp-mode-syntax-propertize (:override (start end) llama)
+(defun elisp-mode-syntax-propertize@llama (start end)
;; Synced with Emacs up to 6b9510d94f814cacf43793dce76250b5f7e6f64a.
- "Like `elisp-mode-syntax-propertize' but don't change syntax of `##'."
+ "Highlight `##' as the symbol which it is."
(goto-char start)
(let ((case-fold-search nil))
(funcall
- [nongnu] elpa/llama updated (4d3141aceb -> ff77af7c5d), ELPA Syncer, 2025/03/12
- [nongnu] elpa/llama caa776b162 3/6: Activate fontification advices only when fontification mode is enabled,
ELPA Syncer <=
- [nongnu] elpa/llama 6c9bccd962 2/6: No longer provide a non-global mode, ELPA Syncer, 2025/03/12
- [nongnu] elpa/llama eac219367e 1/6: Move definitions of advices related to fontification, ELPA Syncer, 2025/03/12
- [nongnu] elpa/llama ff77af7c5d 6/6: Extend cooperation with morlock-mode, ELPA Syncer, 2025/03/12
- [nongnu] elpa/llama c8aa915ae8 5/6: Add llama group to faces group, ELPA Syncer, 2025/03/12
- [nongnu] elpa/llama 1829b812a5 4/6: Mention llama-fontify-mode in documentation, ELPA Syncer, 2025/03/12