summaryrefslogtreecommitdiff
path: root/lisp/progmodes/flymake.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/flymake.el')
-rw-r--r--lisp/progmodes/flymake.el37
1 files changed, 19 insertions, 18 deletions
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 5d96c62b418..77a807f21ae 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -284,17 +284,17 @@ If set to nil, don't suppress any zero counters."
(defmacro flymake-log (level msg &rest args)
"Log, at level LEVEL, the message MSG formatted with ARGS.
LEVEL is passed to `display-warning', which is used to display
-the warning. If this form is included in a byte-compiled file,
+the warning. If this form is included in a file,
the generated warning contains an indication of the file that
generated it."
- (let* ((compile-file (and (boundp 'byte-compile-current-file)
- (symbol-value 'byte-compile-current-file)))
- (sublog (if (and
- compile-file
- (not load-file-name))
+ (let* ((file (if (fboundp 'macroexp-file-name)
+ (macroexp-file-name)
+ (and (not load-file-name)
+ (bound-and-true-p byte-compile-current-file))))
+ (sublog (if file
(intern
(file-name-nondirectory
- (file-name-sans-extension compile-file))))))
+ (file-name-sans-extension file))))))
`(flymake--log-1 ,level ',sublog ,msg ,@args)))
(defun flymake-error (text &rest args)
@@ -483,7 +483,7 @@ Currently, Flymake may provide these keyword-value pairs:
* `:recent-changes', a list of recent changes since the last time
the backend function was called for the buffer. An empty list
- indicates that no changes have been reocrded. If it is the
+ indicates that no changes have been recorded. If it is the
first time that this backend function is called for this
activation of `flymake-mode', then this argument isn't provided
at all (i.e. it's not merely nil).
@@ -741,7 +741,10 @@ to handle a report even if TOKEN was not expected. REGION is
a (BEG . END) pair of buffer positions indicating that this
report applies to that region."
(let* ((state (gethash backend flymake--backend-state))
- (first-report (not (flymake--backend-state-reported-p state))))
+ first-report)
+ (unless state
+ (error "Can't find state for %s in `flymake--backend-state'" backend))
+ (setf first-report (not (flymake--backend-state-reported-p state)))
(setf (flymake--backend-state-reported-p state) t)
(let (expected-token
new-diags)
@@ -1198,7 +1201,6 @@ default) no filter is applied."
'(" " flymake-mode-line-title flymake-mode-line-exception
flymake-mode-line-counters)
"Mode line construct for customizing Flymake information."
- :group 'flymake
:type '(repeat (choice string symbol)))
(defcustom flymake-mode-line-counter-format
@@ -1210,7 +1212,6 @@ default) no filter is applied."
This is a suitable place for placing the `flymake-error-counter',
`flymake-warning-counter' and `flymake-note-counter' constructs.
Separating each of these with space is not necessary."
- :group 'flymake
:type '(repeat (choice string symbol)))
(defvar flymake-mode-line-title '(:eval (flymake--mode-line-title))
@@ -1244,13 +1245,13 @@ correctly.")
"Flymake"
mouse-face mode-line-highlight
help-echo
- (lambda (&rest whatever)
- (concat
- (format "%s known backends\n" (hash-table-count flymake--backend-state))
- (format "%s running\n" (length (flymake-running-backends)))
- (format "%s disabled\n" (length (flymake-disabled-backends)))
- "mouse-1: Display minor mode menu\n"
- "mouse-2: Show help for minor mode"))
+ ,(lambda (&rest _)
+ (concat
+ (format "%s known backends\n" (hash-table-count flymake--backend-state))
+ (format "%s running\n" (length (flymake-running-backends)))
+ (format "%s disabled\n" (length (flymake-disabled-backends)))
+ "mouse-1: Display minor mode menu\n"
+ "mouse-2: Show help for minor mode"))
keymap
,(let ((map (make-sparse-keymap)))
(define-key map [mode-line down-mouse-1]