bnbeckwith/writegood-mode

Fails to do check when enabled via add-hook

Closed this issue · 7 comments

I have added writegood-mode to a hook for LaTeX-mode:

(add-hook 'LaTeX-mode-hook 'writegood-mode))

When I open a latex file, writegood-mode is enabled; however, it doesn't highlight any of the trouble areas. If I execute writegood-mode, it disables writegood. If I execute again, writegood-mode is enabled and the highlighting works as normal.

Any idea why it wouldn't work when enabled via another mode-hook?

Not the author, but hooks work for me.
If you try:
(add-hook 'LaTeX-mode-hook 'writegood-turn-on), does it then work?

Thanks for the suggestion; however, writegood-turn-on is not one of its autoload functions, so it is not available after requiring the package. As such, nothing happens with the hook.

@powellb writegood-mode relies on font-lock-mode. Is it possible that other hooks are messing around with font-lock-mode?

I'll try more to see if I can narrow down the issue and get a resolution.

@powellb, did you ever find a resolution to this issue?

I'm closing this as I could not recreate the issue.

Hello. I am experiencing exactly the same issue as @powellb . There is a similar issue reported here but I couldn't get it to work with an hook on the TeX-update-style-hook. I've also tried to deactivate other modes that provide highlighting (such as flyspell) but no joy so far...
FYI, I am writing my auctex configuration below

;; TeXcount setup for AUCTeX
(use-package tex
  :ensure auctex :ensure reftex :ensure writegood-mode
  :defer t
  :bind ([f9] . toggle-between-matlab-mode-and-latex-mode)
  :hook (
	 (LaTeX-mode . turn-on-reftex)
	 (LaTeX-mode . flyspell-mode)
	 (LaTeX-mode . visual-line-mode)
	 (LaTeX-mode . turn-on-auto-fill)
	 )
  :init
  (setq TeX-parse-self t)
  (defun toggle-between-matlab-mode-and-latex-mode ()
    (interactive)
    (cond ((eq major-mode 'matlab-mode) (latex-mode))
	  ((eq major-mode 'latex-mode) (matlab-mode))))

  ;; PDF-LATEX+INKSCAPE
  (setq TeX-PDF-mode t) ;; Always use PDFLaTeX
  (setq reftex-external-file-finders
	'(("tex" . "kpsewhich -format=.tex %f")
	  ("bib" . "kpsewhich -format=.bib %f")))
  :config
  (setq reftex-plug-into-AUCTeX t)
  (setq LaTeX-beamer-item-overlay-flag nil)	; avoid stupid overlay 
						; when calling itemize
  (add-to-list 'TeX-command-list
	       (list "TeXcount" "texcount %s.tex" 'TeX-run-command nil t)))