[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 1430aaa 09/99: Add highlighting for compatibilit
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 1430aaa 09/99: Add highlighting for compatibility code |
Date: |
Sun, 17 Oct 2021 05:57:48 -0400 (EDT) |
branch: externals/compat
commit 1430aaae3f28b17edb7b28832d9fe5328bb12bec
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Add highlighting for compatibility code
The face for compatibility code is font-lock-preprocessor-face, as
this isn't used elsewhere in emacs-lisp-mode.
---
compat-macs.el | 10 ++++++++++
compat.el | 3 +++
2 files changed, 13 insertions(+)
diff --git a/compat-macs.el b/compat-macs.el
index 39a04ee..46ffa0c 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -57,6 +57,9 @@ attributes are handled, all others are ignored:
- :force :: Non-nil means the compatibility code is installed no
matter what.
+- :no-highlight :: Do not highlight this definition as
+ compatibility function.
+
- :version :: Manual specification of the version the compatee
code was defined in (string).
@@ -92,6 +95,13 @@ attributes are handled, all others are ignored:
(version<= emacs-version max-version)))
`(unless ,(funcall check-fn realname)))
('(compat--ignore)))
+ ,(unless (plist-get attr :no-highlight)
+ `(font-lock-add-keywords
+ 'emacs-lisp-mode
+ `((,(concat "\\_<\\("
+ (regexp-quote (symbol-name name))
+ "\\)\\_>")
+ 1 font-lock-preprocessor-face))))
,(funcall install-fn realname)))))
(if (and feature (not compat--disable-defer))
`(eval-after-load ',feature (lambda () ,body))
diff --git a/compat.el b/compat.el
index c9b9103..804ae50 100644
--- a/compat.el
+++ b/compat.el
@@ -47,6 +47,9 @@
;; older versions of Emacs (e.g. subr-x).
(compat-advise require (feature &optional filename noerror)
"Avoid throwing an error if library has compatibility code."
+ ;; As the compatibility advise around `require` is more a hack than
+ ;; of of actual value, the highlighting is supressed.
+ :no-highlight t
:force t
(condition-case err
(funcall oldfun feature filename noerror)
- [elpa] externals/compat d77b31f 11/99: Reorder files to byte compile in Makefile, (continued)
- [elpa] externals/compat d77b31f 11/99: Reorder files to byte compile in Makefile, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 12e36f7 12/99: Check if actual name is fbound before binding a function or macro, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 5846fbe 13/99: Pull compatibility definition out of eval-after-load block, ELPA Syncer, 2021/10/17
- [elpa] externals/compat b3d1100 17/99: Prepend font-lock-preprocessor-face to compatibility symbols, ELPA Syncer, 2021/10/17
- [elpa] externals/compat c626917 18/99: Add a named-let test, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 4c6c31b 29/99: Replace :force with more general :cond, ELPA Syncer, 2021/10/17
- [elpa] externals/compat a983e8c 30/99: Install advice using advice instead of nadvice for Emacs 24.3, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 08c77ed 33/99: Declare variable for gensym, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 56ad375 40/99: Declare macrop for macroexpand-1, ELPA Syncer, 2021/10/17
- [elpa] externals/compat e4b57d2 28/99: Increase base version to 24.3, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 1430aaa 09/99: Add highlighting for compatibility code,
ELPA Syncer <=
- [elpa] externals/compat 79d4778 23/99: Use compat--string-trim-left in file-name-with-extension, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 156b5f5 27/99: Ensure substring is passed two arguments in string-width advise, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 14a3bce 39/99: Remove NonGNU ELPA installation code, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 6445814 51/99: Use compatibility functions in file-name-with-extension definition, ELPA Syncer, 2021/10/17
- [elpa] externals/compat fa1d0df 55/99: Use names of compatibility functions in ert docstrings, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 1d0f6db 56/99: Add compat-if-let* tests, ELPA Syncer, 2021/10/17
- [elpa] externals/compat c0c1889 57/99: Add compat-and-let* tests, ELPA Syncer, 2021/10/17
- [elpa] externals/compat a57cfed 66/99: Avoid comparing alist-get with testfn if not available, ELPA Syncer, 2021/10/17
- [elpa] externals/compat 7d90061 21/99: Add made up macro name to macrop test, ELPA Syncer, 2021/10/17
- [elpa] externals/compat f3c5728 22/99: Wrap compat-tests setup in an eval-and-load block, ELPA Syncer, 2021/10/17