From 29591228ddb64562a5d2fcecc8468243359609f8 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Mon, 8 Jan 2024 16:58:26 +0100 Subject: Simplify the keyword generation script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * keyword-generation.sh: Create only the bare list of keywords, without the variable definition. * ebuild-mode-keywords.el (ebuild-mode-keywords-eclass): Move the begin and end marker comments into the defvar. Signed-off-by: Ulrich Müller --- ChangeLog | 7 +++++++ ebuild-mode-keywords.el | 4 ++-- keyword-generation.sh | 12 +++--------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7129538..98c60bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-01-08 Ulrich Müller + + * keyword-generation.sh: Create only the bare list of keywords, + without the variable definition. + * ebuild-mode-keywords.el (ebuild-mode-keywords-eclass): + Move the begin and end marker comments into the defvar. + 2023-11-29 Ulrich Müller * glep-mode.el (glep-mode-add-font-lock): Specify faces directly diff --git a/ebuild-mode-keywords.el b/ebuild-mode-keywords.el index ede91dd..5da37d4 100644 --- a/ebuild-mode-keywords.el +++ b/ebuild-mode-keywords.el @@ -108,9 +108,9 @@ ;; The list of eclass function keywords below is auto-generated ;; by keyword-generation.sh. -;; @@KEYWORDS-BEGIN@@ (defvar ebuild-mode-keywords-eclass '(( + ;; @@KEYWORDS-BEGIN@@ ;; acct-group "acct-group_pkg_preinst" "acct-group_pkg_pretend" "acct-group_src_install" @@ -849,9 +849,9 @@ "xorg-3_pkg_postrm" "xorg-3_pkg_setup" "xorg-3_reconf_source" "xorg-3_src_compile" "xorg-3_src_configure" "xorg-3_src_install" "xorg-3_src_prepare" "xorg-3_src_unpack" + ;; @@KEYWORDS-END@@ ) font-lock-type-face)) -;; @@KEYWORDS-END@@ (provide 'ebuild-mode-keywords) diff --git a/keyword-generation.sh b/keyword-generation.sh index 845fc5e..facdf31 100755 --- a/keyword-generation.sh +++ b/keyword-generation.sh @@ -40,9 +40,6 @@ has() { return 1 } -echo "(defvar ebuild-mode-keywords-eclass" >"${TMPFILE}" -echo "'((" >>"${TMPFILE}" - for (( i = 0; i < ${#ECLASSES[@]}; i++ )); do eclass=${ECLASSES[i]} file=${ECLASSFILES[i]} @@ -68,22 +65,19 @@ for (( i = 0; i < ${#ECLASSES[@]}; i++ )); do { echo ";; ${eclass}" - printf ' "%s"' "${functions[@]}" + printf '"%s" ' "${functions[@]}" echo } >>"${TMPFILE}" echo "ok" >&2 done -echo ")" >>"${TMPFILE}" -echo "font-lock-type-face))" >>"${TMPFILE}" - emacs -q --no-site-file --batch \ --visit "${TMPFILE}" \ --eval "(emacs-lisp-mode)" \ - --eval "(indent-region (point-min) (point-max))" \ --eval "(let ((fill-column 78) - (fill-indent-according-to-mode t) + (fill-prefix \" \") (paragraph-start \"^.\")) + (indent-region (point-min) (point-max)) (fill-region (point-min) (point-max)))" \ --eval "(save-buffer)" --kill || exit 1 -- cgit v1.2.3-65-gdbad