unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: "João Távora" <joaotavora@gmail.com>
Cc: 34294@debbugs.gnu.org
Subject: bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
Date: Mon, 06 May 2019 23:15:16 +0300	[thread overview]
Message-ID: <87lfzjqqzv.fsf@mail.linkov.net> (raw)
In-Reply-To: <CALDnm52Qy7iJfwWZWYDgNi9JHPXoA+L9y8uzoRHec7wQJ2KDsQ@mail.gmail.com> ("João Távora"'s message of "Mon, 6 May 2019 00:02:38 +0100")

[-- Attachment #1: Type: text/plain, Size: 1017 bytes --]

> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: obsolete-flymake-start-syntax-check-on-newline.patch --]
[-- Type: text/x-diff, Size: 2901 bytes --]

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	other threads:[~2019-05-06 20:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-02 21:30 bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect Juri Linkov
2019-02-02 22:40 ` João Távora
2019-02-03 20:42   ` Juri Linkov
2019-02-03 22:10     ` João Távora
2019-02-04 21:24       ` Juri Linkov
2019-02-04 22:41         ` João Távora
2019-02-17 20:11           ` Juri Linkov
2019-03-18 21:10             ` Juri Linkov
2019-03-18 21:43               ` João Távora
2019-03-19 20:46                 ` Juri Linkov
2019-03-27 21:38                   ` Juri Linkov
2019-04-17 20:29                     ` Juri Linkov
2019-04-18 11:36                       ` João Távora
2019-04-18 20:42                         ` Juri Linkov
2019-04-19  6:35                           ` Eli Zaretskii
2019-04-24 20:25                             ` Juri Linkov
2019-04-25  5:46                               ` Eli Zaretskii
2019-04-25  8:07                               ` martin rudalics
2019-04-29 20:15                                 ` Juri Linkov
2019-05-01  8:29                                   ` martin rudalics
2019-05-01 21:10                                     ` Juri Linkov
2019-05-04 17:34                                       ` martin rudalics
2019-05-04 21:16                                         ` Juri Linkov
2019-05-05  9:04                                           ` martin rudalics
2019-05-05 22:46                                             ` Richard Stallman
2019-05-05 23:09                                               ` João Távora
2019-05-05 20:08 ` Juri Linkov
2019-05-05 23:02   ` João Távora
2019-05-06 20:15     ` Juri Linkov [this message]
2019-05-07 20:29       ` Juri Linkov
2019-05-07 23:10         ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfzjqqzv.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=34294@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).