[comp.text.tex] Ispelling in emacs, Summary

rdong@boole.msri.org (Rui-Tao Dong) (02/08/91)

	Thanks for the numerous replies to my question. I have finally
settled on the following.  It works fine for me.

	I added the following to my .emacs without touching ispell.el.

(setq LaTeX-mode-hook
      '(lambda () (setq ispell-filter-hook "detex")
	 (setq ispell-filter-hook-args '("-lw"))))

(setq TeX-mode-hook
      '(lambda () (setq ispell-filter-hook "detex")
	 (setq ispell-filter-hook-args '("-w"))))

Thanks again to all the people who have helped.

Regards,

-------------------------------------------------------------------------
	Rui - Tao  Dong         |       (415) 237 - 7628 (H)
	110 Lakeshore Court     |       (415) 643 - 6048 (O)
	Richmond, CA 94804      |       rdong@borel.msri.org

palmerp@galois.math.orst.edu (Paul A. Palmer) (02/09/91)

In article <9670@dog.ee.lbl.gov> rdong@boole.msri.org (Rui-Tao Dong) writes:

	   Thanks for the numerous replies to my question. I have finally
   settled on the following.  It works fine for me.

	   I added the following to my .emacs without touching ispell.el.

   (setq LaTeX-mode-hook
	 '(lambda () (setq ispell-filter-hook "detex")
	    (setq ispell-filter-hook-args '("-lw"))))

   (setq TeX-mode-hook
	 '(lambda () (setq ispell-filter-hook "detex")
	    (setq ispell-filter-hook-args '("-w"))))

First, thank you for posting the solution. I've been following your posts, but
have been too busy this week to try to find a solution myself.

You mentioned in an earlier post that detex will die on an unmatched $ sign.
To fix this problem I now have, in my .emacs file, the following:

(setq LaTeX-mode-hook
      '(lambda () (setq ispell-filter-hook "detex")
	 (setq ispell-filter-hook-args '("-lw"))))

(setq TeX-mode-hook
      '(lambda () (setq ispell-filter-hook "detex")
	 (setq ispell-filter-hook-args '("-w"))))

(setq text-mode-hook
      '(lambda () (setq ispell-filter-hook "tr")
	 (setq ispell-filter-hook-args '("-cs" "A-Za-z" "\012"))))

This works fine, except for one problem. If, for instance, I load & spell a
text buffer, then load & spell a TeX buffer, then switch back to the text
buffer, the hook will now be set to 'detex' not 'tr'. Since this will
hopefully happen very seldom, I'm going to leave good enough alone.

But I'm curious: is there a way to run mode hooks when I _switch_ to a buffer,
as well as _create_ a buffer? Does anyone know?


--
Paul Palmer
Department of Mathematics     	E-mail: palmerp@math.orst.edu
Kidder Hall 368
Oregon State University, Corvallis, Oregon 97331-4605

	 "It's moving so fast, it's standing still." - William Gibson

marc@arnor.uucp (02/12/91)

I think you could use make-local-variable in your lambda
functions to get a local copy of the hook for the buffer.
--


Marc Auslander       <marc@ibm.com>