[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 2dd9e04 24/3
From: |
João Távora |
Subject: |
[Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 2dd9e04 24/39: Add interactive flymake-start function |
Date: |
Mon, 2 Oct 2017 20:12:24 -0400 (EDT) |
branch: scratch/flymake-refactor-cleaner-for-emacs-26
commit 2dd9e043f5f9561b339c130b8d3d0a929a49efd9
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Add interactive flymake-start function
* lisp/progmodes/flymake.el (flymake-on-timer-event)
(flymake-after-change-function, flymake-mode): Call
flymake-start.
(flymake-start): Rename from flymake--start-syntax-check.
---
lisp/progmodes/flymake.el | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 14947a5..01acb2a 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -465,7 +465,7 @@ associated `flymake-category' return DEFAULT."
(setq flymake-last-change-time nil)
(flymake-log :debug "starting syntax check after no changes for some
time")
- (flymake--start-syntax-check)))))
+ (flymake-start)))))
(define-obsolete-function-alias 'flymake-display-err-menu-for-current-line
'flymake-popup-current-error-menu "24.4")
@@ -595,15 +595,22 @@ sources."
err)
(flymake--stop-backend backend))))
-(defun flymake--start-syntax-check (&optional deferred)
+(defun flymake-start (&optional deferred interactive)
"Start a syntax check.
Start it immediately, or after current command if DEFERRED is
-non-nil."
+non-nil. With optional INTERACTIVE or interactively, clear any
+stale information about running and automatically disabled
+backends."
+ (interactive (list nil t))
(cl-labels
((start
()
(remove-hook 'post-command-hook #'start 'local)
(setq flymake-check-start-time (float-time))
+ (when interactive
+ (setq flymake--diagnostics-table (make-hash-table)
+ flymake--running-backends nil
+ flymake--disabled-backends nil))
(dolist (backend flymake-diagnostic-functions)
(cond ((memq backend flymake--running-backends)
(flymake-log :debug "Backend %s still running, not restarting"
@@ -639,7 +646,7 @@ non-nil."
(setq flymake--diagnostics-table (make-hash-table))
(when flymake-start-syntax-check-on-find-file
- (flymake--start-syntax-check)))))
+ (flymake-start)))))
;; Turning the mode OFF.
(t
@@ -669,13 +676,13 @@ non-nil."
(let((new-text (buffer-substring start stop)))
(when (and flymake-start-syntax-check-on-newline (equal new-text "\n"))
(flymake-log :debug "starting syntax check as new-line has been seen")
- (flymake--start-syntax-check 'deferred))
+ (flymake-start 'deferred))
(setq flymake-last-change-time (float-time))))
(defun flymake-after-save-hook ()
(when flymake-mode
(flymake-log :debug "starting syntax check as buffer was saved")
- (flymake--start-syntax-check))) ; no more mode 3. cannot start check if
mode 3 (to temp copies) is active - (???)
+ (flymake-start)))
(defun flymake-kill-buffer-hook ()
(when flymake-timer
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 79867d3 06/39: Allow running flymake-tests.el from interactive sessions, (continued)
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 79867d3 06/39: Allow running flymake-tests.el from interactive sessions, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 555bea3 11/39: Protect against timer triggers when no flymake-mode, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 da45044 09/39: Flymake's flymake-proc.el parses column numbers from gcc/javac errors, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 9357120 13/39: Echo Flymake error messages when navigating errors interactively, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 86a4f30 07/39: Refactor flymake-tests.el in preparation for more tests, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 8f50239 12/39: Add a new Flymake test for multiple errors and warnings, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 4f7d568 14/39: Flymake checks file names before considering diagnostics, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 0a4e420 16/39: Protect Flymake's eager checks against commands like fill-paragraph, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 c8004c6 03/39: Completely rewrite Flymake's subprocess output processing, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 2b48161 21/39: Tweak Flymake commands flymake-goto-[next/prev]-error, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 2dd9e04 24/39: Add interactive flymake-start function,
João Távora <=
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 a458e1a 26/39: Treat flymake errors as just another type of diagnostic, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 4ae24d7 20/39: Flymake's flymake-proc.el backend slightly easier to debug, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 4d6d56d 27/39: Remove old flymake-display-err-menu-for-current-line, it's useless, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 ef67227 29/39: Explicitly add a(n empty) keymap for Flymake, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 2b735b4 08/39: New Flymake variable flymake-diagnostic-types-alist and much cleanup, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 2971cd0 38/39: Minimal tweak as an attempt to future-proof Flymake API, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 c1661fc 36/39: Hook Flymake onto proper checkdoc and byte-compile interfaces, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 38fdbd6 34/39: Capitalize "Flymake" in docstrings and comments, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 b80d29d 39/39: Start rewriting Flymake manual, João Távora, 2017/10/02
- [Emacs-diffs] scratch/flymake-refactor-cleaner-for-emacs-26 b4099cb 18/39: New Flymake API variable flymake-diagnostic-functions, João Távora, 2017/10/02