[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/flymake-refactor 3b06b52 2/7: Adjust flymake's UI/
From: |
Jo�o T�vora |
Subject: |
[Emacs-diffs] scratch/flymake-refactor 3b06b52 2/7: Adjust flymake's UI/backend split started in earlier commit |
Date: |
Wed, 23 Aug 2017 19:52:57 -0400 (EDT) |
branch: scratch/flymake-refactor
commit 3b06b524ed309d0b092b552c4909823333e3da66
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Adjust flymake's UI/backend split started in earlier commit
A previous commit of 2017-08-17, titled "Split flymake.el into
flymake-proc.el and flymake-ui.el" still left some definitions in the
wrong file, so ensure that nothing in flymake-ui.el needs anything in
flymake-proc.el, and reduce the number of things that the latter needs
to know about the former.
Also, the earlier commit prematurely renamed the interactive command
flymake-start-syntax-check to flymake-proc-start-syntax-check and also
the function flymake-can-syntax-check-buffer to
flymake-proc-can-syntax-check-buffer. Undo that, leave it for a
future commit.
* lisp/progmodes/flymake-ui.el (flymake-new-err-info): Move to
flymake-proc.el. (flymake-fix-line-numbers): Move from
flymake-proc.el. (flymake--start-syntax-check): Set
`flymake-check-start-time'.
* lisp/progmodes/flymake-proc.el (flymake-fix-line-numbers): Move to
flymake-ui.el. (flymake-start-syntax-check): Rename to original name
from `flymake-proc-start-syntax-check'.
(flymake-start-syntax-check-process): Don't set
flymake-check-start-time. (flymake-backends): Use
`flymake-start-syntax-check'. (flymake-new-err-info): Move from
flymake-ui.el
---
lisp/progmodes/flymake-proc.el | 32 +++++++-------------------------
lisp/progmodes/flymake-ui.el | 24 +++++++++++++++++++++---
2 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el
index 3055555..56b1078 100644
--- a/lisp/progmodes/flymake-proc.el
+++ b/lisp/progmodes/flymake-proc.el
@@ -120,7 +120,7 @@ NAME is the file name function to use, default
`flymake-get-real-file-name'."
(flymake-log 3 "file %s, init=%s" file-name (car mode-and-masks))
mode-and-masks))
-(defun flymake-proc-can-syntax-check-buffer ()
+(defun flymake-can-syntax-check-buffer ()
"Determine whether we can syntax check current buffer.
Return nil if we cannot, non-nil if
we can."
@@ -480,6 +480,9 @@ It's flymake process filter."
(flymake-parse-err-lines
flymake-new-err-info lines))))
+(defvar-local flymake-new-err-info nil
+ "Same as `flymake-err-info', effective when a syntax check is in progress.")
+
(defun flymake-parse-residual ()
"Parse residual if it's non empty."
(when flymake-output-residual
@@ -489,26 +492,6 @@ It's flymake process filter."
(list flymake-output-residual)))
(setq flymake-output-residual nil)))
-(defun flymake-fix-line-numbers (err-info-list min-line max-line)
- "Replace line numbers with fixed value.
-If line-numbers is less than MIN-LINE, set line numbers to MIN-LINE.
-If line numbers is greater than MAX-LINE, set line numbers to MAX-LINE.
-The reason for this fix is because some compilers might report
-line number outside the file being compiled."
- (let* ((count (length err-info-list))
- (err-info nil)
- (line 0))
- (while (> count 0)
- (setq err-info (nth (1- count) err-info-list))
- (setq line (flymake-er-get-line err-info))
- (when (or (< line min-line) (> line max-line))
- (setq line (if (< line min-line) min-line max-line))
- (setq err-info-list (flymake-set-at err-info-list (1- count)
- (flymake-er-make-er line
-
(flymake-er-get-line-err-info-list err-info)))))
- (setq count (1- count))))
- err-info-list)
-
(defun flymake-parse-err-lines (err-info-list lines)
"Parse err LINES, store info in ERR-INFO-LIST."
(let* ((count (length lines))
@@ -716,7 +699,7 @@ Return its components if so, nil otherwise."
(error
(flymake-log 1 "Failed to delete dir %s, error ignored" dir-name))))
-(defun flymake-proc-start-syntax-check ()
+(defun flymake-start-syntax-check ()
"Start syntax checking for current buffer."
(interactive)
(flymake-log 3 "flymake is running: %s" flymake-is-running)
@@ -759,7 +742,6 @@ Return its components if so, nil otherwise."
(setq flymake-is-running t)
(setq flymake-last-change-time nil)
- (setq flymake-check-start-time (float-time))
(flymake-report-status nil "*")
(flymake-log 2 "started process %d, command=%s, dir=%s"
@@ -1089,9 +1071,9 @@ Use CREATE-TEMP-F for creating temp copy."
;;;; Hook onto flymake-ui
(add-to-list 'flymake-backends
- `(flymake-proc-can-syntax-check-buffer
+ `(flymake-can-syntax-check-buffer
.
- flymake-proc-start-syntax-check))
+ flymake-start-syntax-check))
(provide 'flymake-proc)
;;; flymake-proc.el ends here
diff --git a/lisp/progmodes/flymake-ui.el b/lisp/progmodes/flymake-ui.el
index dd09b88..a0864b5 100644
--- a/lisp/progmodes/flymake-ui.el
+++ b/lisp/progmodes/flymake-ui.el
@@ -133,9 +133,6 @@ more morose operations, possibly asynchronously." :group
(defvar-local flymake-err-info nil
"Sorted list of line numbers and lists of err info in the form (file,
err-text).")
-(defvar-local flymake-new-err-info nil
- "Same as `flymake-err-info', effective when a syntax check is in progress.")
-
(defun flymake-log (level text &rest args)
"Log a message at level LEVEL.
If LEVEL is higher than `flymake-log-level', the message is
@@ -452,6 +449,26 @@ For the format of LINE-ERR-INFO, see
`flymake-ler-make-ler'."
(flymake-log 0 "switched OFF Flymake mode for buffer %s due to fatal status
%s, warning %s"
(buffer-name) status warning))
+(defun flymake-fix-line-numbers (err-info-list min-line max-line)
+ "Replace line numbers with fixed value.
+If line-numbers is less than MIN-LINE, set line numbers to MIN-LINE.
+If line numbers is greater than MAX-LINE, set line numbers to MAX-LINE.
+The reason for this fix is because some compilers might report
+line number outside the file being compiled."
+ (let* ((count (length err-info-list))
+ (err-info nil)
+ (line 0))
+ (while (> count 0)
+ (setq err-info (nth (1- count) err-info-list))
+ (setq line (flymake-er-get-line err-info))
+ (when (or (< line min-line) (> line max-line))
+ (setq line (if (< line min-line) min-line max-line))
+ (setq err-info-list (flymake-set-at err-info-list (1- count)
+ (flymake-er-make-er line
+
(flymake-er-get-line-err-info-list err-info)))))
+ (setq count (1- count))))
+ err-info-list)
+
(defvar-local flymake--backend nil
"The currently active backend selected by `flymake-mode'")
@@ -462,6 +479,7 @@ For the format of LINE-ERR-INFO, see
`flymake-ler-make-ler'."
(throw 'done (cdr candidate))))))
(defun flymake--start-syntax-check ()
+ (setq flymake-check-start-time (float-time))
(funcall flymake--backend))
;;;###autoload
- [Emacs-diffs] branch scratch/flymake-refactor created (now fea31e2), Jo�o T�vora, 2017/08/23
- [Emacs-diffs] scratch/flymake-refactor e7e9d4f 1/7: Fix flymake-backends defcustom's docstring and usage, Jo�o T�vora, 2017/08/23
- [Emacs-diffs] scratch/flymake-refactor b30fb9c 3/7: Allow running flymake-tests.el from interactive sessions, Jo�o T�vora, 2017/08/23
- [Emacs-diffs] scratch/flymake-refactor dc39d65 4/7: flymake-ui.el provides new flymake-report as a re-entry point for backends., Jo�o T�vora, 2017/08/23
- [Emacs-diffs] scratch/flymake-refactor 3b06b52 2/7: Adjust flymake's UI/backend split started in earlier commit,
Jo�o T�vora <=
- [Emacs-diffs] scratch/flymake-refactor 740572e 5/7: Completely rewrite flymake's subprocess output processing, Jo�o T�vora, 2017/08/23
- [Emacs-diffs] scratch/flymake-refactor fea31e2 7/7: Rename many flymake-proc.el symbols with internal "--" prefixes, Jo�o T�vora, 2017/08/23
- [Emacs-diffs] scratch/flymake-refactor 6bf3a42 6/7: Move symbols in flymake-proc.el to separate namespace, Jo�o T�vora, 2017/08/23