]> git.eshelyaron.com Git - emacs.git/commitdiff
(flyspell-math-tex-command-p): Always catch errors raised in
authorChong Yidong <cyd@stupidchicken.com>
Wed, 17 Sep 2008 00:55:38 +0000 (00:55 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Wed, 17 Sep 2008 00:55:38 +0000 (00:55 +0000)
`texmathp'.
(flyspell-tex-math-initialized): Remove.

lisp/textmodes/flyspell.el

index 47297c9fb1ae80655dc26f3839ba8fe671242c08..4296861fe614ee9af8c9d51cbd7c0dd00da13c1f 100644 (file)
@@ -1165,36 +1165,20 @@ Mostly we check word delimiters."
              (if ispell-quit (setq ispell-quit nil))
              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 ...                                       */