From e292d82d839684dff5582caefa3a0f0a9f551af4 Mon Sep 17 00:00:00 2001 From: sterni Date: Mon, 27 Mar 2023 19:24:55 +0200 Subject: feat(sterni/emacs): disable warning 8 (dash len) in chktex flychecks Change-Id: I394c48395cdc50bea3747f55d95f169e599018ac Reviewed-on: https://cl.tvl.fyi/c/depot/+/8370 Reviewed-by: sterni Tested-by: BuildkiteCI Autosubmit: sterni --- users/sterni/emacs/default.nix | 15 +++++++++++++++ users/sterni/emacs/init.el | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'users/sterni') diff --git a/users/sterni/emacs/default.nix b/users/sterni/emacs/default.nix index 9ff7da3812b6..cd682fa2eec3 100644 --- a/users/sterni/emacs/default.nix +++ b/users/sterni/emacs/default.nix @@ -3,6 +3,17 @@ let inherit (pkgs.stdenv.hostPlatform) is64bit; + # Wrap chktex(1) with the flags we want because the chktex flycheck checker + # ignores tex-chktex-extra-flags and has no other way to set flags. I did + # not want to mess around with chktexrc because that seems to involve copying + # around a lot of rules (that would need to be updated?). + # + # Warning 8 is about correct dash length. This is really annoying because it'll + # light up everywhere if you use typographically correct dashes in German text. + chktexLessWarnings = pkgs.writeShellScript "chktex-less-warnings" '' + exec chktex -n8 "$@" + ''; + # emacsPgtk is defined in emacs-overlay emacs = (pkgs.emacsPackagesFor pkgs.emacsPgtk).withPackages (epkgs: [ epkgs.bqn-mode @@ -69,6 +80,10 @@ let (setq shell-file-name "${pkgs.bash}/bin/bash" explicit-bash-args '("-l")) + ;; chktex wrapper that disables warnings I don't want + (setq flycheck-tex-chktex-executable "${chktexLessWarnings}") + (setq tex-chktex-program "${chktexLessWarnings}") + (provide 'nix-inject) ''; }) diff --git a/users/sterni/emacs/init.el b/users/sterni/emacs/init.el index d1ccc162d6ed..ea7bac1a2a50 100644 --- a/users/sterni/emacs/init.el +++ b/users/sterni/emacs/init.el @@ -125,7 +125,7 @@ (message (string-trim-right word-count)))) ;; ediff -; doesn't create new window for ediff controls which I always open accidentally +;; doesn't create new window for ediff controls which I always open accidentally (setq ediff-window-setup-function 'ediff-setup-windows-plain) ;; man -- cgit 1.4.1