From: Stefan Kangas Date: Wed, 2 Aug 2023 19:42:54 +0000 (+0200) Subject: use-package: Mark Emacs 25 support code obsolete X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0724569c2ec22899f73c3bcf76ac57eb8bef64e4;p=emacs.git 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. --- 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.