From 4c5fce12378b29fbdcb2d247c1955635f5e65588 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Sun, 31 May 2026 07:52:00 +0200 Subject: [PATCH 1/2] fix: specify containing group for defface forms Byte-compiling caml-mode emits warnings of the form "in defface for FACE: fails to specify containing group" for every face defined without a :group keyword. Add ":group 'languages" to each affected defface so the faces are associated with a customization group. This is the standard fix for the warning and does not change runtime behaviour: the face definitions and their default attributes are unchanged. Affected faces: - camldebug-event, camldebug-underline (camldebug.el) - caml-font-stop-face, caml-font-doccomment-face (caml-font.el) - caml-font-stop-face (caml-font-old.el) --- caml-font-old.el | 3 ++- caml-font.el | 6 ++++-- camldebug.el | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/caml-font-old.el b/caml-font-old.el index a2a0910..f22535c 100644 --- a/caml-font-old.el +++ b/caml-font-old.el @@ -19,7 +19,8 @@ (defface caml-font-stop-face '((t :foreground "White" :background "Red")) - "Extra faces for documentation.") + "Extra faces for documentation." + :group 'languages) (define-obsolete-face-alias 'Stop 'caml-font-stop-face "2023") (unless (boundp 'font-lock-stop-face) (defvar font-lock-stop-face 'caml-font-stop-face) diff --git a/caml-font.el b/caml-font.el index f541d73..5df3204 100644 --- a/caml-font.el +++ b/caml-font.el @@ -19,13 +19,15 @@ (defface caml-font-stop-face '((t :foreground "White" :background "Red")) - "Extra faces for documentation.") + "Extra faces for documentation." + :group 'languages) (defvar caml-font-stop-face 'caml-font-stop-face) (make-obsolete-variable 'caml-font-stop-face "use the face instead" "2023") (defface caml-font-doccomment-face '((t :foreground "Red")) ;; FIXME: Inherit from `font-lock-doc-face'? - "Face for ocamldoc comments.") + "Face for ocamldoc comments." + :group 'languages) (defvar caml-font-doccomment-face 'caml-font-doccomment-face) (make-obsolete-variable 'caml-font-doccomment-face "use the face instead" "2023") diff --git a/camldebug.el b/camldebug.el index c0ac4c5..9601412 100644 --- a/camldebug.el +++ b/camldebug.el @@ -84,13 +84,15 @@ (defface camldebug-event '((t :inverse-video t)) - "Face to highlight the first/last char of current event.") + "Face to highlight the first/last char of current event." + :group 'languages) (defface camldebug-underline ;; FIXME: The name should describe what it's used for, not what it looks ;; like by default! '((t :underline t)) - "Face to highlight the rest of current event.") + "Face to highlight the rest of current event." + :group 'languages) ;;; Camldebug mode. From 1644be3a3af1e613ce190b67ede62f3aaf9bc7b9 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Sun, 31 May 2026 07:52:37 +0200 Subject: [PATCH 2/2] ci: byte-compile with warnings as errors Add a GitHub Actions workflow that byte-compiles all source files with "byte-compile-error-on-warn" enabled, so any new byte-compile warning fails CI. The matrix covers the declared minimum (Emacs 24.4), 30.1, and the development snapshot, using actions/checkout@v5 and purcell/setup-emacs@master. Also add a Dependabot config to keep the GitHub Actions up to date. --- .github/dependabot.yml | 6 ++++++ .github/workflows/byte-compile.yml | 33 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/byte-compile.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ca79ca5 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/byte-compile.yml b/.github/workflows/byte-compile.yml new file mode 100644 index 0000000..58512c4 --- /dev/null +++ b/.github/workflows/byte-compile.yml @@ -0,0 +1,33 @@ +name: Byte-compile + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + byte-compile: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + emacs_version: + - '24.4' + - '30.1' + - snapshot + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Set up Emacs + uses: purcell/setup-emacs@master + with: + version: ${{ matrix.emacs_version }} + + - name: Byte-compile with warnings as errors + run: | + emacs --batch -L . \ + --eval '(setq byte-compile-error-on-warn t)' \ + -f batch-byte-compile \ + caml.el inf-caml.el caml-help.el caml-types.el \ + caml-font.el caml-font-old.el camldebug.el