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: Mon, 06 May 2019 23:15:16 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> Anyway, your initiative got my attention.  Do you remember what I
> wrote previously?
>
>> [jt] 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.
>
>> If you obsolete the variable, you can remove it from the
>> manual, too.
>
> I still think this is the best option, so if you didn't already push that,
> I would be thankful that you do. It should solve your issue and make
> the code and manual simpler.

I had doubts about removing it, but since you are sure about this,
then please see the following patch attached.  If basically this is ok,
I'll also change the manual, NEWS, etc.

> And maybe consider opening different bugs for the other issues?

I'll try to keep one report per bug.
So I opened a separate bug#35592 for Martin
with a complete scenario to reproduce another bug.

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index abe2933c10..82d65c1d76 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -38,9 +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-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-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
@@ -177,17 +177,13 @@ flymake-fringe-indicator-position
                 (const right-fringe)
                 (const :tag "No fringe indicators" nil)))
 
-(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)
+(make-obsolete-variable 'flymake-start-syntax-check-on-newline
+                       "can probably plug it in post-self-insert-hook"
+                        "27.1")
 
 (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.
-You may also want to disable `flymake-start-on-newline'."
+If nil, never start checking buffer automatically like this."
   :type '(choice (number :tag "Timeout in seconds")
                  (const :tag "No check on timeout" nil)))
 
@@ -947,9 +943,8 @@ flymake-mode
 
 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.
+`flymake-no-changes-timeout' 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
@@ -1043,9 +1038,6 @@ 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-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)))
 
 (defun flymake-after-save-hook ()

reply via email to

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