emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange code in flyspell.el


From: Stefan Monnier
Subject: Re: Strange code in flyspell.el
Date: Wed, 19 Jul 2006 11:14:50 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>     Does anyone know a reason why the patch below shouldn't be applied?

> There was no patch.

Hmm, you have a point.  How 'bout with the patch?


        Stefan


> Does anyone know a reason why the patch below shouldn't be applied?
> Manual, I know you don't maintain this package any more, but this is code
> that dates back to version 1.5d, so you're the expert ;-)

> In version before 1.5d, the two functions `flyspell-get-casechars' and
> `flyspell-get-not-casechars' returned a slightly different regexp than
> ispell-get-casechars: they added the char { and } in the list of accepted
> chars when in `tex' spelling mode.  So the code made sense.  But ever since
> 1.5d it seems that they've turned into just large no-ops.


--- orig/lisp/textmodes/flyspell.el
+++ mod/lisp/textmodes/flyspell.el
@@ -1162,63 +1162,8 @@
                        (>= (match-end 0) b))))))
       (flyspell-math-tex-command-p)))
 
-;;*---------------------------------------------------------------------*/
-;;*    flyspell-casechars-cache ...                                     */
-;;*---------------------------------------------------------------------*/
-(defvar flyspell-casechars-cache nil)
-(defvar flyspell-ispell-casechars-cache nil)
-(make-variable-buffer-local 'flyspell-casechars-cache)
-(make-variable-buffer-local 'flyspell-ispell-casechars-cache)
-
-;;*---------------------------------------------------------------------*/
-;;*    flyspell-get-casechars ...                                       */
-;;*---------------------------------------------------------------------*/
-(defun flyspell-get-casechars ()
-  "This function builds a string that is the regexp of word chars.
-In order to avoid one useless string construction,
-this function changes the last char of the `ispell-casechars' string."
-  (let ((ispell-casechars (ispell-get-casechars)))
-    (cond
-     ((eq ispell-parser 'tex)
-      (setq flyspell-ispell-casechars-cache ispell-casechars)
-      (setq flyspell-casechars-cache
-           (concat (substring ispell-casechars
-                              0
-                              (- (length ispell-casechars) 1))
-                   "]"))
-      flyspell-casechars-cache)
-     (t
-      (setq flyspell-ispell-casechars-cache ispell-casechars)
-      (setq flyspell-casechars-cache ispell-casechars)
-      flyspell-casechars-cache))))
-
-;;*---------------------------------------------------------------------*/
-;;*    flyspell-get-not-casechars-cache ...                             */
-;;*---------------------------------------------------------------------*/
-(defvar flyspell-not-casechars-cache nil)
-(defvar flyspell-ispell-not-casechars-cache nil)
-(make-variable-buffer-local 'flyspell-not-casechars-cache)
-(make-variable-buffer-local 'flyspell-ispell-not-casechars-cache)
-
-;;*---------------------------------------------------------------------*/
-;;*    flyspell-get-not-casechars ...                                   */
-;;*---------------------------------------------------------------------*/
-(defun flyspell-get-not-casechars ()
-  "This function builds a string that is the regexp of non-word chars."
-  (let ((ispell-not-casechars (ispell-get-not-casechars)))
-    (cond
-     ((eq ispell-parser 'tex)
-      (setq flyspell-ispell-not-casechars-cache ispell-not-casechars)
-      (setq flyspell-not-casechars-cache
-           (concat (substring ispell-not-casechars
-                              0
-                              (- (length ispell-not-casechars) 1))
-                   "]"))
-      flyspell-not-casechars-cache)
-     (t
-      (setq flyspell-ispell-not-casechars-cache ispell-not-casechars)
-      (setq flyspell-not-casechars-cache ispell-not-casechars)
-      flyspell-not-casechars-cache))))
+(defalias 'flyspell-get-casechars 'ispell-get-casechars)
+(defalias 'flyspell-get-not-casechars 'ispell-get-not-casechars)
 
 ;;*---------------------------------------------------------------------*/
 ;;*    flyspell-get-word ...                                            */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]