emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30980: closed ([PATCH] add customize option for flymake)


From: GNU bug Tracking System
Subject: bug#30980: closed ([PATCH] add customize option for flymake)
Date: Tue, 12 Mar 2024 06:45:02 +0000

Your message dated Tue, 12 Mar 2024 07:43:28 +0100
with message-id <m2v85sx84v.fsf@macmutant.fritz.box>
and subject line Re: bug#30980: [PATCH] add customize option for flymake
has caused the debbugs.gnu.org bug report #30980,
regarding [PATCH] add customize option for flymake
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
30980: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30980
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] add customize option for flymake Date: Wed, 28 Mar 2018 17:27:56 -0500 User-agent: mu4e 1.0; emacs 26.0.91
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@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




Attachment: 0001-New-customize-option-LaTeX-flymake-chktex-flags.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Re: bug#30980: [PATCH] add customize option for flymake Date: Tue, 12 Mar 2024 07:43:28 +0100 User-agent: Gnus/5.13 (Gnus v5.13)
Arash Esbati <arash@gnu.org> writes:

> Alex Branham <alex.branham@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


--- End Message ---

reply via email to

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