Clean up module-level boilerplate#67
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 of a planned series of cleanup PRs ahead of larger modernization
work (
syntax-propertize-function,rx, keymap/menu split). Allchanges 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 thetop of the file with the other requires.
(require 'adoc-mode-tempo)and the(boundp ...)guards around the
compilation-error-regexp-alistintegration aregone, since
compile.elis now loaded eagerly.(adoc-calc)no longer runs at file load; it runs from the modeinitialization function, where it belongs.
adoc-mode-versionis now the interactive command directly (thesymbol already carried the version string via
defconst).adoc-show-versionis preserved as an obsolete alias.adoc-replacement-faileddefvar; the matcheruses a plain
(when o ...)instead of the setq/unless dance.:typeonadoc-default-title-typeandadoc-default-title-sub-typefrom open-endedintegerto achoicerestricted to 1 or 2.;; TODOcomments.All 55 tests still pass; byte-compile is clean.