GNU bug report logs - #30980
[PATCH] add customize option for flymake

Previous Next

Package: auctex;

Reported by: Alex Branham <alex.branham <at> gmail.com>

Date: Wed, 28 Mar 2018 22:28:02 UTC

Severity: normal

Tags: patch

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30980 in the body.
You can then email your comments to 30980 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#30980; Package auctex. (Wed, 28 Mar 2018 22:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Branham <alex.branham <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Wed, 28 Mar 2018 22:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: "" <bug-auctex <at> gnu.org>
Subject: [PATCH] add customize option for flymake
Date: Wed, 28 Mar 2018 17:27:56 -0500
[Message part 1 (text/plain, inline)]
Hello -

This patch lets users set the flags that chktex uses. It also moves the
documentation of the addition of flymake support into a new section in
changes.texi (I didn't realize 12.1 had already been released when I
added it earlier).

Let me know if anything looks wrong.
Alex

------------------------------------------------------------

From d6ec0bd5db2f5d8097b6d2e784ea3de390ff63f0 Mon Sep 17 00:00:00 2001
From: Alex Branham <branham <at> utexas.edu>
Date: Wed, 28 Mar 2018 17:23:38 -0500
Subject: [PATCH] New customize option LaTeX-flymake-chktex-flags

* latex-flymake.el (LaTeX-flymake-chktex-flags): New option.
* latex-flymake.el (LaTeX-flymake): Use it.
* doc/auctex.texi:
* doc/changes.texi: Document new option.
---
 doc/auctex.texi  |  5 +++--
 doc/changes.texi | 23 +++++++++++++++--------
 latex-flymake.el | 20 +++++++++++++++++++-
 3 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/doc/auctex.texi b/doc/auctex.texi
index e861a752..9757f746 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -3854,8 +3854,9 @@ buffers by adding this to your init file:
 @lisp
 (add-hook 'LaTeX-mode-hook #'flymake-mode)
 @end lisp
-Note that @AUCTeX{} currently only provides support for using
-@code{chktex} as the flymake backend.
+You can customize @code{LaTeX-flymake-chktex-flags} to enable or disable
+chktex warnings. Note that @AUCTeX{} currently only provides support for
+using @code{chktex} as the flymake backend.

 Each of the two utilities @code{lacheck} and @code{chktex} will find
 some errors the other doesn't, but @code{chktex} is more configurable,
diff --git a/doc/changes.texi b/doc/changes.texi
index bddec6a1..3e84f3c8 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -8,6 +8,21 @@

 @end ifset

+@heading News in DEVELOP
+
+@itemize @bullet
+@item
+@AUCTeX{} has support for the Flymake package in Emacs 26 or newer.  To
+enable, call @kbd{M-x flymake-mode RET} or add this to your
+@file{.emacs} file:
+@lisp
+(add-hook 'LaTeX-mode-hook #'flymake-mode)
+@end lisp
+The accompanying new customize option @code{LaTeX-flymake-chktex-flags}
+allows users to turn on/off specific warnings.
+
+@end itemize
+
 @heading News in 12.1

 @itemize @bullet
@@ -19,14 +34,6 @@ been dropped.
 Besides the change in the supported version of Emacs, there has been no
 functional change in this release, which is equivalent to version 11.92.

-@item
-@AUCTeX{} has support for the Flymake package in Emacs 26 or newer.  To
-enable, call @kbd{M-x flymake-mode RET} or add this to your
-@file{.emacs} file:
-@lisp
-(add-hook 'LaTeX-mode-hook #'flymake-mode)
-@end lisp
-
 @end itemize

 @heading News in 11.92
diff --git a/latex-flymake.el b/latex-flymake.el
index 2a86ebed..40bc3052 100644
--- a/latex-flymake.el
+++ b/latex-flymake.el
@@ -40,6 +40,23 @@

 (defvar-local LaTeX--flymake-proc nil)

+(defcustom LaTeX-flymake-chktex-flags nil
+  "If non-nil, a list of strings to pass as arguments to the chktex backend.
+You can use this to enable or disable specific warnings by
+setting it to something like:
+
+'(\"-n12\" \"-w41\")
+
+Which would disable warning 12 (\"interword spacing should
+perhaps be used\") and enable 41 (\"you ought not to use
+primitive TeX in LaTeX code\").
+
+See the chktex manual for warning numbers and details about how
+to use flags."
+  :type '(choice (const nil :tag "Use chktex defaults")
+                 (repeat string))
+  :group 'LaTeX)
+
 (defun LaTeX-flymake (report-fn &rest _args)
   "Setup flymake integration.

@@ -56,7 +73,8 @@ REPORT-FN is flymake's callback function."
        (make-process
         :name "LaTeX-flymake" :noquery t :connection-type 'pipe
         :buffer (generate-new-buffer " *LaTeX-flymake*")
-        :command '("chktex" "--verbosity=0" "--quiet" "--inputfiles")
+        :command (append `("chktex" "--verbosity=0" "--quiet" "--inputfiles")
+                         LaTeX-flymake-chktex-flags)
         :sentinel
         (lambda (proc _event)
           (when (eq 'exit (process-status proc))
--
2.16.3




[0001-New-customize-option-LaTeX-flymake-chktex-flags.patch (text/x-patch, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#30980; Package auctex. (Mon, 04 Mar 2024 21:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 30980 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 30980 <at> debbugs.gnu.org
Subject: Re: bug#30980: [PATCH] add customize option for flymake
Date: Mon, 04 Mar 2024 22:47:56 +0100
Alex Branham <alex.branham <at> gmail.com> writes:

> This patch lets users set the flags that chktex uses. It also moves the
> documentation of the addition of flymake support into a new section in
> changes.texi (I didn't realize 12.1 had already been released when I
> added it earlier).
>
> Let me know if anything looks wrong.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Hi Alex,

first of all, my sincere apologies that you didn't get any response from
us -- I hope you have the time and energy to pick this up again with me.
I think your addition makes sense and we should install it.  I have some
comments below:

>>From d6ec0bd5db2f5d8097b6d2e784ea3de390ff63f0 Mon Sep 17 00:00:00 2001
> From: Alex Branham <branham <at> utexas.edu>
> Date: Wed, 28 Mar 2018 17:23:38 -0500
> Subject: [PATCH] New customize option LaTeX-flymake-chktex-flags
>
> * latex-flymake.el (LaTeX-flymake-chktex-flags): New option.
> * latex-flymake.el (LaTeX-flymake): Use it.

Did you hit 'C-x 4 a' to generate the logs?  Usually, this part should
look like this:

* latex-flymake.el (LaTeX-flymake-chktex-flags): New option.
  (LaTeX-flymake): Use it.

> * doc/auctex.texi:
> * doc/changes.texi: Document new option.
> ---
>  doc/auctex.texi  |  5 +++--
>  doc/changes.texi | 23 +++++++++++++++--------
>  latex-flymake.el | 20 +++++++++++++++++++-
>  3 files changed, 37 insertions(+), 11 deletions(-)
>
> diff --git a/doc/auctex.texi b/doc/auctex.texi
> index e861a752..9757f746 100644
> --- a/doc/auctex.texi
> +++ b/doc/auctex.texi
> @@ -3854,8 +3854,9 @@ buffers by adding this to your init file:
>  @lisp
>  (add-hook 'LaTeX-mode-hook #'flymake-mode)
>  @end lisp
> -Note that @AUCTeX{} currently only provides support for using
> -@code{chktex} as the flymake backend.
> +You can customize @code{LaTeX-flymake-chktex-flags} to enable or disable
> +chktex warnings. Note that @AUCTeX{} currently only provides support for
> +using @code{chktex} as the flymake backend.

Here, you should add a @defopt environment describing
`LaTeX-flymake-chktex-flags'.  And while we're at it: Can we rename this
to `LaTeX-flymake-chktex-options'?  So something like:

@defopt LaTeX-flymake-chktex-options
List of strings passed to chktex program as additonal options.
@end defopt

>  Each of the two utilities @code{lacheck} and @code{chktex} will find
>  some errors the other doesn't, but @code{chktex} is more configurable,
> diff --git a/doc/changes.texi b/doc/changes.texi
> index bddec6a1..3e84f3c8 100644
> --- a/doc/changes.texi
> +++ b/doc/changes.texi
> @@ -8,6 +8,21 @@
>
>  @end ifset
>
> +@heading News in DEVELOP
> +
> +@itemize @bullet
> +@item
> +@AUCTeX{} has support for the Flymake package in Emacs 26 or newer.  To
> +enable, call @kbd{M-x flymake-mode RET} or add this to your
> +@file{.emacs} file:
> +@lisp
> +(add-hook 'LaTeX-mode-hook #'flymake-mode)
> +@end lisp

This part is already in News in 12.2.

> +The accompanying new customize option @code{LaTeX-flymake-chktex-flags}
> +allows users to turn on/off specific warnings.

This part should go into the NEWS -- slightly rephrased.

> diff --git a/latex-flymake.el b/latex-flymake.el
> index 2a86ebed..40bc3052 100644
> --- a/latex-flymake.el
> +++ b/latex-flymake.el
> @@ -40,6 +40,23 @@
>
>  (defvar-local LaTeX--flymake-proc nil)
>
> +(defcustom LaTeX-flymake-chktex-flags nil
> +  "If non-nil, a list of strings to pass as arguments to the chktex backend.
                                               ^^^^^^^^^ options?

> +You can use this to enable or disable specific warnings by
> +setting it to something like:
> +
> +'(\"-n12\" \"-w41\")

With a recent Emacs, this needs to be:

\\='(\"-n12\" \"-w41\")

> +
> +Which would disable warning 12 (\"interword spacing should
> +perhaps be used\") and enable 41 (\"you ought not to use
> +primitive TeX in LaTeX code\").
> +
> +See the chktex manual for warning numbers and details about how
> +to use flags."
> +  :type '(choice (const nil :tag "Use chktex defaults")
> +                 (repeat string))
> +  :group 'LaTeX)
> +
>  (defun LaTeX-flymake (report-fn &rest _args)
>    "Setup flymake integration.
>
> @@ -56,7 +73,8 @@ REPORT-FN is flymake's callback function."
>         (make-process
>          :name "LaTeX-flymake" :noquery t :connection-type 'pipe
>          :buffer (generate-new-buffer " *LaTeX-flymake*")
> -        :command '("chktex" "--verbosity=0" "--quiet" "--inputfiles")
> +        :command (append `("chktex" "--verbosity=0" "--quiet" "--inputfiles")
> +                         LaTeX-flymake-chktex-flags)

Why using backquote when appending?  Or maybe:

:command `("chktex" "--verbosity=0" "--quiet" "--inputfiles"
           ,@LaTeX-flymake-chktex-options)

>          :sentinel
>          (lambda (proc _event)
>            (when (eq 'exit (process-status proc))

Again, sorry for being late.

Best, Arash




Reply sent to Arash Esbati <arash <at> gnu.org>:
You have taken responsibility. (Tue, 12 Mar 2024 06:45:02 GMT) Full text and rfc822 format available.

Notification sent to Alex Branham <alex.branham <at> gmail.com>:
bug acknowledged by developer. (Tue, 12 Mar 2024 06:45:02 GMT) Full text and rfc822 format available.

Message #13 received at 30980-done <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 30980-done <at> debbugs.gnu.org
Subject: Re: bug#30980: [PATCH] add customize option for flymake
Date: Tue, 12 Mar 2024 07:43:28 +0100
Arash Esbati <arash <at> gnu.org> writes:

> Alex Branham <alex.branham <at> gmail.com> writes:
>
>> This patch lets users set the flags that chktex uses. It also moves the
>> documentation of the addition of flymake support into a new section in
>> changes.texi (I didn't realize 12.1 had already been released when I
>> added it earlier).
>>
>> Let me know if anything looks wrong.
>
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> Hi Alex,
>
> first of all, my sincere apologies that you didn't get any response from
> us -- I hope you have the time and energy to pick this up again with me.
> I think your addition makes sense and we should install it.

I installed a slightly modified version of your patch (91073c6b79).
Please let me know if you have any comments, and we can adjust the
change.  Therefore I'm closing this report.

Again, sorry for being late.

Best, Arash




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 09 Apr 2024 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 15 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.