bug-gnu-emacs
[Top][All Lists]
Advanced

[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: Tue, 19 Mar 2019 22:46:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> It looks good to me.  I just have a suggestion and would like
> to see the commit msg, too.

Please see the patch with the commit msg attached.

>> > -(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)
>
> I think we should change this to default to nil.
>
> I would even go as far as obsoleting the variable entirely, and
> use make-obsolete-variable instead: there's no real reason
> why newline should be given special treatment.  And users
> that need this for some obscure reason can probably plug it
> in post-self-insert-hook.

Maybe, I have no opinion about this.

> If you obsolete the variable, you can remove it from the
> manual, too.

I forgot that it was documented in the manual, so I added its
renaming in the manual to the patch too:

>From 910081f77a65a7758c27ee9a74f20e74596b6697 Wed Feb 17 00:00:00 2019
From: Juri Linkov <juri@linkov.net>
Date: Wed, 17 Feb 2019 22:10:20 +0200
Subject: [PATCH] * lisp/progmodes/flymake.el: Rename flymake-start-on-newline.
To: 34294@debbugs.gnu.org

* lisp/progmodes/flymake.el (flymake-start-on-newline): Rename from
flymake-start-syntax-check-on-newline.
(flymake-start-syntax-check-on-newline): Define obsolete alias.
(flymake-no-changes-timeout): Add customization option nil.
(Bug#34294)
---
 etc/TODO                  |  9 ---------
 lisp/progmodes/flymake.el | 35 +++++++++++++++++++----------------
 2 files changed, 19 insertions(+), 25 deletions(-)

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/doc/misc/flymake.texi b/doc/misc/flymake.texi
index 894203ca5a..4608d1c973 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -89,7 +89,7 @@ Using Flymake
 
 @item
 a newline character is added to the buffer, unless
-@code{flymake-start-syntax-check-on-newline} is nil;
+@code{flymake-start-on-newline} is nil;
 
 @item
 some changes were made to the buffer more than @code{0.5} seconds ago
@@ -222,7 +222,7 @@ Customizable variables
 started after this many seconds, unless the user makes another change,
 which resets the timer.
 
-@item flymake-start-syntax-check-on-newline
+@item flymake-start-on-newline
 A boolean flag indicating whether to start syntax check immediately
 after a newline character is inserted into the buffer.
 
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)))
-- 
2.17.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]