Skip to content

Clean up module-level boilerplate#67

Merged
bbatsov merged 1 commit into
masterfrom
cleanup/phase-1-quick-wins
May 29, 2026
Merged

Clean up module-level boilerplate#67
bbatsov merged 1 commit into
masterfrom
cleanup/phase-1-quick-wins

Conversation

@bbatsov
Copy link
Copy Markdown
Owner

@bbatsov bbatsov commented May 29, 2026

Phase 1 of a planned series of cleanup PRs ahead of larger modernization
work (syntax-propertize-function, rx, keymap/menu split). All
changes here are internal-only refactors with no user-visible behavior
change beyond the documented deprecation of adoc-show-version.

  • (require 'adoc-mode-tempo) and (require 'compile) moved to the
    top of the file with the other requires.
  • The mid-file (require 'adoc-mode-tempo) and the (boundp ...)
    guards around the compilation-error-regexp-alist integration are
    gone, since compile.el is now loaded eagerly.
  • (adoc-calc) no longer runs at file load; it runs from the mode
    initialization function, where it belongs.
  • adoc-mode-version is now the interactive command directly (the
    symbol already carried the version string via defconst).
    adoc-show-version is preserved as an obsolete alias.
  • Dropped the unused adoc-replacement-failed defvar; the matcher
    uses a plain (when o ...) instead of the setq/unless dance.
  • Tightened :type on adoc-default-title-type and
    adoc-default-title-sub-type from open-ended integer to a
    choice restricted to 1 or 2.
  • Removed a handful of stale ;; TODO comments.

All 55 tests still pass; byte-compile is clean.

A handful of small, internal-only refactors that simplify the file
structure ahead of larger modernization work:

- Move (require 'adoc-mode-tempo) and (require 'compile) to the top
  of the file with the other requires; drop the mid-file require and
  the now-unneeded (boundp ...) guards around the compilation regex
  integration.
- Move (adoc-calc) from a top-level call into the mode initialization
  function, where it belongs.
- Rename adoc-show-version to adoc-mode-version (the version constant
  doubles as the interactive command, matching the existing idiom);
  adoc-show-version is preserved as an obsolete alias.
- Drop the unused adoc-replacement-failed defvar; the matcher uses a
  plain (when o ...) instead.
- Tighten :type on adoc-default-title-type and -sub-type to a choice
  restricted to 1 or 2, replacing the open-ended 'integer'.
- Delete stale TODO comments.
@bbatsov bbatsov merged commit 4a5e7bf into master May 29, 2026
8 checks passed
@bbatsov bbatsov deleted the cleanup/phase-1-quick-wins branch May 29, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant