From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.bugs Subject: bug#728: 23.0.60; flyspell checking is sometimes silently disabled Date: Sun, 14 Sep 2008 20:33:48 +0200 Message-ID: References: <87k5eaj6he.fsf@cyd.mit.edu> Reply-To: Markus Triska , 728@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221418069 25086 80.91.229.12 (14 Sep 2008 18:47:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Sep 2008 18:47:49 +0000 (UTC) Cc: 728@emacsbugs.donarmstrong.com To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 14 20:48:45 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KeweL-0007Mp-0g for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Sep 2008 20:48:45 +0200 Original-Received: from localhost ([127.0.0.1]:52991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KewdK-0005wm-Ac for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Sep 2008 14:47:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KewdG-0005wN-Nc for bug-gnu-emacs@gnu.org; Sun, 14 Sep 2008 14:47:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KewdF-0005vk-AN for bug-gnu-emacs@gnu.org; Sun, 14 Sep 2008 14:47:38 -0400 Original-Received: from [199.232.76.173] (port=52340 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KewdF-0005vg-29 for bug-gnu-emacs@gnu.org; Sun, 14 Sep 2008 14:47:37 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:40075) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KewdE-0000am-GY for bug-gnu-emacs@gnu.org; Sun, 14 Sep 2008 14:47:36 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8EIlYB7020660; Sun, 14 Sep 2008 11:47:34 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m8EIe4vV017516; Sun, 14 Sep 2008 11:40:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Markus Triska Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 14 Sep 2008 18:40:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 728 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 728-submit@emacsbugs.donarmstrong.com id=B728.122141724415633 (code B ref 728); Sun, 14 Sep 2008 18:40:04 +0000 Original-Received: (at 728) by emacsbugs.donarmstrong.com; 14 Sep 2008 18:34:04 +0000 Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m8EIXxia015518 for <728@emacsbugs.donarmstrong.com>; Sun, 14 Sep 2008 11:34:01 -0700 Original-Received: (qmail invoked by alias); 14 Sep 2008 18:33:54 -0000 Original-Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp011) with SMTP; 14 Sep 2008 20:33:54 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX19nO+RnmVlna+FHaAGVDppdp3s09pmIjZdyJHWbQ6 Px4HFyJKmfAuo1 Original-Received: by mt-computer.local (Postfix, from userid 502) id 4750AADDC18; Sun, 14 Sep 2008 20:33:48 +0200 (CEST) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.61 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 14 Sep 2008 14:47:38 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:20538 Archived-At: The following patch fixes this problem for me: 2008-09-14 Markus Triska * 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 ... */