Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!xanth!uunet!steinmetz!vdsvax!montnaro From: montnaro@sprite.steinmetz.ge.com (Skip Montanaro) Newsgroups: gnu.emacs Subject: Re: spell Message-ID: Date: 15 Mar 89 06:12:10 GMT References: <8903132006.AA13089@en.ecn.purdue.edu> Sender: news@vdsvax.steinmetz.ge.com Reply-To: (Skip Montanaro) Distribution: gnu Organization: GE Corporate Research & Development Lines: 86 In-reply-to: kimw@EN.ECN.PURDUE.EDU's message of 13 Mar 89 20:06:51 GMT 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)