Don't name your file x-mode.el
if it does not actually provide a mode of some sort: that seems confusing. If you are providing library x
, just call the file x.el
.
From what I've seen, most modes (major or minor) do not actually use x-mode.el
either. That naming convention is generally used in multi-file packages where the core functionality is implemented in one or more separate files, and then the x-mode.el
file contains only the actual mode definition and perhaps related customization definitions.
The other typical usage I've found is for programming language modes. Emacs itself has a number of these, but file names are not consistent: see e.g. perl-mode.el and ruby-mode.el, vs. prolog.el and python.el.
But of course naming is subjective -- for any convention you'll be able to find counter-examples.
(Anecdotally I have about 65 packages installed at the moment and found 7 files named foo-mode.el. My Emacs installation has 48 such files, many of which are in progmodes or textmodes; and many of which follow the pattern where there is a library file + a mode file, e.g. help.el/help-model.el, calc.el/calc-mode.el, etc).