GNU bug report logs -
#728
23.0.60; flyspell checking is sometimes silently disabled
Previous Next
Full log
Message #35 received at 728 <at> emacsbugs.donarmstrong.com (full text, mbox):
The following patch fixes this problem for me:
2008-09-14 Markus Triska <markus.triska <at> gmx.at>
* textmodes/flyspell.el (flyspell-math-tex-command-p): Always
catch errors raised in `texmathp'.
(flyspell-tex-math-initialized): Remove.
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 47297c9..4296861 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1166,35 +1166,19 @@ Mostly we check word delimiters."
res))))))))
;;*---------------------------------------------------------------------*/
-;;* flyspell-tex-math-initialized ... */
-;;*---------------------------------------------------------------------*/
-(defvar flyspell-tex-math-initialized nil)
-
-;;*---------------------------------------------------------------------*/
;;* flyspell-math-tex-command-p ... */
;;* ------------------------------------------------------------- */
-;;* This function uses the texmathp package to check if (point) */
-;;* is within a tex command. In order to avoid using */
-;;* condition-case each time we use the variable */
-;;* flyspell-tex-math-initialized to make a special case the first */
-;;* time that function is called. */
+;;* This function uses the texmathp package to check if point */
+;;* is within a TeX math environment. `texmathp' can yield errors */
+;;* if the document is currently not valid TeX syntax. */
;;*---------------------------------------------------------------------*/
(defun flyspell-math-tex-command-p ()
(when (fboundp 'texmathp)
- (cond
- (flyspell-check-tex-math-command
- nil)
- ((eq flyspell-tex-math-initialized t)
- (texmathp))
- ((eq flyspell-tex-math-initialized 'error)
- nil)
- (t
- (setq flyspell-tex-math-initialized t)
+ (if flyspell-check-tex-math-command
+ nil
(condition-case nil
(texmathp)
- (error (progn
- (setq flyspell-tex-math-initialized 'error)
- nil)))))))
+ (error nil)))))
;;*---------------------------------------------------------------------*/
;;* flyspell-tex-command-p ... */
This bug report was last modified 16 years and 253 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.