New Flymake rewrite in emacs-26

classic Classic list List threaded Threaded
42 messages Options
123
Reply | Threaded
Open this post in threaded view
|

New Flymake rewrite in emacs-26

João Távora
Hi,

As discussed, I have just merged the Flymake rewrite into emacs-26. I
did this sooner than I expected so people can give it as much testing as
possible.

`flymake-mode' is not active by default, so when writing Elisp, I
encourage you to try out the new backends. Just M-x flymake-mode or

  (add-to-list 'emacs-lisp-mode-hook 'flymake-mode).

Of course if you were already using Flymake for C, C++, etc. Everything
should also still work (slightly better, in fact). Let me know if it
doesn't.

Some things worth noting:

* There are two older commits in emacs-26 that must be merged to master
  after all, otherwise the merge-back of this feature won't work.

  This is because there was a reversion of the decision to bring this
  feature to emacs-26 (see
  https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg01020.html
  and
  https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg01030.html)
  the reversion

  The two commits are

  ce540f8a68..: João Távora 2017-09-27 Revert "Split flymake.el into flymake-proc.el and flymake-ui.el"
  7cf59c6635..: João Távora 2017-09-27 Revert "Add flymake-backends defcustom"

* The most important docstrings are in place, but the Texinfo
  documentation (which I also rewrote considerably) is missing the bits
  about the new API for writing backends.

  Ideally, I would like some feedback on it (besides Stefan, of
  course). Please see the docstrings of `flymake-diagnostic-functions'
  and `flymake-diagnostic-types-alist'.

  Even more ideally, someone would write a nicer backend for Emacs's C
  sources (the current "legacy" one requires Makefiles to contain a
  "syntax-check" target, which isn't practical, I presume)

Thanks,
João










Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

Eli Zaretskii
> From: [hidden email] (João Távora)
> Date: Tue, 03 Oct 2017 15:05:44 +0100
>
> As discussed, I have just merged the Flymake rewrite into emacs-26. I
> did this sooner than I expected so people can give it as much testing as
> possible.

Thanks.

> `flymake-mode' is not active by default, so when writing Elisp, I
> encourage you to try out the new backends. Just M-x flymake-mode or
>
>   (add-to-list 'emacs-lisp-mode-hook 'flymake-mode).
>
> Of course if you were already using Flymake for C, C++, etc. Everything
> should also still work (slightly better, in fact). Let me know if it
> doesn't.

This should be in NEWS, perhaps after adjusting the style a bit.

> * The most important docstrings are in place, but the Texinfo
>   documentation (which I also rewrote considerably) is missing the bits
>   about the new API for writing backends.

We should add some minimal documentation about the new features.

Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

Lele Gaifax
Minor doc fix:

    diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
    index 0b28dc31cf..1e959d884c 100644
    --- a/lisp/progmodes/flymake.el
    +++ b/lisp/progmodes/flymake.el
    @@ -335,7 +335,7 @@ flymake-diagnostic-functions
     * the remaining arguments are keyword-value pairs in the
       form (:KEY VALUE :KEY2 VALUE2...).  Currently, Flymake provides
       no such arguments, but backend functions must be prepared to
    -  accept to accept and possibly ignore any number of them.
    +  accept and possibly ignore any number of them.

     Backend functions are expected to initiate the buffer check, but
     aren't required to complete it check before exiting: if the

ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
[hidden email]  |                 -- Fortunato Depero, 1929.


Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

Lele Gaifax
Will make a proper bug report with a patch, if you prefer.

    diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
    index 5dd72f81e2..18d9d05e62 100644
    --- a/doc/misc/flymake.texi
    +++ b/doc/misc/flymake.texi
    @@ -182,7 +182,7 @@ Syntax check statuses
     @cindex Syntax check statuses

     After syntax check is finished, its status is displayed in the mode line.
    -The following statuses are defined.
    +The following statuses are defined:

     @multitable @columnfractions 0.25 0.75
     @item @code{Wait}
    @@ -356,7 +356,7 @@ Adding support for a new syntax check tool
     @code{init-function} is required to initialize the syntax check,
     usually by creating a temporary copy of the buffer contents.  The
     function must return @code{(list cmd-name arg-list)}.  If
    -@code{init-function} returns null, syntax check is aborted, by
    +@code{init-function} returns null, syntax check is aborted, but
     @code{flymake-mode} is not switched off.

     @item cleanup-function
    diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
    index 0b28dc31cf..1e959d884c 100644
    --- a/lisp/progmodes/flymake.el
    +++ b/lisp/progmodes/flymake.el
    @@ -335,7 +335,7 @@ flymake-diagnostic-functions
     * the remaining arguments are keyword-value pairs in the
       form (:KEY VALUE :KEY2 VALUE2...).  Currently, Flymake provides
       no such arguments, but backend functions must be prepared to
    -  accept to accept and possibly ignore any number of them.
    +  accept and possibly ignore any number of them.

     Backend functions are expected to initiate the buffer check, but
     aren't required to complete it check before exiting: if the

ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
[hidden email]  |                 -- Fortunato Depero, 1929.


Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

João Távora
Hi, Lele

Thank you very much for proof-reading the doc. I make a lot of silly mistakes.

I wonder if you've read the docstrings in the .el files, too, since that's where most of the new documentation is right now.

> Will make a proper bug report with a patch, if you prefer:

Neither of those is essential I think. Unless someone disagrees, keep posting to this thread and I'll make a commit crediting you as the author.

Thanks,
João



On Wed, Oct 4, 2017 at 2:41 PM, Lele Gaifax <[hidden email]> wrote:
Will make a proper bug report with a patch, if you prefer.

    diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
    index 5dd72f81e2..18d9d05e62 100644
    --- a/doc/misc/flymake.texi
    +++ b/doc/misc/flymake.texi
    @@ -182,7 +182,7 @@ Syntax check statuses
     @cindex Syntax check statuses

     After syntax check is finished, its status is displayed in the mode line.
    -The following statuses are defined.
    +The following statuses are defined:

     @multitable @columnfractions 0.25 0.75
     @item @code{Wait}
    @@ -356,7 +356,7 @@ Adding support for a new syntax check tool
     @code{init-function} is required to initialize the syntax check,
     usually by creating a temporary copy of the buffer contents.  The
     function must return @code{(list cmd-name arg-list)}.  If
    -@code{init-function} returns null, syntax check is aborted, by
    +@code{init-function} returns null, syntax check is aborted, but
     @code{flymake-mode} is not switched off.

     @item cleanup-function
    diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
    index 0b28dc31cf..1e959d884c 100644
    --- a/lisp/progmodes/flymake.el
    +++ b/lisp/progmodes/flymake.el
    @@ -335,7 +335,7 @@ flymake-diagnostic-functions
     * the remaining arguments are keyword-value pairs in the
       form (:KEY VALUE :KEY2 VALUE2...).  Currently, Flymake provides
       no such arguments, but backend functions must be prepared to
    -  accept to accept and possibly ignore any number of them.
    +  accept and possibly ignore any number of them.

     Backend functions are expected to initiate the buffer check, but
     aren't required to complete it check before exiting: if the

ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
[hidden email]  |                 -- Fortunato Depero, 1929.





--
João Távora
Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

Lele Gaifax
João Távora <[hidden email]> writes:

> I wonder if you've read the docstrings in the .el files, too, since that's
> where most of the new documentation is right now.

Yes, and I will be doing that until I figure out the details about replacing
my current flymake-python-pyflakes based configuration with a new "native"
backend.

>
>> Will make a proper bug report with a patch, if you prefer:
>
> Neither of those is essential I think. Unless someone disagrees, keep
> posting to this thread and I'll make a commit crediting you as the author.

Great, will do.

Thanks a lot,
ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
[hidden email]  |                 -- Fortunato Depero, 1929.


Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

Lele Gaifax
Lele Gaifax <[hidden email]> writes:

> João Távora <[hidden email]> writes:
>
>> I wonder if you've read the docstrings in the .el files, too, since that's
>> where most of the new documentation is right now.
>
> Yes, and I will be doing that until I figure out the details about replacing
> my current flymake-python-pyflakes based configuration with a new "native"
> backend.

Speaking of which, while reading the -proc source I found recipes for Perl and
PHP, is there any interest in out-of-the-box Python equivalents?

Here is an updated diff: there is a "[???]" marker for a sentence that seems
wrong but I could not understand exactly its meaning.

ciao, lele.

diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index 5dd72f81e2..5ff5537d04 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -182,7 +182,7 @@ Syntax check statuses
 @cindex Syntax check statuses

 After syntax check is finished, its status is displayed in the mode line.
-The following statuses are defined.
+The following statuses are defined:

 @multitable @columnfractions 0.25 0.75
 @item @code{Wait}
@@ -356,7 +356,7 @@ Adding support for a new syntax check tool
 @code{init-function} is required to initialize the syntax check,
 usually by creating a temporary copy of the buffer contents.  The
 function must return @code{(list cmd-name arg-list)}.  If
-@code{init-function} returns null, syntax check is aborted, by
+@code{init-function} returns null, syntax check is aborted, but
 @code{flymake-mode} is not switched off.

 @item cleanup-function
@@ -375,7 +375,7 @@ Adding support for a new syntax check tool
 @end table

 To add support for a new syntax check tool, write corresponding
-@code{init-function}, and, optionally @code{cleanup-function} and
+@code{init-function} and, optionally, @code{cleanup-function} and
 @code{getfname-function}.  If the format of error messages reported by
 the new tool is not yet supported by Flymake, add a new entry to
 the @code{flymake-proc-err-line-patterns} list.
@@ -493,7 +493,7 @@ Implementation overview

 @code{flymake-proc-legacy-backend} saves a copy of the buffer in a
 temporary file in the buffer's directory (or in the system temp
-directory, for java files), creates a syntax check command and
+directory, for Java files), creates a syntax check command and
 launches a process with this command.  The output is parsed using a
 list of error message patterns, and error information (file name, line
 number, type and text) is saved.  After the process has finished,
@@ -631,7 +631,7 @@ Locating the buildfile
 using some build tool, like Make or Ant.

 All Make configuration data is usually stored in a file called
-@code{Makefile}.  To allow for future extensions, flymake uses a notion of
+@code{Makefile}.  To allow for future extensions, Flymake uses a notion of
 buildfile to reference the 'project configuration' file.

 Special function, @code{flymake-proc-find-buildfile} is provided for locating buildfiles.
diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el
index 47ec27f611..766dae312c 100644
--- a/lisp/progmodes/flymake-proc.el
+++ b/lisp/progmodes/flymake-proc.el
@@ -113,7 +113,7 @@ flymake-proc--current-process
   "Currently active Flymake process for a buffer, if any.")

 (defvar flymake-proc--report-fn nil
-  "If bound, function used to report back to flymake's UI.")
+  "If bound, function used to report back to Flymake's UI.")

 (defun flymake-proc-reformat-err-line-patterns-from-compile-el (original-list)
   "Grab error line patterns from ORIGINAL-LIST in compile.el format.
@@ -265,7 +265,6 @@ flymake-proc--included-file-name

 (defun flymake-proc--find-possible-master-files (file-name master-file-dirs masks)
   "Find (by name and location) all possible master files.
-
 Name is specified by FILE-NAME and location is specified by
 MASTER-FILE-DIRS.  Master files include .cpp and .c for .h.
 Files are searched for starting from the .h directory and max
@@ -626,7 +625,7 @@ flymake-proc--process-sentinel
 (defun flymake-proc--panic (problem explanation)
   "Tell Flymake UI about a fatal PROBLEM with this backend.
 May only be called in a dynamic environment where
-`flymake-proc--dynamic-report-fn' is bound"
+`flymake-proc--dynamic-report-fn' is bound."
   (flymake-log 0 "%s: %s" problem explanation)
   (if (and (boundp 'flymake-proc--report-fn)
            flymake-proc--report-fn)
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 0b28dc31cf..003cf93acf 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -198,7 +198,7 @@ flymake-log
     `(flymake--log-1 ,level ',sublog ,msg ,@args)))

 (defun flymake-error (text &rest args)
-  "Format TEXT with ARGS and signal an error for flymake."
+  "Format TEXT with ARGS and signal an error for Flymake."
   (let ((msg (apply #'format-message text args)))
     (flymake-log :error msg)
     (error (concat "[Flymake] " msg))))
@@ -335,7 +335,7 @@ flymake-diagnostic-functions
 * the remaining arguments are keyword-value pairs in the
   form (:KEY VALUE :KEY2 VALUE2...).  Currently, Flymake provides
   no such arguments, but backend functions must be prepared to
-  accept to accept and possibly ignore any number of them.
+  accept and possibly ignore any number of them.

 Backend functions are expected to initiate the buffer check, but
 aren't required to complete it check before exiting: if the
@@ -378,8 +378,8 @@ flymake-diagnostic-functions
 * ‘:explanation’: value should give user-readable details of
   the situation encountered, if any.

-* ‘:force’: value should be a boolean suggesting that the Flymake
-  considers the report even if was somehow unexpected.")
+* ‘:force’: value should be a boolean suggesting that Flymake
+  considers the report even if it was somehow unexpected.")

 (defvar flymake-diagnostic-types-alist
   `((:error
@@ -396,7 +396,7 @@ flymake-diagnostic-types-alist

 * Every property pertaining to overlays, except `category' and
   `evaporate' (see Info Node `(elisp)Overlay Properties'), used
-  affect the appearance of Flymake annotations.
+  to affect the appearance of Flymake annotations.

 * `bitmap', an image displayed in the fringe according to
   `flymake-fringe-indicator-position'.  The value actually
@@ -515,12 +515,12 @@ flymake--backend-state
   "Buffer-local hash table of a Flymake backend's state.
 The keys to this hash table are functions as found in
 `flymake-diagnostic-functions'. The values are structures
-of the type `flymake--backend-state', with these slots
+of the type `flymake--backend-state', with these slots:

 `running', a symbol to keep track of a backend's replies via its
 REPORT-FN argument. A backend is running if this key is
 present. If the key is absent if the backend isn't expecting any
-replies from the backend.
+replies from the backend. [???]

 `diags', a (possibly empty) list of diagnostic objects created
 with `flymake-make-diagnostic'. This key is absent if the
@@ -556,7 +556,6 @@ flymake-is-running
                                           &key explanation force
                                           &allow-other-keys)
   "Handle reports from BACKEND identified by TOKEN.
-
 BACKEND, REPORT-ACTION and EXPLANATION, and FORCE conform to the calling
 convention described in `flymake-diagnostic-functions' (which
 see). Optional FORCE says to handle a report even if TOKEN was
@@ -643,7 +642,7 @@ flymake-reporting-backends

 (defun flymake--disable-backend (backend &optional explanation)
   "Disable BACKEND because EXPLANATION.
-If is is running also stop it."
+If it is running also stop it."
   (flymake-log :warning "Disabling backend %s because %s" backend explanation)
   (flymake--with-backend-state backend state
     (setf (flymake--backend-state-running state) nil
@@ -659,7 +658,7 @@ flymake--run-backend
             (flymake--backend-state-disabled state) nil
             (flymake--backend-state-diags state) nil
             (flymake--backend-state-reported-p state) nil))
-    ;; FIXME: Should use `condition-case-unless-debug' here, for don't
+    ;; FIXME: Should use `condition-case-unless-debug' here, it doesn't
     ;; for two reasons: (1) that won't let me catch errors from inside
     ;; `ert-deftest' where `debug-on-error' appears to be always
     ;; t. (2) In cases where the user is debugging elisp somewhere
@@ -799,7 +798,6 @@ flymake-find-file-hook

 (defun flymake-goto-next-error (&optional n filter interactive)
   "Go to Nth next Flymake error in buffer matching FILTER.
-
 Interactively, always move to the next error.  Interactively, and
 with a prefix arg, skip any diagnostics with a severity less than
 ‘:warning’.
@@ -855,7 +853,6 @@ flymake-goto-next-error

 (defun flymake-goto-prev-error (&optional n filter interactive)
   "Go to Nth previous Flymake error in buffer matching FILTER.
-
 Interactively, always move to the previous error.  Interactively,
 and with a prefix arg, skip any diagnostics with a severity less
 than ‘:warning’.

--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
[hidden email]  |                 -- Fortunato Depero, 1929.


Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

João Távora
Lele Gaifax <[hidden email]> writes:

> Speaking of which, while reading the -proc source I found recipes for Perl and
> PHP, is there any interest in out-of-the-box Python equivalents?

Very much so, but please not based on flymake-proc.el, rather the new
API.

If your Python interpreter/compiler provides a syntax check tool that
can read from stdin, such a thing can be done in little code.

For an example, see my reply to Simen Heggestøyl in a parallel thread
where I provide a simple but effective Ruby backend.

> Here is an updated diff: there is a "[???]" marker for a sentence that seems
> wrong but I could not understand exactly its meaning.

Thanks, there are many more errors where you found the "[???]". I fixed
them in this diff so you can add them to your list.

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index acc0637ec3..3fd99f8eb3 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -526,19 +526,18 @@ flymake--backend-state
 
 `running', a symbol to keep track of a backend's replies via its
 REPORT-FN argument. A backend is running if this key is
-present. If the key is absent if the backend isn't expecting any
-replies from the backend.
+present. If nil, Flymake isn't expecting any replies from the
+backend.
 
-`diags', a (possibly empty) list of diagnostic objects created
-with `flymake-make-diagnostic'. This key is absent if the
-backend hasn't reported anything yet.
+`diags', a (possibly empty) list recent diagnostic objects created
+by the backend with `flymake-make-diagnostic'.
 
 `reported-p', a boolean indicating if the backend has replied
 since it last was contacted.
 
 `disabled', a string with the explanation for a previous
-exceptional situation reported by the backend. If this key is
-present the backend is disabled.")
+exceptional situation reported by the backend, nil if the
+backend is operating normally.")
 
 (cl-defstruct (flymake--backend-state
                (:constructor flymake--make-backend-state))


Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

Lele Gaifax
[hidden email] (João Távora) writes:

> Lele Gaifax <[hidden email]> writes:
>
>> Speaking of which, while reading the -proc source I found recipes for Perl and
>> PHP, is there any interest in out-of-the-box Python equivalents?
>
> Very much so, but please not based on flymake-proc.el, rather the new
> API.
>
> If your Python interpreter/compiler provides a syntax check tool that
> can read from stdin, such a thing can be done in little code.
>
> For an example, see my reply to Simen Heggestøyl in a parallel thread
> where I provide a simple but effective Ruby backend.
Thank you, I posted the solution I'm currently testing in that thread: let me
know if/how can I contribute it (removing my "esk/" prefix, of course).

I'm attaching the copy-edits diff: it includes your suggested rephrase.

I found the docstrings for flymake-goto-{next,previous}-error somewhat
confusing:

  (defun flymake-goto-next-error (&optional n filter interactive)
    "Go to Nth next Flymake error in buffer matching FILTER.
  Interactively, always move to the next error.  Interactively, and
  with a prefix arg, skip any diagnostics with a severity less than
  ‘:warning’.
  ...

with that double reference to "interactively", but I didn't touch those, as it
may very well be my inability to get the right sense...

Thanks again,
ciao, lele.


diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index 5dd72f81e2..5ff5537d04 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -182,7 +182,7 @@ Syntax check statuses
 @cindex Syntax check statuses
 
 After syntax check is finished, its status is displayed in the mode line.
-The following statuses are defined.
+The following statuses are defined:
 
 @multitable @columnfractions 0.25 0.75
 @item @code{Wait}
@@ -356,7 +356,7 @@ Adding support for a new syntax check tool
 @code{init-function} is required to initialize the syntax check,
 usually by creating a temporary copy of the buffer contents.  The
 function must return @code{(list cmd-name arg-list)}.  If
-@code{init-function} returns null, syntax check is aborted, by
+@code{init-function} returns null, syntax check is aborted, but
 @code{flymake-mode} is not switched off.
 
 @item cleanup-function
@@ -375,7 +375,7 @@ Adding support for a new syntax check tool
 @end table
 
 To add support for a new syntax check tool, write corresponding
-@code{init-function}, and, optionally @code{cleanup-function} and
+@code{init-function} and, optionally, @code{cleanup-function} and
 @code{getfname-function}.  If the format of error messages reported by
 the new tool is not yet supported by Flymake, add a new entry to
 the @code{flymake-proc-err-line-patterns} list.
@@ -493,7 +493,7 @@ Implementation overview
 
 @code{flymake-proc-legacy-backend} saves a copy of the buffer in a
 temporary file in the buffer's directory (or in the system temp
-directory, for java files), creates a syntax check command and
+directory, for Java files), creates a syntax check command and
 launches a process with this command.  The output is parsed using a
 list of error message patterns, and error information (file name, line
 number, type and text) is saved.  After the process has finished,
@@ -631,7 +631,7 @@ Locating the buildfile
 using some build tool, like Make or Ant.
 
 All Make configuration data is usually stored in a file called
-@code{Makefile}.  To allow for future extensions, flymake uses a notion of
+@code{Makefile}.  To allow for future extensions, Flymake uses a notion of
 buildfile to reference the 'project configuration' file.
 
 Special function, @code{flymake-proc-find-buildfile} is provided for locating buildfiles.
diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el
index d08819713a..4d9dac363f 100644
--- a/lisp/progmodes/flymake-proc.el
+++ b/lisp/progmodes/flymake-proc.el
@@ -113,7 +113,7 @@ flymake-proc--current-process
   "Currently active Flymake process for a buffer, if any.")
 
 (defvar flymake-proc--report-fn nil
-  "If bound, function used to report back to flymake's UI.")
+  "If bound, function used to report back to Flymake's UI.")
 
 (defun flymake-proc-reformat-err-line-patterns-from-compile-el (original-list)
   "Grab error line patterns from ORIGINAL-LIST in compile.el format.
@@ -265,7 +265,6 @@ flymake-proc--included-file-name
 
 (defun flymake-proc--find-possible-master-files (file-name master-file-dirs masks)
   "Find (by name and location) all possible master files.
-
 Name is specified by FILE-NAME and location is specified by
 MASTER-FILE-DIRS.  Master files include .cpp and .c for .h.
 Files are searched for starting from the .h directory and max
@@ -626,7 +625,7 @@ flymake-proc--process-sentinel
 (defun flymake-proc--panic (problem explanation)
   "Tell Flymake UI about a fatal PROBLEM with this backend.
 May only be called in a dynamic environment where
-`flymake-proc--dynamic-report-fn' is bound"
+`flymake-proc--dynamic-report-fn' is bound."
   (flymake-log 0 "%s: %s" problem explanation)
   (if (and (boundp 'flymake-proc--report-fn)
            flymake-proc--report-fn)
@@ -718,7 +717,7 @@ flymake-proc--safe-delete-directory
 (defun flymake-proc-legacy-flymake (report-fn &rest args)
   "Flymake backend based on the original Flymake implementation.
 This function is suitable for inclusion in
-`flymake-diagnostic-types-alist'. For backward compatibility, it
+`flymake-diagnostic-functions'. For backward compatibility, it
 can also be executed interactively independently of
 `flymake-mode'."
   ;; Interactively, behave as if flymake had invoked us through its
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index acc0637ec3..82877eea57 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -203,7 +203,7 @@ flymake-log
     `(flymake--log-1 ,level ',sublog ,msg ,@args)))
 
 (defun flymake-error (text &rest args)
-  "Format TEXT with ARGS and signal an error for flymake."
+  "Format TEXT with ARGS and signal an error for Flymake."
   (let ((msg (apply #'format-message text args)))
     (flymake-log :error msg)
     (error (concat "[Flymake] " msg))))
@@ -342,7 +342,7 @@ flymake-diagnostic-functions
 * the remaining arguments are keyword-value pairs in the
   form (:KEY VALUE :KEY2 VALUE2...).  Currently, Flymake provides
   no such arguments, but backend functions must be prepared to
-  accept to accept and possibly ignore any number of them.
+  accept and possibly ignore any number of them.
 
 Backend functions are expected to initiate the buffer check, but
 aren't required to complete it check before exiting: if the
@@ -385,8 +385,8 @@ flymake-diagnostic-functions
 * ‘:explanation’: value should give user-readable details of
   the situation encountered, if any.
 
-* ‘:force’: value should be a boolean suggesting that the Flymake
-  considers the report even if was somehow unexpected.")
+* ‘:force’: value should be a boolean suggesting that Flymake
+  considers the report even if it was somehow unexpected.")
 
 (defvar flymake-diagnostic-types-alist
   `((:error
@@ -403,7 +403,7 @@ flymake-diagnostic-types-alist
 
 * Every property pertaining to overlays, except `category' and
   `evaporate' (see Info Node `(elisp)Overlay Properties'), used
-  affect the appearance of Flymake annotations.
+  to affect the appearance of Flymake annotations.
 
 * `bitmap', an image displayed in the fringe according to
   `flymake-fringe-indicator-position'.  The value actually
@@ -522,23 +522,22 @@ flymake--backend-state
   "Buffer-local hash table of a Flymake backend's state.
 The keys to this hash table are functions as found in
 `flymake-diagnostic-functions'. The values are structures
-of the type `flymake--backend-state', with these slots
+of the type `flymake--backend-state', with these slots:
 
 `running', a symbol to keep track of a backend's replies via its
 REPORT-FN argument. A backend is running if this key is
-present. If the key is absent if the backend isn't expecting any
-replies from the backend.
+present. If nil, Flymake isn't expecting any replies from the
+backend.
 
-`diags', a (possibly empty) list of diagnostic objects created
-with `flymake-make-diagnostic'. This key is absent if the
-backend hasn't reported anything yet.
+`diags', a (possibly empty) list of recent diagnostic objects
+created by the backend with `flymake-make-diagnostic'.
 
 `reported-p', a boolean indicating if the backend has replied
 since it last was contacted.
 
 `disabled', a string with the explanation for a previous
-exceptional situation reported by the backend. If this key is
-present the backend is disabled.")
+exceptional situation reported by the backend, nil if the
+backend is operating normally.")
 
 (cl-defstruct (flymake--backend-state
                (:constructor flymake--make-backend-state))
@@ -563,7 +562,6 @@ flymake-is-running
                                           &key explanation force
                                           &allow-other-keys)
   "Handle reports from BACKEND identified by TOKEN.
-
 BACKEND, REPORT-ACTION and EXPLANATION, and FORCE conform to the calling
 convention described in `flymake-diagnostic-functions' (which
 see). Optional FORCE says to handle a report even if TOKEN was
@@ -650,7 +648,7 @@ flymake-reporting-backends
 
 (defun flymake--disable-backend (backend &optional explanation)
   "Disable BACKEND because EXPLANATION.
-If is is running also stop it."
+If it is running also stop it."
   (flymake-log :warning "Disabling backend %s because %s" backend explanation)
   (flymake--with-backend-state backend state
     (setf (flymake--backend-state-running state) nil
@@ -666,7 +664,7 @@ flymake--run-backend
             (flymake--backend-state-disabled state) nil
             (flymake--backend-state-diags state) nil
             (flymake--backend-state-reported-p state) nil))
-    ;; FIXME: Should use `condition-case-unless-debug' here, for don't
+    ;; FIXME: Should use `condition-case-unless-debug' here, it doesn't
     ;; for two reasons: (1) that won't let me catch errors from inside
     ;; `ert-deftest' where `debug-on-error' appears to be always
     ;; t. (2) In cases where the user is debugging elisp somewhere
@@ -806,7 +804,6 @@ flymake-find-file-hook
 
 (defun flymake-goto-next-error (&optional n filter interactive)
   "Go to Nth next Flymake error in buffer matching FILTER.
-
 Interactively, always move to the next error.  Interactively, and
 with a prefix arg, skip any diagnostics with a severity less than
 ‘:warning’.
@@ -862,7 +859,6 @@ flymake-goto-next-error
 
 (defun flymake-goto-prev-error (&optional n filter interactive)
   "Go to Nth previous Flymake error in buffer matching FILTER.
-
 Interactively, always move to the previous error.  Interactively,
 and with a prefix arg, skip any diagnostics with a severity less
 than ‘:warning’.


--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
[hidden email]  |                 -- Fortunato Depero, 1929.
Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

Noam Postavsky-2
On Thu, Oct 5, 2017 at 7:42 AM, Lele Gaifax <[hidden email]> wrote:
> diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi

I found this additional fix necessary to successfully generate the
info files on my out-of-tree build with texinfo 4.13.

diff --git i/doc/misc/flymake.texi w/doc/misc/flymake.texi
index 5dd72f81e2..89a186f2ea 100644
--- i/doc/misc/flymake.texi
+++ w/doc/misc/flymake.texi
@@ -4,7 +4,7 @@
 @set VERSION 0.3
 @set UPDATED April 2004
 @settitle GNU Flymake @value{VERSION}
-@include ../emacs/docstyle.texi
+@include docstyle.texi
 @syncodeindex pg cp
 @comment %**end of header

Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

João Távora
Noam Postavsky <[hidden email]> writes:

> On Thu, Oct 5, 2017 at 7:42 AM, Lele Gaifax <[hidden email]> wrote:
>> diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
>
> I found this additional fix necessary to successfully generate the
> info files on my out-of-tree build with texinfo 4.13.

Hi Noam,

I'm to blame for changing doctyle.texi to ../emacs/docstyle.texi. I
needed it to fix M-x makeinfo-buffer in the flymake.texi, since there is
no doc/misc/docstyle.texi.

It sounded a good idea to me at the time, but I forgot to ask here. What
exactly is an "out-of-tree" build?

João


> diff --git i/doc/misc/flymake.texi w/doc/misc/flymake.texi
> index 5dd72f81e2..89a186f2ea 100644
> --- i/doc/misc/flymake.texi
> +++ w/doc/misc/flymake.texi
> @@ -4,7 +4,7 @@
>  @set VERSION 0.3
>  @set UPDATED April 2004
>  @settitle GNU Flymake @value{VERSION}
> -@include ../emacs/docstyle.texi
> +@include docstyle.texi
>  @syncodeindex pg cp
>  @comment %**end of header

Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

Noam Postavsky-2
On Fri, Oct 6, 2017 at 9:16 AM, João Távora <[hidden email]> wrote:

> I'm to blame for changing doctyle.texi to ../emacs/docstyle.texi. I
> needed it to fix M-x makeinfo-buffer in the flymake.texi, since there is
> no doc/misc/docstyle.texi.
>
> It sounded a good idea to me at the time, but I forgot to ask here. What
> exactly is an "out-of-tree" build?

In short, when you call ./configure and make from a different
directory than the source's toplevel.
Actually, the official term seems to be "Parallel Build Tree"
https://www.gnu.org/software/automake/manual/html_node/VPATH-Builds.html

Anyway, I don't really understand how the @include texi path works, I
guess the makefile sets it up so that just the basename is enough.
Perhaps there is something similar that could be done via
.dir-locals.el for M-x makeinfo-buffer?

Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

João Távora
Noam Postavsky <[hidden email]> writes:

> In short, when you call ./configure and make from a different
> directory than the source's toplevel.

Makes sense. Fixed it in 0d0265bf50e190c77e6a06fd677c0114cb8356a6

> Perhaps there is something similar that could be done via
> .dir-locals.el for M-x makeinfo-buffer?

Perhaps, but the useful variable, makeinfo-options isn't safe for that
(which probably a good idea). I don't mind changing it for each session.

[ As an aside, the way it looks right now, with plans for Flymake
integration in major modes, is that its doc shouldn't be in doc/misc/*
anyway, but in the main manuals ]

João





Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

Lele Gaifax
In reply to this post by Lele Gaifax
Thanks a lot for the commit, João!

Just a tiny diff this time:

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 45f0adfeba..38fc501369 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -795,7 +795,7 @@ flymake-goto-next-error
 skip any diagnostics with a severity less than ‘:warning’.
 
 If ‘flymake-wrap-around’ is non-nil and no more next errors,
-resumes search from top
+resumes search from top.
 
 FILTER is a list of diagnostic types found in
 `flymake-diagnostic-types-alist', or nil, if no filter is to be


--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
[hidden email]  |                 -- Fortunato Depero, 1929.


Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

João Távora
Lele Gaifax <[hidden email]> writes:

> Thanks a lot for the commit, João!
>
> Just a tiny diff this time:
>
> diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
> index 45f0adfeba..38fc501369 100644
> --- a/lisp/progmodes/flymake.el
> +++ b/lisp/progmodes/flymake.el
> @@ -795,7 +795,7 @@ flymake-goto-next-error
>  skip any diagnostics with a severity less than ‘:warning’.
>  
>  If ‘flymake-wrap-around’ is non-nil and no more next errors,
> -resumes search from top
> +resumes search from top.
>  
>  FILTER is a list of diagnostic types found in
>  `flymake-diagnostic-types-alist', or nil, if no filter is to be

OK, I fixed that when fixing a bug in that function.

Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

João Távora
In reply to this post by Eli Zaretskii
Eli Zaretskii <[hidden email]> writes:

> We should add some minimal documentation about the new features.

I added this to doc/misc/flymake.texi. It needs proofreading, but
otherwise I consider it a fairly complete description of the new API.

Importantly, a complete annotated example of a working Flymake backend
is presented. This can be a model for future backends.

> This should be in NEWS, perhaps after adjusting the style a bit.

I'm not great at summarizing changes in a NEWS-snazzy manner, but a
patch is attached.  Apart from that, I see these loose ends:

* Are we keeping track of the Flymake backends developed by people?
  Thus far, I think I counted backends for python, ruby, clang
  (minimal), gcc (minimal) and tex.  Am I missing any?

* Should Flymake do something with next-error-function?

* There is a "Flymake diagnostics buffer" sub-feature in
  scratch/flymake-diagnostics-buffer.  It is reasonably stable.  Is it
  OK to merge into emacs-26?

* Shouldn't flymake.texi be split into two parts, one for the Emacs
  manual and another for Emacs Lisp manual?

João

--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1146,7 +1146,19 @@ languages.  (Version 2.1.0 or later of Enchant is required.)
 ** Flymake
 
 +++
-*** Emacs no longer prompts the user before killing Flymake processes on exit.
+*** Flymake has been completely redesigned
+
+Flymake now annotates arbitrary buffer regions, not just lines. It
+supports arbitrary diagnostic types, not not just errors and warnings
+(see variable 'flymake-diagnostic-types-alist').
+
+It also supports multiple simultaneous backends, meaning that you can
+check your buffer from different perspectives (see variable
+'flymake-diagnostic-functions'). Backends for Emacs-lisp mode are
+provided.
+
+The old Flymake behaviour is preserved in the so-called "legacy
+backend", which has been updated to benefit from new UI features.
 
 
 * New Modes and Packages in Emacs 26.1




Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

Eli Zaretskii
> From: [hidden email] (João Távora)
> Cc: [hidden email],  [hidden email],  [hidden email]
> Date: Tue, 10 Oct 2017 13:25:30 +0100
>
> Eli Zaretskii <[hidden email]> writes:
>
> > We should add some minimal documentation about the new features.
>
> I added this to doc/misc/flymake.texi. It needs proofreading, but
> otherwise I consider it a fairly complete description of the new API.

Thanks, I've proofread it and made several fixes, please take a look.
(I can explain each change I made, if it is not immediately apparent
from the change itself or the log message.)

> > This should be in NEWS, perhaps after adjusting the style a bit.
>
> I'm not great at summarizing changes in a NEWS-snazzy manner, but a
> patch is attached.

Looks good, see a couple of minor comments below.

> Apart from that, I see these loose ends:
>
> * Are we keeping track of the Flymake backends developed by people?

You mean, in the manual?  I'd prefer not to, since such information
quickly becomes obsolete, and keeping it up to date imposes a
maintenance burden we'd better avoided.

If you mean track them somewhere else, please tell.

> * Should Flymake do something with next-error-function?

I thought it already did?

> * There is a "Flymake diagnostics buffer" sub-feature in
>   scratch/flymake-diagnostics-buffer.  It is reasonably stable.  Is it
>   OK to merge into emacs-26?

If it's easy to show a diff for such a merge, please do.

> * Shouldn't flymake.texi be split into two parts, one for the Emacs
>   manual and another for Emacs Lisp manual?

It doesn't seem worth the hassle.  Most users will be programmers
anyway.

> +*** Flymake has been completely redesigned
> +
> +Flymake now annotates arbitrary buffer regions, not just lines. It
> +supports arbitrary diagnostic types, not not just errors and warnings
                                        ^^^
Extra "not".

> +                                 Backends for Emacs-lisp mode are
> +provided.

I think this should be in single.  And the correct spelling is "Emacs
Lisp mode".

Also, please use our convention of keeping 2 spaces between sentences.

Otherwise, please push these changes, and thanks.

Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

João Távora
Eli Zaretskii <[hidden email]> writes:

> Thanks, I've proofread it and made several fixes, please take a look.
> (I can explain each change I made, if it is not immediately apparent
> from the change itself or the log message.)

No need, looks very good, thanks.

>> > This should be in NEWS, perhaps after adjusting the style a bit.
>>
>> I'm not great at summarizing changes in a NEWS-snazzy manner, but a
>> patch is attached.
>
> Looks good, see a couple of minor comments below.
>
>> Apart from that, I see these loose ends:
>>
>> * Are we keeping track of the Flymake backends developed by people?
>
> You mean, in the manual?  I'd prefer not to, since such information
> quickly becomes obsolete, and keeping it up to date imposes a
> maintenance burden we'd better avoided.
>
> If you mean track them somewhere else, please tell.

No, I meant generally keep track of the backends that surfaced in this
list and merge them into the relevant major-mode in emacs-26 (in keeping
with your decision that they should be merged if they work reasonably
well).

>> * Should Flymake do something with next-error-function?
>
> I thought it already did?

It doesn't. And I should have said 'next-error' more generally. IIUC the
place for next-error-function is for major modes, which flymake-mode
isn't (but its proposed diagnostics buffer is).

Anyway I think the problem is that next-error will have a hard time (if
it doesn't already) choosing between its "next-error" source: the
compilation, and grep occur buffers, and now the constantly updated list
of Flymake annotations.

>> * There is a "Flymake diagnostics buffer" sub-feature in
>>   scratch/flymake-diagnostics-buffer.  It is reasonably stable.  Is it
>>   OK to merge into emacs-26?
>
> If it's easy to show a diff for such a merge, please do.

Patch is attached (though I don't really understand if you want to see
the diff or rather ensure that a diff is possible and easy to revert if
problems arise)

> It doesn't seem worth the hassle.  Most users will be programmers
> anyway.

Possibly not elisp programmers, but OK.

> Otherwise, please push these [NEWS] changes, and thanks.

Done.

João

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 4c4d6aef32..6796fc2b76 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -605,7 +605,12 @@ flymake-is-running
             (flymake-log :debug "backend %s reported %d diagnostics in %.2f second(s)"
                          backend
                          (length new-diags)
-                         (- (float-time) flymake-check-start-time)))))))))
+                         (- (float-time) flymake-check-start-time)))
+          (when (and (get-buffer (flymake--diagnostics-buffer-name))
+                     (get-buffer-window (flymake--diagnostics-buffer-name))
+                     (null (cl-set-difference (flymake-running-backends)
+                                              (flymake-reporting-backends))))
+            (flymake-show-diagnostics-buffer))))))))
 
 (defun flymake-make-report-fn (backend &optional token)
   "Make a suitable anonymous report function for BACKEND.
@@ -869,6 +874,7 @@ flymake-goto-prev-error
     [ "Go to previous error"  flymake-goto-prev-error t ]
     [ "Check now"             flymake-start t ]
     [ "Go to log buffer"      flymake-switch-to-log-buffer t ]
+    [ "Show error buffer"     flymake-show-diagnostics-buffer t ]
     "--"
     [ "Turn off Flymake"      flymake-mode t ]))
 
@@ -977,6 +983,102 @@ flymake--mode-line-format
                         '(:propertize " "))
              (:propertize "]")))))))
 
+
+;;; Diagnostics buffer
+
+(defvar-local flymake--diagnostics-buffer-source nil)
+
+(defvar flymake-diagnostics-buffer-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "RET") 'flymake-goto-diagnostic)
+    (define-key map (kbd "SPC") 'flymake-show-diagnostic)
+    map))
+
+(defun flymake-show-diagnostic (pos &optional other-window)
+  "Show location of diagnostic at POS."
+  (interactive (list (point) t))
+  (let* ((id (or (tabulated-list-get-id pos)
+                 (user-error "Nothing at point")))
+         (overlay (plist-get id :overlay)))
+    (with-current-buffer (overlay-buffer overlay)
+      (with-selected-window
+          (display-buffer (current-buffer) other-window)
+        (goto-char (overlay-start overlay))
+        (pulse-momentary-highlight-region (overlay-start overlay)
+                                          (overlay-end overlay)
+                                          'highlight))
+      (current-buffer))))
+
+(defun flymake-goto-diagnostic (pos)
+  "Show location of diagnostic at POS.
+POS can be a buffer position or a button"
+  (interactive "d")
+  (pop-to-buffer
+   (flymake-show-diagnostic (if (button-type pos) (button-start pos) pos))))
+
+(defun flymake--diagnostics-buffer-entries ()
+  (with-current-buffer flymake--diagnostics-buffer-source
+    (cl-loop for ov in (flymake--overlays)
+             for diag = (overlay-get ov
+                                     'flymake--diagnostic)
+             for (line . col) =
+             (save-excursion
+               (goto-char (overlay-start ov))
+               (cons (line-number-at-pos)
+                     (- (point)
+                        (line-beginning-position))))
+             for type = (flymake--diag-type diag)
+             collect
+             (list (list :overlay ov
+                         :line line
+                         :severity (flymake--lookup-type-property
+                                    type
+                                    'severity (warning-numeric-level :error)))
+                   `[,(format "%s" line)
+                     ,(format "%s" col)
+                     ,(propertize (format "%s" type)
+                                  'face (flymake--lookup-type-property
+                                         type 'mode-line-face 'flymake-error))
+                     (,(format "%s" (flymake--diag-text diag))
+                      mouse-face highlight
+                      help-echo "mouse-2: visit this diagnostic"
+                      face nil
+                      mouse-action flymake-goto-diagnostic)]))))
+
+(define-derived-mode flymake-diagnostics-buffer-mode tabulated-list-mode
+  "Flymake diagnostics"
+  "A mode for listing Flymake diagnostics."
+  (setq tabulated-list-format
+        `[("Line" 5 (lambda (l1 l2)
+                      (< (plist-get (car l1) :line)
+                         (plist-get (car l2) :line)))
+           :right-align t)
+          ("Col" 3 nil :right-align t)
+          ("Type" 8 (lambda (l1 l2)
+                      (< (plist-get (car l1) :severity)
+                         (plist-get (car l2) :severity))))
+          ("Message" 0 t)])
+  (setq tabulated-list-entries
+        'flymake--diagnostics-buffer-entries)
+  (tabulated-list-init-header))
+
+(defun flymake--diagnostics-buffer-name ()
+  (format "*Flymake diagnostics for %s*" (current-buffer)))
+
+(defun flymake-show-diagnostics-buffer ()
+  "Show a list of Flymake diagnostics for current buffer."
+  (interactive)
+  (let* ((name (flymake--diagnostics-buffer-name))
+         (source (current-buffer))
+         (target (or (get-buffer name)
+                     (with-current-buffer (get-buffer-create name)
+                       (flymake-diagnostics-buffer-mode)
+                       (setq flymake--diagnostics-buffer-source source)
+                       (current-buffer)))))
+    (with-current-buffer target
+      (revert-buffer)
+      (display-buffer (current-buffer)))))
+
 (provide 'flymake)
 
 (require 'flymake-proc)


Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

Eli Zaretskii
> From: [hidden email] (João Távora)
> Cc: [hidden email],  [hidden email],  [hidden email]
> Date: Tue, 10 Oct 2017 16:09:07 +0100
>
> No, I meant generally keep track of the backends that surfaced in this
> list and merge them into the relevant major-mode in emacs-26 (in keeping
> with your decision that they should be merged if they work reasonably
> well).

I think yes.

> >> * Should Flymake do something with next-error-function?
> >
> > I thought it already did?
>
> It doesn't. And I should have said 'next-error' more generally. IIUC the
> place for next-error-function is for major modes, which flymake-mode
> isn't (but its proposed diagnostics buffer is).

I have no problems with Flymake keeping its hands off next-error.  But
since you've asked the question, it sounds like you are unsure whether
it's TRT?

> Anyway I think the problem is that next-error will have a hard time (if
> it doesn't already) choosing between its "next-error" source: the
> compilation, and grep occur buffers, and now the constantly updated list
> of Flymake annotations.

Yes, we had similar problems elsewhere.

> >> * There is a "Flymake diagnostics buffer" sub-feature in
> >>   scratch/flymake-diagnostics-buffer.  It is reasonably stable.  Is it
> >>   OK to merge into emacs-26?
> >
> > If it's easy to show a diff for such a merge, please do.
>
> Patch is attached (though I don't really understand if you want to see
> the diff or rather ensure that a diff is possible and easy to revert if
> problems arise)

(I wanted to see the diffs themselves.)

Thanks, I think this can be merged to emacs-26.

> > It doesn't seem worth the hassle.  Most users will be programmers
> > anyway.
>
> Possibly not elisp programmers, but OK.

Let's withhold the argument until we have some real problems in this
area.  IMO, the manual is small enough to host both parts of Flymake
documentation without any problem.

Reply | Threaded
Open this post in threaded view
|

Re: New Flymake rewrite in emacs-26

João Távora
Eli Zaretskii <[hidden email]> writes:

> I think yes.

OK, IIUC we have copyright assignments for every author besides me
(that’s Lele and Mark). So I invite these people to cross-check their
work against new API documentation, and merge it to emacs-26.

It would be nice to have a backend capable of checking Emacs C sources
with GCC and without any extra configurations. To solve the problem with
setting proper GCC flags, perhaps the .dir-locals file can be used. Or
perhaps some other method can be used to infer flags from a Makefile or
some other source.

Likewise for a perl backend, which should be even simpler.

>> >> * Should Flymake do something with next-error-function?
>> >
>> > I thought it already did?
>>
>> It doesn't. And I should have said 'next-error' more generally. IIUC the
>> place for next-error-function is for major modes, which flymake-mode
>> isn't (but its proposed diagnostics buffer is).
>
> I have no problems with Flymake keeping its hands off next-error.  But
> since you've asked the question, it sounds like you are unsure whether
> it's TRT?

Yes. I don’t use next-error at all, so I don’t think I’m a good person
to implement this kind of UI integration (rather, I’ll implement it
iff someone provides precise requires).

> Thanks, I think this can be merged to emacs-26.

Done

>> Possibly not elisp programmers, but OK.
>
> Let's withhold the argument until we have some real problems in this
> area.  IMO, the manual is small enough to host both parts of Flymake
> documentation without any problem.

Mainly I thought it would increase awareness of the Flymake API to
major-mode-writers, but I agree with your argument.

123