[gnu.emacs] spell

kimw@EN.ECN.PURDUE.EDU (Whoi Y Kim) (03/14/89)

Can anybody tell me how to incorporate your own dictionary for "spell"?
Often when you have people's names or some gargons appeared in your paper,
the spelling routine picks up every word. (the "spell" even picks up
"emacs" -- what a surprise!). So I need to have my own file which
contains those jargons so that "spell-buffer(word)" can use the file as well
as its own dictionary.
By the way, the emacs that we are using is gnu.emacs.18.52.

Thanks in advance....

eap@bu-cs.BU.EDU (Eric Pearce) (03/15/89)

In article <8903132006.AA13089@en.ecn.purdue.edu> kimw@EN.ECN.PURDUE.EDU (Whoi Y Kim) says:
>
>Can anybody tell me how to incorporate your own dictionary for "spell"?
>Often when you have people's names or some gargons appeared in your paper,
>the spelling routine picks up every word. (the "spell" even picks up
>"emacs" -- what a surprise!). So I need to have my own file which
>contains those jargons so that "spell-buffer(word)" can use the file as well
>as its own dictionary.
>By the way, the emacs that we are using is gnu.emacs.18.52.
>
>Thanks in advance....

  Yeah, bag "spell" and use "ispell".  This note is from prep.ai.mit.edu:
  
  Sources are from celray.cs.yale.edu as of 18 May 1988.
  Root is /u/public/ispell/ and contains the following:
    dict.shar.Z    137,622
    ispell.shar.Z  108,435
    ispell.el       22,712

-- 
-------------------------------------------------------------------------------
 Eric Pearce                                   ARPANET eap@bu-it.bu.edu
 Boston University Information Technology      CSNET   eap%bu-it@bu-cs
 111 Cummington Street                         JNET    jnet%"ep@buenga" 
 Boston MA 02215                               UUCP    !harvard!bu-cs!bu-it!eap 
 617-353-2780 voice  617-353-6260 fax          BITNET  ep@buenga

montnaro@sprite.steinmetz.ge.com (Skip Montanaro) (03/15/89)

Whoi Y Kim asked about adding private dictionaries to GNU Emacs spell stuff.
A month or so ago I modified spell.el to use a private spelling dictionary.
Context diffs (from spell.el for 18.52) are at the end of this message.

In my ~/.emacs file I set the new variable, spell-dict, to an alternate hash
list file that will be used with the -d qualifier to spell

    (setq spell-dict (expand-file-name "~montnaro/misc/dictlist"))

and since I can never remember how to make alternate hash list files, I also
created a Makefile in my misc directory with the following target:

    dictlist : dict /usr/dict/hlista
	    sort dict | spellin /usr/dict/hlista > dictlist

I just add new words to ~/misc/dictlist as I come across them and execute
make to update the hash list.

[An aside. Are there other people besides myself who think that mkdir(1)
should automatically create a Makefile and an SCCS (or RCS) subdirectory?
How I ever lived without make and sccs when I used VMS (before MMS and CMS
were available), I'll never know.]

The default behavior (spell-dict == nil) is identical to the behavior of the
currently distributed spell.el.

Context diffs (suitable for consumption by patch):

diff -rc2 /usr/local/emacs/lisp/spell.el spell.el
*** /usr/local/emacs/lisp/spell.el	Wed Oct 26 12:17:10 1988
--- spell.el	Tue Jan 31 10:57:15 1989
***************
*** 28,31 ****
--- 28,34 ----
  nil means don't alter the text before checking it.")
  
+ (defvar spell-dict nil
+   "*Alternate spelling list for spell(1).")
+ 
  (defun spell-buffer ()
    "Check spelling of every word in the buffer.
***************
*** 65,69 ****
      (if (and (null spell-filter) (= ?\n (char-after (1- end))))
  	(if (string= "spell" spell-command)
! 	    (call-process-region start end "spell" nil buf)
  	  (call-process-region start end shell-file-name
  			       nil buf nil "-c" spell-command))
--- 68,73 ----
      (if (and (null spell-filter) (= ?\n (char-after (1- end))))
  	(if (string= "spell" spell-command)
! 	    (call-process-region start end "spell" nil buf nil
! 				 (if spell-dict "-d " nil) spell-dict)
  	  (call-process-region start end shell-file-name
  			       nil buf nil "-c" spell-command))
***************
*** 75,79 ****
  	 (if spell-filter (funcall spell-filter))
  	 (if (string= "spell" spell-command)
! 	     (call-process-region (point-min) (point-max) "spell" t buf)
  	   (call-process-region (point-min) (point-max) shell-file-name
  				t buf nil "-c" spell-command)))))
--- 79,84 ----
  	 (if spell-filter (funcall spell-filter))
  	 (if (string= "spell" spell-command)
! 	     (call-process-region (point-min) (point-max) "spell" t buf nil
! 				  (if spell-dict "-d " nil) spell-dict)
  	   (call-process-region (point-min) (point-max) shell-file-name
  				t buf nil "-c" spell-command)))))
***************
*** 121,125 ****
       (if (string= "spell" spell-command)
  	 (call-process-region (point-min) (point-max) "spell"
! 			      t t)
         (call-process-region (point-min) (point-max) shell-file-name
  			    t t nil "-c" spell-command))
--- 126,131 ----
       (if (string= "spell" spell-command)
  	 (call-process-region (point-min) (point-max) "spell"
! 			      t t nil
! 			      (if spell-dict "-d " nil) spell-dict)
         (call-process-region (point-min) (point-max) shell-file-name
  			    t t nil "-c" spell-command))

--
Skip Montanaro (montanaro@sprite.steinmetz.ge.com, montanaro@ge-crd.arpa)