[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
From: |
Juri Linkov |
Subject: |
bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect |
Date: |
Sun, 17 Feb 2019 22:11:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
> Whatever you do to flymake.el, and I forgot to mention this earlier, you
> have to make sure it still loads and works in Emacs 26.1, because
> flymake.el is also distributed through ELPA.
Everything is done in the following patch that doesn't break old versions:
diff --git a/etc/TODO b/etc/TODO
index ccb82cd296..dc594a007e 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -143,15 +143,6 @@ See the 'test' directory for examples.
* Small but important fixes needed in existing features:
-** Flymake's customization mechanism needs to be both simpler (fewer
-levels of indirection) and better documented, so it is easier to
-understand. I find it quite hard to figure out what compilation
-command it will use.
-
-I suggest totally rewriting that part of Flymake, using the simplest
-mechanism that suffices for the specific needs. That will be easy
-for users to customize.
-
** Distribute a bar cursor of width > 1 evenly between the two glyphs
on each side of the bar (what to do at the edges?).
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 261e50a613..ddf12328da 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -4,7 +4,7 @@
;; Author: Pavel Kobyakov <pk_at_work@yahoo.com>
;; Maintainer: João Távora <joaotavora@gmail.com>
-;; Version: 1.0.5
+;; Version: 1.0.6
;; Package-Requires: ((emacs "26.1"))
;; Keywords: c languages tools
@@ -38,10 +38,9 @@
;; The main interactive entry point is the `flymake-mode' minor mode,
;; which periodically and automatically initiates checks as the user
;; is editing the buffer. The variables `flymake-no-changes-timeout',
-;; `flymake-start-syntax-check-on-newline' and
-;; `flymake-start-on-flymake-mode' give finer control over the events
-;; triggering a check, as does the interactive command
-;; `flymake-start', which immediately starts a check.
+;; `flymake-start-on-newline' and `flymake-start-on-flymake-mode'
+;; give finer control over the events triggering a check, as does the
+;; interactive command `flymake-start', which immediately starts a check.
;;
;; Shortly after each check, a summary of collected diagnostics should
;; appear in the mode-line. If it doesn't, there might not be a
@@ -178,14 +177,19 @@ flymake-fringe-indicator-position
(const right-fringe)
(const :tag "No fringe indicators" nil)))
-(defcustom flymake-start-syntax-check-on-newline t
+(define-obsolete-variable-alias 'flymake-start-syntax-check-on-newline
+ 'flymake-start-on-newline "27.1")
+
+(defcustom flymake-start-on-newline t
"Start syntax check if newline char was added/removed from the buffer."
:type 'boolean)
(defcustom flymake-no-changes-timeout 0.5
"Time to wait after last change before automatically checking buffer.
-If nil, never start checking buffer automatically like this."
- :type 'number)
+If nil, never start checking buffer automatically like this.
+You may also want to disable `flymake-start-on-newline'."
+ :type '(choice (number :tag "Timeout in seconds")
+ (const :tag "No check on timeout" nil)))
(defcustom flymake-gui-warnings-enabled t
"Enables/disables GUI warnings."
@@ -203,7 +207,7 @@ flymake-start-on-flymake-mode
:type 'boolean)
(defcustom flymake-start-on-save-buffer t
- "If non-nil start syntax check when a buffer is saved.
+ "If non-nil, start syntax check when a buffer is saved.
Specifically, start it when the saved buffer is actually displayed."
:version "27.1"
:type 'boolean)
@@ -939,12 +943,11 @@ flymake-mode
called backends, and visually annotates the buffer with the
results.
-Flymake performs these checks while the user is editing. The
-customization variables `flymake-start-on-flymake-mode',
-`flymake-no-changes-timeout' and
-`flymake-start-syntax-check-on-newline' determine the exact
-circumstances whereupon Flymake decides to initiate a check of
-the buffer.
+Flymake performs these checks while the user is editing.
+The customization variables `flymake-start-on-flymake-mode',
+`flymake-no-changes-timeout' and `flymake-start-on-newline'
+determine the exact circumstances whereupon Flymake decides
+to initiate a check of the buffer.
The commands `flymake-goto-next-error' and
`flymake-goto-prev-error' can be used to navigate among Flymake
@@ -1036,7 +1039,7 @@ flymake-after-change-function
START and STOP and LEN are as in `after-change-functions'."
(let((new-text (buffer-substring start stop)))
(push (list start stop new-text) flymake--recent-changes)
- (when (and flymake-start-syntax-check-on-newline (equal new-text "\n"))
+ (when (and flymake-start-on-newline (equal new-text "\n"))
(flymake-log :debug "starting syntax check as new-line has been seen")
(flymake-start t))
(flymake--schedule-timer-maybe)))