From 0724569c2ec22899f73c3bcf76ac57eb8bef64e4 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 2 Aug 2023 21:42:54 +0200 Subject: [PATCH] use-package: Mark Emacs 25 support code obsolete * 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index e0e16134ed3..8efdf061060 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -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. -- 2.39.2