TatriX / pomidor

Pomidor is a simple and cool pomodoro technique timer.
238 stars 17 forks source link

Derive pomidor from special-mode #17

Closed felipeochoa closed 6 years ago

felipeochoa commented 6 years ago

I think pomidor-mode should inherit from special-mode.

From the info manual:

The recommended way to define a new major mode is to derive it from an existing one using define-derived-mode. If there is no closely related mode, you should inherit from either text-mode, special-mode, or prog-mode. See Basic Major Modes. If none of these are suitable, you can inherit from fundamental-mode (see Major Modes).

special-mode doesn't add much behavior-wise; it's mostly just about convention. E.g., some tools enable/disable certain keybindings or hooks in special mode. My motivation for this PR is to have god-mode automatically disable itself in the *pomidor* buffer without having to special-case it. (god-mode disables itself in modes derived from special-mode automatically)

It also provides a central point (special-mode-map) for users to define their own keybindings for modes that aren't about editing text. (E.g., I use , in special modes to change buffers)

There are a couple of other benefits which you can read about here if interested. (Search for "special")

TatriX commented 6 years ago

Thank you!