* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
@ 2019-02-02 21:30 Juri Linkov
2019-02-02 22:40 ` João Távora
2019-05-05 20:08 ` Juri Linkov
0 siblings, 2 replies; 31+ messages in thread
From: Juri Linkov @ 2019-02-02 21:30 UTC (permalink / raw)
To: 34294; +Cc: jo�o t�vora
X-Debbugs-CC: João Távora <joaotavora@gmail.com>
I have flymake-start-on-save-buffer customized to 't' to check syntax
only when a buffer is saved, but it still checks the unfinished work
while edits are in progress, showing the errors that make no sense
until the buffer is saved, even when flymake-start-syntax-check-on-newline
and flymake-start-on-flymake-mode are nil.
Is it possible to customize flymake to kick in only on saving?
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
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-05-05 20:08 ` Juri Linkov
1 sibling, 1 reply; 31+ messages in thread
From: João Távora @ 2019-02-02 22:40 UTC (permalink / raw)
To: Juri Linkov; +Cc: 34294
On Sat, Feb 2, 2019 at 9:33 PM Juri Linkov <juri@linkov.net> wrote:
>
> X-Debbugs-CC: João Távora <joaotavora@gmail.com>
>
> I have flymake-start-on-save-buffer customized to 't' to check syntax
> only when a buffer is saved, but it still checks the unfinished work
> while edits are in progress, showing the errors that make no sense
> until the buffer is saved
They "make sense" if you were to interpret/compile the buffer's
contents at that moment. It's called fly-make for a reason ;-).
> , even when flymake-start-syntax-check-on-newline
> and flymake-start-on-flymake-mode are nil.
> Is it possible to customize flymake to kick in only on saving?
You can set flymake-no-changes-timeout to nil. See its docstring.
If that works, you can probably close this bug.
--
João Távora
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
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
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-02-03 20:42 UTC (permalink / raw)
To: João Távora; +Cc: 34294
>> I have flymake-start-on-save-buffer customized to 't' to check syntax
>> only when a buffer is saved, but it still checks the unfinished work
>> while edits are in progress, showing the errors that make no sense
>> until the buffer is saved
>
> They "make sense" if you were to interpret/compile the buffer's
> contents at that moment. It's called fly-make for a reason ;-).
I just want flymake to fly a little lower ;-)
>> , even when flymake-start-syntax-check-on-newline
>> and flymake-start-on-flymake-mode are nil.
>> Is it possible to customize flymake to kick in only on saving?
>
> You can set flymake-no-changes-timeout to nil. See its docstring.
>
> If that works, you can probably close this bug.
Thanks, I'll try to set flymake-no-changes-timeout to nil.
Meanwhile, a few additional suggestions:
1. The defcustom definition of flymake-no-changes-timeout
currently doesn't allow customizing its value to nil,
because it's type is only 'number. It could provide
an option for `nil'.
2. Naming inconsistency - there are following customizable variables:
(defcustom flymake-start-on-flymake-mode t
(defcustom flymake-start-on-save-buffer t
(defcustom flymake-start-syntax-check-on-newline t
The last is unnecessary long and could be simplified to just:
(defcustom flymake-start-on-newline t
Please compare it with another variable already renamed with:
(define-obsolete-variable-alias 'flymake-start-syntax-check-on-find-file
'flymake-start-on-flymake-mode "26.1")
3. Maybe the documentation could be improved with the docstring of
flymake-start-on-save-buffer having a hint about disabling
flymake-no-changes-timeout?
For example, etc/TODO has such entry:
** 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.
4. Also I found these related entries in the same etc/TODO file:
** Display something in the margin on lines that have compilation errors.
** Allow fringe indicators to display a tooltip (provide a help-echo property?)
What do you think about displaying a tooltip on the fringe indicator
with the same text that is displayed on the tooltip over the location
of the error in the source buffer? It's easier to hover on the fringe
than finding the location in the buffer to hover.
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-02-03 20:42 ` Juri Linkov
@ 2019-02-03 22:10 ` João Távora
2019-02-04 21:24 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: João Távora @ 2019-02-03 22:10 UTC (permalink / raw)
To: Juri Linkov; +Cc: 34294
Juri Linkov <juri@linkov.net> writes:
>>> I have flymake-start-on-save-buffer customized to 't' to check syntax
>>> only when a buffer is saved, but it still checks the unfinished work
>>> while edits are in progress, showing the errors that make no sense
>>> until the buffer is saved
>>
>> They "make sense" if you were to interpret/compile the buffer's
>> contents at that moment. It's called fly-make for a reason ;-).
>
> I just want flymake to fly a little lower ;-)
OK, no problem.
> 1. The defcustom definition of flymake-no-changes-timeout
> currently doesn't allow customizing its value to nil,
> because it's type is only 'number. It could provide
> an option for `nil'.
A patch is welcome to to fix this.
> 2. Naming inconsistency - there are following customizable variables:
>
> (defcustom flymake-start-on-flymake-mode t
> (defcustom flymake-start-on-save-buffer t
> (defcustom flymake-start-syntax-check-on-newline t
>
> The last is unnecessary long and could be simplified to just:
>
> (defcustom flymake-start-on-newline t
>
> Please compare it with another variable already renamed with:
>
> (define-obsolete-variable-alias 'flymake-start-syntax-check-on-find-file
> 'flymake-start-on-flymake-mode "26.1")
A second patch is welcome to fix this too. Please use obsolete variable
aliases, as you suggested. I trust you will choose good names.
> 3. Maybe the documentation could be improved with the docstring of
> flymake-start-on-save-buffer having a hint about disabling
> flymake-no-changes-timeout?
>
> For example, etc/TODO has such entry:
>
> ** 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.
That is probably obsolete and can be erased. My flymake.el redesign
should have taken care of that, and is documented in the Flymake info
node. If you feel it is sufficient documentation, a third patch is
welcome to remove that TODO entry.
> 4. Also I found these related entries in the same etc/TODO file:
>
> ** Display something in the margin on lines that have compilation
> errors.
Flymake does this, even though it uses the fringe by default, but I
don't have more clues to what the author of this line intended.
> ** Allow fringe indicators to display a tooltip (provide a help-echo
> property?)
I think this is a more generic wish and is not strictly Flymake related.
> What do you think about displaying a tooltip on the fringe indicator
> with the same text that is displayed on the tooltip over the location
> of the error in the source buffer? It's easier to hover on the fringe
> than finding the location in the buffer to hover.
I don't have any strong opinion. It's fine, I guess, but not
specifically tied to Flymake. It may be difficult to implement. BTW
you can use flymake-goto-next-error and flymake-goto-prev-error to
navigate between errors, it's what I use all the time.
So to summarize, it'd be great if you could provide the three patches to
implement the suggestions you gave.
João
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
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
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-02-04 21:24 UTC (permalink / raw)
To: João Távora; +Cc: 34294
>> 4. Also I found these related entries in the same etc/TODO file:
>>
>> ** Display something in the margin on lines that have compilation
>> errors.
>
> Flymake does this, even though it uses the fringe by default, but I
> don't have more clues to what the author of this line intended.
I guess this is exactly what Flymake already does.
>> What do you think about displaying a tooltip on the fringe indicator
>> with the same text that is displayed on the tooltip over the location
>> of the error in the source buffer? It's easier to hover on the fringe
>> than finding the location in the buffer to hover.
>
> I don't have any strong opinion. It's fine, I guess, but not
> specifically tied to Flymake. It may be difficult to implement.
Yes, this is a more general feature. I could look at how easy it
would be to implement, and later to use in Flymake.
> BTW you can use flymake-goto-next-error and flymake-goto-prev-error to
> navigate between errors, it's what I use all the time.
Thanks for the suggestion. I could also look how easy to integrate
flymake-goto-next-error into the more general next-error framework that
provides easy to type keybindings.
> So to summarize, it'd be great if you could provide the three patches to
> implement the suggestions you gave.
OK, I'll provide these three patches. But first please look at my feedback
on your suggestion to set flymake-no-changes-timeout to nil: after trying it,
I see that it helps me, but also it requires setting
flymake-start-syntax-check-on-newline to nil, because otherwise
syntax check is started on an unsaved buffer when yanking text
that contains newlines.
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-02-04 21:24 ` Juri Linkov
@ 2019-02-04 22:41 ` João Távora
2019-02-17 20:11 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: João Távora @ 2019-02-04 22:41 UTC (permalink / raw)
To: Juri Linkov; +Cc: 34294
Juri Linkov <juri@linkov.net> writes:
>>> 4. Also I found these related entries in the same etc/TODO file:
>>>
>>> ** Display something in the margin on lines that have compilation
>>> errors.
>>
>> Flymake does this, even though it uses the fringe by default, but I
>> don't have more clues to what the author of this line intended.
>
> I guess this is exactly what Flymake already does.
Then maybe remove it in a fourth patch?
>>> What do you think about displaying a tooltip on the fringe indicator
>>> with the same text that is displayed on the tooltip over the location
>>> of the error in the source buffer? It's easier to hover on the fringe
>>> than finding the location in the buffer to hover.
>>
>> I don't have any strong opinion. It's fine, I guess, but not
>> specifically tied to Flymake. It may be difficult to implement.
>
> Yes, this is a more general feature. I could look at how easy it
> would be to implement, and later to use in Flymake.
Fine by me. I would personally concentrate efforts elsewhere, but you
get to work whereever you prefer.
>> BTW you can use flymake-goto-next-error and flymake-goto-prev-error to
>> navigate between errors, it's what I use all the time.
>
> Thanks for the suggestion. I could also look how easy to integrate
> flymake-goto-next-error into the more general next-error framework that
> provides easy to type keybindings.
This would be quite welcome, especially since I think there are
revent improvements to the next-error framework.
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.
Fifth patch.
>> So to summarize, it'd be great if you could provide the three patches to
>> implement the suggestions you gave.
>
> OK, I'll provide these three patches. But first please look at my feedback
> on your suggestion to set flymake-no-changes-timeout to nil: after trying it,
> I see that it helps me, but also it requires setting
> flymake-start-syntax-check-on-newline to nil, because otherwise
> syntax check is started on an unsaved buffer when yanking text
> that contains newlines.
I think flymake-start-syntax-check-on-newline should just be deprecated,
set to nil, and hidden away from the user. It doesn't make much sense:
I don't see why a newline is different from any other character. So you
can do this in a sixth patch.
João
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-02-04 22:41 ` João Távora
@ 2019-02-17 20:11 ` Juri Linkov
2019-03-18 21:10 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-02-17 20:11 UTC (permalink / raw)
To: João Távora; +Cc: 34294
[-- Attachment #1: Type: text/plain, Size: 267 bytes --]
> 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:
[-- Attachment #2: flymake.el.patch --]
[-- Type: text/x-diff, Size: 4639 bytes --]
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)))
^ permalink raw reply related [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-02-17 20:11 ` Juri Linkov
@ 2019-03-18 21:10 ` Juri Linkov
2019-03-18 21:43 ` João Távora
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-03-18 21:10 UTC (permalink / raw)
To: João Távora; +Cc: 34294
João, if you are not very busy atm, could you please look at this patch.
> 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)))
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-03-18 21:10 ` Juri Linkov
@ 2019-03-18 21:43 ` João Távora
2019-03-19 20:46 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: João Távora @ 2019-03-18 21:43 UTC (permalink / raw)
To: Juri Linkov; +Cc: 34294
On Mon, Mar 18, 2019 at 9:23 PM Juri Linkov <juri@linkov.net> wrote:
> João, if you are not very busy atm, could you please look at this patch.
It looks good to me. I just have a suggestion and would like
to see the commit msg, too.
> > -(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.
If you obsolete the variable, you can remove it from the
manual, too.
--
João Távora
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-03-18 21:43 ` João Távora
@ 2019-03-19 20:46 ` Juri Linkov
2019-03-27 21:38 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-03-19 20:46 UTC (permalink / raw)
To: João Távora; +Cc: 34294
[-- Attachment #1: Type: text/plain, Size: 1028 bytes --]
> 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:
[-- Attachment #2: 0001-lisp-progmodes-flymake.el-Rename-flymake-start-on-ne.patch --]
[-- Type: text/x-diff, Size: 6118 bytes --]
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
^ permalink raw reply related [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-03-19 20:46 ` Juri Linkov
@ 2019-03-27 21:38 ` Juri Linkov
2019-04-17 20:29 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-03-27 21:38 UTC (permalink / raw)
To: João Távora; +Cc: 34294
Hi João,
>> 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.
Could you please also push an additional patch that fixes
a race condition in flymake. The problem is that currently
flymake starts even when flymake-mode is disabled.
Having such customization in ~/.emacs to not enable flymake-mode
in read-only buffers:
(add-hook 'ruby-mode-hook
(lambda ()
(flymake-mode 1)
(add-hook 'view-mode-hook
(lambda ()
(flymake-mode (if view-mode -1 1)))
nil t)))
It still runs flymake in read-only buffers because it disregards
the fact that flymake-mode becomes disabled before starting
flymake from post-command-hook or window-configuration-change-hook.
The fix is to check for flymake-mode again after hooks are finished:
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index d6cd370dac..1c7823cb85 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -900,7 +904,7 @@ flymake-start
(add-hook 'window-configuration-change-hook
#'start-on-display
'append 'local))
- (t
+ (flymake-mode
(setq flymake-check-start-time (float-time))
(let ((backend-args
(and
^ permalink raw reply related [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-03-27 21:38 ` Juri Linkov
@ 2019-04-17 20:29 ` Juri Linkov
2019-04-18 11:36 ` João Távora
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-04-17 20:29 UTC (permalink / raw)
To: João Távora; +Cc: 34294
> Could you please also push an additional patch that fixes
> a race condition in flymake. The problem is that currently
> flymake starts even when flymake-mode is disabled.
More problems: when an error is shown in the tooltip, currently there is
no way to copy a solution sometimes provided as part of the tooltip text.
This fix allows the tooltip text to be added to the *Messages* buffer:
@@ -640,10 +644,11 @@ flymake--highlight-line
(default-maybe 'help-echo
(lambda (window _ov pos)
(with-selected-window window
- (mapconcat
- #'flymake--diag-text
- (flymake-diagnostics pos)
- "\n"))))
+ (let ((inhibit-message t))
+ (message "%s" (mapconcat
+ #'flymake--diag-text
+ (flymake-diagnostics pos)
+ "\n"))))))
(default-maybe 'severity (warning-numeric-level :error))
(default-maybe 'priority (+ 100 (overlay-get ov 'severity))))
;; Some properties can't be overridden.
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-04-17 20:29 ` Juri Linkov
@ 2019-04-18 11:36 ` João Távora
2019-04-18 20:42 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: João Távora @ 2019-04-18 11:36 UTC (permalink / raw)
To: Juri Linkov; +Cc: 34294
[-- Attachment #1: Type: text/plain, Size: 727 bytes --]
On Wed, Apr 17, 2019 at 9:36 PM Juri Linkov <juri@linkov.net> wrote:
> > Could you please also push an additional patch that fixes
> > a race condition in flymake. The problem is that currently
> > flymake starts even when flymake-mode is disabled.
>
> More problems: when an error is shown in the tooltip, currently there is
> no way to copy a solution sometimes provided as part of the tooltip text.
Hmm, I think there is: if you C-h . on the error, you get the error in the
*Messages* buffer. You could also copy it from the Flymake Diagnostics
buffer.
I think somewhere in the manual, there is also an example where you can use
Flymake's API to make any error googleable by, say, right click.
João
[-- Attachment #2: Type: text/html, Size: 1169 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-04-18 11:36 ` João Távora
@ 2019-04-18 20:42 ` Juri Linkov
2019-04-19 6:35 ` Eli Zaretskii
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-04-18 20:42 UTC (permalink / raw)
To: João Távora; +Cc: 34294
>> > Could you please also push an additional patch that fixes
>> > a race condition in flymake. The problem is that currently
>> > flymake starts even when flymake-mode is disabled.
>>
>> More problems: when an error is shown in the tooltip, currently there is
>> no way to copy a solution sometimes provided as part of the tooltip text.
>
> Hmm, I think there is: if you C-h . on the error, you get the error in the
> *Messages* buffer.
I forgot about C-h . - I never used it. The reason why I expected the
error message to leave the trace in the *Messages* buffer is because
I disabled the tooltip, so on mouse hover the error message is displayed
in the echo area, and I expect everything displayed in the echo area
to remain in the *Messages* buffer.
> You could also copy it from the Flymake Diagnostics buffer.
Is it possible to make the Flymake Diagnostics buffer more accessible?
For example, to show it by clicking on the fringe indicator:
(define-key flymake-mode-map [left-fringe mouse-1] 'flymake-show-diagnostics-buffer)
> I think somewhere in the manual, there is also an example where you can use
> Flymake's API to make any error googleable by, say, right click.
stackoverflowable :)
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-04-18 20:42 ` Juri Linkov
@ 2019-04-19 6:35 ` Eli Zaretskii
2019-04-24 20:25 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2019-04-19 6:35 UTC (permalink / raw)
To: Juri Linkov; +Cc: 34294, joaotavora
> From: Juri Linkov <juri@linkov.net>
> Date: Thu, 18 Apr 2019 23:42:30 +0300
> Cc: 34294@debbugs.gnu.org
>
> I expect everything displayed in the echo area to remain in the
> *Messages* buffer.
That assumption is false, only 'message' and its derivatives do that.
Is there something in our documentation that promotes this fallacy?
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
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
0 siblings, 2 replies; 31+ messages in thread
From: Juri Linkov @ 2019-04-24 20:25 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 34294, joaotavora
>> I expect everything displayed in the echo area to remain in the
>> *Messages* buffer.
>
> That assumption is false, only 'message' and its derivatives do that.
> Is there something in our documentation that promotes this fallacy?
I expected everything displayed in the echo area to be preserved
in the *Messages* buffer because clicking on the echo area displays
the *Messages* buffer.
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-04-24 20:25 ` Juri Linkov
@ 2019-04-25 5:46 ` Eli Zaretskii
2019-04-25 8:07 ` martin rudalics
1 sibling, 0 replies; 31+ messages in thread
From: Eli Zaretskii @ 2019-04-25 5:46 UTC (permalink / raw)
To: Juri Linkov; +Cc: 34294, joaotavora
> From: Juri Linkov <juri@linkov.net>
> Cc: joaotavora@gmail.com, 34294@debbugs.gnu.org
> Date: Wed, 24 Apr 2019 23:25:00 +0300
>
> >> I expect everything displayed in the echo area to remain in the
> >> *Messages* buffer.
> >
> > That assumption is false, only 'message' and its derivatives do that.
> > Is there something in our documentation that promotes this fallacy?
>
> I expected everything displayed in the echo area to be preserved
> in the *Messages* buffer because clicking on the echo area displays
> the *Messages* buffer.
If it's just an expectation, and is not based on anything the
documentation says, then I guess you will have to adapt your
expectations. The echo area has more than one use, and not all of
them are logged in *Messages*. The ELisp manual tells that:
The “echo area” is used for displaying error messages (*note Errors::),
for messages made with the ‘message’ primitive, and for echoing
keystrokes. It is not the same as the minibuffer, despite the fact that
the minibuffer appears (when active) in the same place on the screen as
the echo area. *Note The Minibuffer: (emacs)Minibuffer.
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
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
1 sibling, 1 reply; 31+ messages in thread
From: martin rudalics @ 2019-04-25 8:07 UTC (permalink / raw)
To: Juri Linkov, Eli Zaretskii; +Cc: 34294, joaotavora
> I expected everything displayed in the echo area to be preserved
> in the *Messages* buffer because clicking on the echo area displays
> the *Messages* buffer.
At the time the echo area is displayed, every connection to where its
text comes from may have been lost already. Currently, the only way
to securely trace that relationship from Lisp is by using a separate
minibuffer-only frame and setting 'resize-mini-frames' to some
function. When that function gets called, the buffer of the root
window of its frame argument is the buffer whose contents should be
displayed in the mini window. See my attachment of
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33498#41
for an example of how to call such a function.
Maybe we should allow to set `resize-mini-windows' to a function which
gets called to resize the mini window (or just allow Lisp code to look
at its buffer and call some standard function afterwards).
But always keep in mind that Emacs asks 'yes-or-no-p' questions in the
minibuffer window and 'y-or-n-p' questions in the echo area and adjust
your expectations accordingly ;-)
martin
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-04-25 8:07 ` martin rudalics
@ 2019-04-29 20:15 ` Juri Linkov
2019-05-01 8:29 ` martin rudalics
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-04-29 20:15 UTC (permalink / raw)
To: martin rudalics; +Cc: 34294, joaotavora
>> I expected everything displayed in the echo area to be preserved
>> in the *Messages* buffer because clicking on the echo area displays
>> the *Messages* buffer.
>
> At the time the echo area is displayed, every connection to where its
> text comes from may have been lost already. Currently, the only way
> to securely trace that relationship from Lisp is by using a separate
> minibuffer-only frame and setting 'resize-mini-frames' to some
> function. When that function gets called, the buffer of the root
> window of its frame argument is the buffer whose contents should be
> displayed in the mini window. See my attachment of
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33498#41
>
> for an example of how to call such a function.
>
> Maybe we should allow to set `resize-mini-windows' to a function which
> gets called to resize the mini window (or just allow Lisp code to look
> at its buffer and call some standard function afterwards).
>
> But always keep in mind that Emacs asks 'yes-or-no-p' questions in the
> minibuffer window and 'y-or-n-p' questions in the echo area and adjust
> your expectations accordingly ;-)
Glad to see you back :-) We needed your help in bug#33992
to use display-buffer-in-direction and fit-window-to-buffer
for xref-find-definitions. Is your code ready for pushing
to master? display-buffer-in-direction would be a nice
direction of development.
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-04-29 20:15 ` Juri Linkov
@ 2019-05-01 8:29 ` martin rudalics
2019-05-01 21:10 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: martin rudalics @ 2019-05-01 8:29 UTC (permalink / raw)
To: Juri Linkov; +Cc: 34294, joaotavora
> Glad to see you back :-)
I recently had to downgrade from Windows XP to Windows 10 and still
fight the consequences.
> We needed your help in bug#33992
> to use display-buffer-in-direction and fit-window-to-buffer
> for xref-find-definitions. Is your code ready for pushing
> to master? display-buffer-in-direction would be a nice
> direction of development.
IIRC you had problems fitting the window to its buffer afterwards.
Shouldn't we investigate that first?
martin
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-05-01 8:29 ` martin rudalics
@ 2019-05-01 21:10 ` Juri Linkov
2019-05-04 17:34 ` martin rudalics
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-05-01 21:10 UTC (permalink / raw)
To: martin rudalics; +Cc: 34294, joaotavora
>> We needed your help in bug#33992
>> to use display-buffer-in-direction and fit-window-to-buffer
>> for xref-find-definitions. Is your code ready for pushing
>> to master? display-buffer-in-direction would be a nice
>> direction of development.
>
> IIRC you had problems fitting the window to its buffer afterwards.
> Shouldn't we investigate that first?
Yes, the problem was fitting the xref window after it's displayed.
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-05-01 21:10 ` Juri Linkov
@ 2019-05-04 17:34 ` martin rudalics
2019-05-04 21:16 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: martin rudalics @ 2019-05-04 17:34 UTC (permalink / raw)
To: Juri Linkov; +Cc: 34294, joaotavora
>> IIRC you had problems fitting the window to its buffer afterwards.
>> Shouldn't we investigate that first?
>
> Yes, the problem was fitting the xref window after it's displayed.
What is going wrong here? If with emacs -Q and
display-buffer-in-direction.el loaded I evaluate say
(display-buffer
(get-buffer-create "*text*")
'((display-buffer-in-direction)
(direction . right)
(window-width . 20)))
I get a 20 character wide window. If I put some text in that buffer
and use 'fit-window-to-buffer' instead of 20, Emacs fits the window to
its buffer as expected. What is different with the xref window?
martin
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-05-04 17:34 ` martin rudalics
@ 2019-05-04 21:16 ` Juri Linkov
2019-05-05 9:04 ` martin rudalics
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-05-04 21:16 UTC (permalink / raw)
To: martin rudalics; +Cc: 34294, joaotavora
>>> IIRC you had problems fitting the window to its buffer afterwards.
>>> Shouldn't we investigate that first?
>>
>> Yes, the problem was fitting the xref window after it's displayed.
>
> What is going wrong here? If with emacs -Q and
> display-buffer-in-direction.el loaded I evaluate say
>
> (display-buffer
> (get-buffer-create "*text*")
> '((display-buffer-in-direction)
> (direction . right)
> (window-width . 20)))
>
> I get a 20 character wide window. If I put some text in that buffer
> and use 'fit-window-to-buffer' instead of 20, Emacs fits the window to
> its buffer as expected. What is different with the xref window?
Maybe because fit-window-to-buffer is broken?
Another case where it's broken is proced
that uses fit-window-to-buffer:
0. emacs -Q
1. C-x 3
2. M-x proced
3. d d x
The buffer *Marked Processes* is displayed in random place.
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-05-04 21:16 ` Juri Linkov
@ 2019-05-05 9:04 ` martin rudalics
2019-05-05 22:46 ` Richard Stallman
0 siblings, 1 reply; 31+ messages in thread
From: martin rudalics @ 2019-05-05 9:04 UTC (permalink / raw)
To: Juri Linkov; +Cc: 34294, joaotavora
> Maybe because fit-window-to-buffer is broken?
> Another case where it's broken is proced
> that uses fit-window-to-buffer:
I need a complete scenario for that to reproduce.
> 0. emacs -Q
> 1. C-x 3
> 2. M-x proced
> 3. d d x
>
> The buffer *Marked Processes* is displayed in random place.
Here that buffer appears in the window on the left. What do I have to
do to reproduce this use case?
Thanks, martin
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
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-05-05 20:08 ` Juri Linkov
2019-05-05 23:02 ` João Távora
1 sibling, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-05-05 20:08 UTC (permalink / raw)
To: 34294-done
> I have flymake-start-on-save-buffer customized to 't' to check syntax
> only when a buffer is saved, but it still checks the unfinished work
> while edits are in progress, showing the errors that make no sense
> until the buffer is saved, even when flymake-start-syntax-check-on-newline
> and flymake-start-on-flymake-mode are nil.
>
> Is it possible to customize flymake to kick in only on saving?
Pushed to master changes confirmed by João.
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-05-05 9:04 ` martin rudalics
@ 2019-05-05 22:46 ` Richard Stallman
2019-05-05 23:09 ` João Távora
0 siblings, 1 reply; 31+ messages in thread
From: Richard Stallman @ 2019-05-05 22:46 UTC (permalink / raw)
To: martin rudalics; +Cc: 34294, joaotavora, juri
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> I need a complete scenario for that to reproduce.
Fortunately, our bugs do not reproduce on their own. They depend on
us to reproduce them ;-}.
--
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-05-05 20:08 ` Juri Linkov
@ 2019-05-05 23:02 ` João Távora
2019-05-06 20:15 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: João Távora @ 2019-05-05 23:02 UTC (permalink / raw)
To: 34294, Juri Linkov
[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]
On Sun, May 5, 2019 at 9:10 PM Juri Linkov <juri@linkov.net> wrote:
> > I have flymake-start-on-save-buffer customized to 't' to check syntax
> > only when a buffer is saved, but it still checks the unfinished work
> > while edits are in progress, showing the errors that make no sense
> > until the buffer is saved, even when
> flymake-start-syntax-check-on-newline
> > and flymake-start-on-flymake-mode are nil.
> >
> > Is it possible to customize flymake to kick in only on saving?
>
> Pushed to master changes confirmed by João.
>
I guess I can't complain much, since I've been largely absent due to
absolute lack of time, and very late on the review of these patches.
I also think we're conflating lots of different stuff on this issue, which
makes it difficult for me to follow.
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.
And maybe consider opening different bugs for the other issues?
Thanks,
--
João Távora
[-- Attachment #2: Type: text/html, Size: 2195 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-05-05 22:46 ` Richard Stallman
@ 2019-05-05 23:09 ` João Távora
0 siblings, 0 replies; 31+ messages in thread
From: João Távora @ 2019-05-05 23:09 UTC (permalink / raw)
To: Richard Stallman; +Cc: Juri Linkov, 34294
[-- Attachment #1: Type: text/plain, Size: 581 bytes --]
On Sun, May 5, 2019 at 11:46 PM Richard Stallman <rms@gnu.org> wrote:
> [[[ To any NSA and FBI agents reading my email: please consider ]]]
> [[[ whether defending the US Constitution against all enemies, ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> > I need a complete scenario for that to reproduce.
>
> Fortunately, our bugs do not reproduce on their own. They depend on
> us to reproduce them ;-}
Actually, under the scopes of my bug extermination device, bugs
can self-reproduce at will }:)
--
João Távora
[-- Attachment #2: Type: text/html, Size: 940 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-05-05 23:02 ` João Távora
@ 2019-05-06 20:15 ` Juri Linkov
2019-05-07 20:29 ` Juri Linkov
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-05-06 20:15 UTC (permalink / raw)
To: João Távora; +Cc: 34294
[-- 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 ()
^ permalink raw reply related [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-05-06 20:15 ` Juri Linkov
@ 2019-05-07 20:29 ` Juri Linkov
2019-05-07 23:10 ` João Távora
0 siblings, 1 reply; 31+ messages in thread
From: Juri Linkov @ 2019-05-07 20:29 UTC (permalink / raw)
To: João Távora; +Cc: 34294
>> 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.
Now the variable is obsoleted in master.
^ permalink raw reply [flat|nested] 31+ messages in thread
* bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
2019-05-07 20:29 ` Juri Linkov
@ 2019-05-07 23:10 ` João Távora
0 siblings, 0 replies; 31+ messages in thread
From: João Távora @ 2019-05-07 23:10 UTC (permalink / raw)
To: Juri Linkov; +Cc: 34294
[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]
On Tue, May 7, 2019 at 9:30 PM Juri Linkov <juri@linkov.net> wrote:
> >> 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.
>
> Now the variable is obsoleted in master.
>
The patch is fine (but did you push it already?). I have a minor grammar
nit (you should connect both variables with "and" when you mention them
in comments and docstrings).
Also the manual and NEWS entries are missing. Don't forget about those.
And thanks, of course :-)
João
[-- Attachment #2: Type: text/html, Size: 1858 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2019-05-07 23:10 UTC | newest]
Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2019-05-07 20:29 ` Juri Linkov
2019-05-07 23:10 ` João Távora
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).