diff options
author | Ulrich Müller <ulm@gentoo.org> | 2024-11-13 20:43:08 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2024-11-13 20:43:08 +0100 |
commit | 646a3d2bdf12462a961192abccd74967c368215f (patch) | |
tree | 8eac4a409ff0bfc6ab8cd4f49e991324380db6dd | |
parent | eselect-mode: Doc fix (diff) | |
download | eselect-646a3d2bdf12462a961192abccd74967c368215f.tar.gz eselect-646a3d2bdf12462a961192abccd74967c368215f.tar.bz2 eselect-646a3d2bdf12462a961192abccd74967c368215f.zip |
eselect-mode: Combine font-lock keywords in one variable
* misc/eselect-mode.el (eselect-mode-keywords-*): Delete.
(eselect-mode-keywords-0): Combine keywords in one variable.
(eselect-mode-font-lock-keywords): Use the new variable.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | misc/eselect-mode.el | 64 |
2 files changed, 29 insertions, 41 deletions
@@ -1,3 +1,9 @@ +2024-11-13 Ulrich Müller <ulm@gentoo.org> + + * misc/eselect-mode.el (eselect-mode-keywords-*): Delete. + (eselect-mode-keywords-0): Combine keywords in one variable. + (eselect-mode-font-lock-keywords): Use the new variable. + 2023-11-05 Ulrich Müller <ulm@gentoo.org> * misc/eselect-mode.el: Doc fix. diff --git a/misc/eselect-mode.el b/misc/eselect-mode.el index 6ffa88f..3c4e55f 100644 --- a/misc/eselect-mode.el +++ b/misc/eselect-mode.el @@ -1,6 +1,6 @@ ;;; eselect-mode.el --- edit eselect files -*-lexical-binding:t-*- -;; Copyright 2006-2023 Gentoo Authors +;; Copyright 2006-2024 Gentoo Authors ;; Author: Matthew Kennedy <mkennedy@gentoo.org> ;; Diego Pettenò <flameeyes@gentoo.org> @@ -53,56 +53,38 @@ ;;; Font-lock. -(defvar eselect-mode-keywords-warn - '(("eval") - font-lock-warning-face)) - -(defvar eselect-mode-keywords-core - '(("die" "check_do" "do_action" "inherit" "sed") - font-lock-type-face)) - -(defvar eselect-mode-keywords-output - '(("write_error_msg" "write_warning_msg" "write_list_start" +(defvar eselect-mode-keywords-0 + '((;; core + "die" "check_do" "do_action" "inherit" "sed" + ;; output + "write_error_msg" "write_warning_msg" "write_list_start" "write_numbered_list_entry" "write_kv_list_entry" "write_numbered_list" "highlight" "highlight_warning" - "highlight_marker" "is_output_mode" "space") - font-lock-type-face)) - -(defvar eselect-mode-keywords-tests - '(("has" "is_function" "is_number") - font-lock-type-face)) - -(defvar eselect-mode-keywords-path-manipulation - '(("basename" "dirname" "canonicalise" "relative_name") - font-lock-type-face)) - -(defvar eselect-mode-keywords-config - '(("store_config" "load_config" "append_config") - font-lock-type-face)) - -(defvar eselect-mode-keywords-multilib - '(("list_libdirs" "get_libdir") - font-lock-type-face)) - -(defvar eselect-mode-keywords-package-manager - '(("arch" "envvar" "best_version" "has_version" "get_repositories" + "highlight_marker" "is_output_mode" "space" + ;; tests + "has" "is_function" "is_number" + ;; path-manipulation + "basename" "dirname" "canonicalise" "relative_name" + ;; config + "store_config" "load_config" "append_config" + ;; multilib + "list_libdirs" "get_libdir" + ;; package-manager + "arch" "envvar" "best_version" "has_version" "get_repositories" "get_repo_news_dir" "env_update") font-lock-type-face)) +(defvar eselect-mode-keywords-warn + '(("eval") + font-lock-warning-face)) + (defvar eselect-mode-font-lock-keywords (mapcar (lambda (x) (cons (regexp-opt (car x) 'words) (cadr x))) - (list - eselect-mode-keywords-warn - eselect-mode-keywords-core - eselect-mode-keywords-output - eselect-mode-keywords-tests - eselect-mode-keywords-path-manipulation - eselect-mode-keywords-config - eselect-mode-keywords-multilib - eselect-mode-keywords-package-manager))) + (list eselect-mode-keywords-0 + eselect-mode-keywords-warn))) ;;; Mode definitions. |