diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 69eac56..cbd7dd5 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -1322,12 +1322,30 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'." :group 'flymake :type 'boolean) +(defvar flymake-prefix-map + (let ((map (make-sparse-keymap))) + (define-key map "s" 'flymake-start-syntax-check) + (define-key map "n" 'flymake-goto-next-error) + (define-key map "p" 'flymake-goto-prev-error) + (define-key map "m" 'flymake-display-err-menu-for-current-line) + map)) + +(defvar flymake-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-c;" flymake-prefix-map) + map) + "The keymap provides the default flymake-mode bindings.") + +(defvar flymake-mode-hook nil + "Mode hook for `flymake-mode`. This hook is run __before__ +syntax check happens, but after all the initialization is done.") + ;;;###autoload (define-minor-mode flymake-mode "Minor mode to do on-the-fly syntax checking. When called interactively, toggles the minor mode. With arg, turn Flymake mode on if and only if arg is positive." - :group 'flymake :lighter flymake-mode-line + :group 'flymake :lighter flymake-mode-line :keymap flymake-mode-map (cond ;; Turning the mode ON. @@ -1344,6 +1362,8 @@ With arg, turn Flymake mode on if and only if arg is positive." (setq flymake-timer (run-at-time nil 1 'flymake-on-timer-event (current-buffer))) + (run-hooks 'flymake-mode-hook) + (when flymake-start-syntax-check-on-find-file (flymake-start-syntax-check))))