]> git.eshelyaron.com Git - emacs.git/commitdiff
use-package: Mark Emacs 25 support code obsolete
authorStefan Kangas <stefankangas@gmail.com>
Wed, 2 Aug 2023 19:42:54 +0000 (21:42 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Wed, 2 Aug 2023 19:42:54 +0000 (21:42 +0200)
* lisp/use-package/use-package-core.el
(use-package-font-lock-keywords): Make obsolete.
(font-lock-add-keywords): Only call for Emacs 25 or older.

lisp/use-package/use-package-core.el

index e0e16134ed3662b62cf921b764311a2a2a03714d..8efdf06106011cd0bb2c5006cbf71a861b5be665 100644 (file)
@@ -327,12 +327,15 @@ Must be set before loading `use-package'."
       (set-default sym value))
   :group 'use-package)
 
+;; Redundant in Emacs 26 or later, which already highlights macro names.
 (defconst use-package-font-lock-keywords
   '(("(\\(use-package\\)\\_>[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
      (1 font-lock-keyword-face)
      (2 font-lock-constant-face nil t))))
-
-(font-lock-add-keywords 'emacs-lisp-mode use-package-font-lock-keywords)
+(make-obsolete-variable 'use-package-font-lock-keywords
+                        'lisp-el-font-lock-keywords "30.1")
+(when (< emacs-major-version 26)
+  (font-lock-add-keywords 'emacs-lisp-mode use-package-font-lock-keywords))
 
 (defcustom use-package-compute-statistics nil
   "If non-nil, compute statistics concerned `use-package' declarations.