mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-20 18:17:20 +00:00
Tweak Flymake autoloads and dependencies
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Add to flymake-diagnostic-functions here. * lisp/progmodes/flymake-elisp.el[top]: Don't add to emacs-lisp-mode-hook. Don't call flymake-elisp-setup-backends in every buffer. (flymake-elisp-checkdoc) (flymake-elisp-byte-compile): Autoload. (flymake-elisp-setup-backends): Remove. * lisp/progmodes/flymake.el: Add some top-level comments. (flymake-make-diagnostic) (flymake-mode, flymake-mode-on, flymake-mode-off): Add autoloads Where to fixup this shit?
This commit is contained in:
parent
5d3f8a8b80
commit
2e84179a29
@ -243,7 +243,9 @@ Blank lines separate paragraphs. Semicolons start comments.
|
||||
(add-hook 'xref-backend-functions #'elisp--xref-backend nil t)
|
||||
(setq-local project-vc-external-roots-function #'elisp-load-path-roots)
|
||||
(add-hook 'completion-at-point-functions
|
||||
#'elisp-completion-at-point nil 'local))
|
||||
#'elisp-completion-at-point nil 'local)
|
||||
(add-hook 'flymake-diagnostic-functions #'flymake-elisp-checkdoc nil t)
|
||||
(add-hook 'flymake-diagnostic-functions #'flymake-elisp-byte-compile nil t))
|
||||
|
||||
;; Font-locking support.
|
||||
|
||||
|
@ -20,7 +20,8 @@
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Flymake backends for elisp work.
|
||||
;; Flymake backends for elisp work, `flymake-elisp-checkdoc' and
|
||||
;; `flymake-elisp-byte-compile'.
|
||||
|
||||
;;; Code:
|
||||
(require 'flymake)
|
||||
@ -45,6 +46,7 @@
|
||||
(kill-buffer buf))))
|
||||
collected))
|
||||
|
||||
;;;###autoload
|
||||
(defun flymake-elisp-checkdoc (report-fn)
|
||||
"A Flymake backend for `checkdoc'.
|
||||
Calls REPORT-FN directly."
|
||||
@ -98,6 +100,7 @@ Calls REPORT-FN directly."
|
||||
(defvar-local flymake-elisp--byte-compile-process nil
|
||||
"Buffer-local process started for byte-compiling the buffer.")
|
||||
|
||||
;;;###autoload
|
||||
(defun flymake-elisp-byte-compile (report-fn)
|
||||
"A Flymake backend for elisp byte compilation.
|
||||
Spawn an Emacs process that byte-compiles a file representing the
|
||||
@ -177,18 +180,5 @@ Runs in a batch-mode Emacs. Interactively use variable
|
||||
(terpri)
|
||||
(pp collected)))
|
||||
|
||||
(defun flymake-elisp-setup-backends ()
|
||||
"Setup Flymake for elisp work."
|
||||
(add-hook 'flymake-diagnostic-functions 'flymake-elisp-checkdoc t t)
|
||||
(add-hook 'flymake-diagnostic-functions 'flymake-elisp-byte-compile t t))
|
||||
|
||||
(add-hook 'emacs-lisp-mode-hook
|
||||
'flymake-elisp-setup-backends)
|
||||
|
||||
(dolist (buffer (buffer-list))
|
||||
(with-current-buffer buffer
|
||||
(when (derived-mode-p 'emacs-lisp-mode)
|
||||
(flymake-elisp-setup-backends))))
|
||||
|
||||
(provide 'flymake-elisp)
|
||||
;;; flymake-elisp.el ends here
|
||||
|
@ -26,9 +26,21 @@
|
||||
;;
|
||||
;; Flymake is a minor Emacs mode performing on-the-fly syntax checks.
|
||||
;;
|
||||
;; Flymake collects diagnostic information for multiple sources,
|
||||
;; called backends, and visually annotates the relevant portions in
|
||||
;; the buffer.
|
||||
;;
|
||||
;; This file contains the UI for displaying and interacting with the
|
||||
;; results of such checks, as well as entry points for backends to
|
||||
;; hook on to. Backends are sources of diagnostic info.
|
||||
;; results produced by these backends, as well as entry points for
|
||||
;; backends to hook on to.
|
||||
;;
|
||||
;; The main entry points are `flymake-mode' and `flymake-start'
|
||||
;;
|
||||
;; The docstrings of these variabless are relevant to understanding how
|
||||
;; Flymake works for both the user and the backend programmer:
|
||||
;;
|
||||
;; * `flymake-diagnostic-functions'
|
||||
;; * `flymake-diagnostic-types-alist'
|
||||
;;
|
||||
;;; Code:
|
||||
|
||||
@ -195,6 +207,7 @@ generated it."
|
||||
(:constructor flymake--diag-make))
|
||||
buffer beg end type text backend)
|
||||
|
||||
;;;###autoload
|
||||
(defun flymake-make-diagnostic (buffer
|
||||
beg
|
||||
end
|
||||
@ -681,9 +694,8 @@ Interactively, with a prefix arg, FORCE is t."
|
||||
(start))))
|
||||
|
||||
(defvar flymake-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
map)
|
||||
"Keymap for `flymake-mode'.")
|
||||
(let ((map (make-sparse-keymap))) map)
|
||||
"Keymap for `flymake-mode'")
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode flymake-mode nil
|
||||
@ -770,7 +782,6 @@ Do it only if `flymake-no-changes-timeout' is non-nil."
|
||||
(cancel-timer flymake-timer)
|
||||
(setq flymake-timer nil)))
|
||||
|
||||
;;;###autoload
|
||||
(defun flymake-find-file-hook ()
|
||||
(unless (or flymake-mode
|
||||
(null flymake-diagnostic-functions))
|
||||
@ -956,11 +967,8 @@ applied."
|
||||
'(:propertize " "))
|
||||
(:propertize "]")))))))
|
||||
|
||||
|
||||
|
||||
|
||||
(provide 'flymake)
|
||||
|
||||
(require 'flymake-proc)
|
||||
(require 'flymake-elisp)
|
||||
|
||||
;;; flymake.el ends here
|
||||
|
Loading…
Reference in New Issue
Block a user