aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-09-17 00:55:38 +0000
committerChong Yidong2008-09-17 00:55:38 +0000
commitf768e8e8c9be33c72dd5768daa11a21cfa580252 (patch)
tree309fe54cd2bff5c82268dd0b5febb77cfa3f839c
parent6db65bf8bd58976d7f3dfbd36ab5782600fb833c (diff)
downloademacs-f768e8e8c9be33c72dd5768daa11a21cfa580252.tar.gz
emacs-f768e8e8c9be33c72dd5768daa11a21cfa580252.zip
(flyspell-math-tex-command-p): Always catch errors raised in
`texmathp'. (flyspell-tex-math-initialized): Remove.
-rw-r--r--lisp/textmodes/flyspell.el28
1 files changed, 6 insertions, 22 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 47297c9fb1a..4296861fe61 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1166,35 +1166,19 @@ Mostly we check word delimiters."
1166 res)))))))) 1166 res))))))))
1167 1167
1168;;*---------------------------------------------------------------------*/ 1168;;*---------------------------------------------------------------------*/
1169;;* flyspell-tex-math-initialized ... */
1170;;*---------------------------------------------------------------------*/
1171(defvar flyspell-tex-math-initialized nil)
1172
1173;;*---------------------------------------------------------------------*/
1174;;* flyspell-math-tex-command-p ... */ 1169;;* flyspell-math-tex-command-p ... */
1175;;* ------------------------------------------------------------- */ 1170;;* ------------------------------------------------------------- */
1176;;* This function uses the texmathp package to check if (point) */ 1171;;* This function uses the texmathp package to check if point */
1177;;* is within a tex command. In order to avoid using */ 1172;;* is within a TeX math environment. `texmathp' can yield errors */
1178;;* condition-case each time we use the variable */ 1173;;* if the document is currently not valid TeX syntax. */
1179;;* flyspell-tex-math-initialized to make a special case the first */
1180;;* time that function is called. */
1181;;*---------------------------------------------------------------------*/ 1174;;*---------------------------------------------------------------------*/
1182(defun flyspell-math-tex-command-p () 1175(defun flyspell-math-tex-command-p ()
1183 (when (fboundp 'texmathp) 1176 (when (fboundp 'texmathp)
1184 (cond 1177 (if flyspell-check-tex-math-command
1185 (flyspell-check-tex-math-command 1178 nil
1186 nil)
1187 ((eq flyspell-tex-math-initialized t)
1188 (texmathp))
1189 ((eq flyspell-tex-math-initialized 'error)
1190 nil)
1191 (t
1192 (setq flyspell-tex-math-initialized t)
1193 (condition-case nil 1179 (condition-case nil
1194 (texmathp) 1180 (texmathp)
1195 (error (progn 1181 (error nil)))))
1196 (setq flyspell-tex-math-initialized 'error)
1197 nil)))))))
1198 1182
1199;;*---------------------------------------------------------------------*/ 1183;;*---------------------------------------------------------------------*/
1200;;* flyspell-tex-command-p ... */ 1184;;* flyspell-tex-command-p ... */