Function: midnight-mode

midnight-mode is an autoloaded, interactive and byte-compiled function defined in midnight.el.gz.

Signature

(midnight-mode &optional ARG)

Documentation

Non-nil means run midnight-hook at midnight.

This is a global minor mode. If called interactively, toggle the Midnight mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate (default-value \=midnight-mode)'.

The mode's hook is called both when the mode is enabled and when it is disabled.

View in manual

Probably introduced at or before Emacs version 20.3.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/midnight.el.gz
;;;###autoload
(define-minor-mode midnight-mode
  "Non-nil means run `midnight-hook' at midnight."
  :global t
  :initialize #'custom-initialize-default
  ;; Call `midnight-delay-set' again because it takes care of starting
  ;; the timer if the mode is on.  The ':initialize' function above
  ;; (which ends up calling `midnight-delay-set') did not know yet if
  ;; the mode was on or not.
  (defvar midnight-delay)
  (midnight-delay-set 'midnight-delay midnight-delay))