(defvar spell-command "spell" "\ *Command to run the spell program.") (defvar spell-filter nil "\ *Filter function to process text before passing it to spell program. This function might remove text-processor commands. nil means don't alter the text before checking it.") (defun spell-buffer nil "\ Check spelling of every word in the buffer. For each incorrect word, you are asked for the correct spelling and then put into a query-replace to fix some or all occurrences. If you do not want to change a word, just give the same word as its \"correct\" spelling; then the query replace is skipped." (interactive) (byte-code "ÀˆÁedÂ#‡" [nil spell-region "buffer"] 4)) (defun spell-word nil "\ Check spelling of word at or before point. If it is not correct, ask user for the correct spelling and query-replace the entire buffer to substitute it." (interactive) (byte-code "ÈÃÃÊÄÅ!?…ÆÇ!ˆ`‰ˆÆÈ!ˆ`‰)ˆÉ Ê \"#+‡" [beg end spell-filter nil looking-at "\\<" forward-word -1 1 spell-region buffer-substring] 9)) (defun spell-region (start end &optional description) "\ Like spell-buffer but applies only to region. Used in a program, applies from START to END. DESCRIPTION is an optional string naming the unit being checked: for example, \"word\"." (interactive "r") (byte-code "Lj ÏÐ!Š qˆÑ ˆÒ )ˆÓÔ †Õ\"ˆ?…&Ö SfUƒK×Ø \"ƒ;Ù ØÇ %‚HÙ Ç ÇÚ &‚ˆp Š qˆÛ  #ˆn†`Öcˆ…hÜ!ˆ×Ø \"ƒzÙedØÊ %‚†ÙedÊ ÇÚ &))ˆÓÝ †ÕŠ qˆÞ ßV)ƒ à‚¡á#ˆÇÇÊÊ   Š qˆÞ ßV)… Š qˆebˆâã`ä ˆ`\"!‰ ˆåæ!ˆçe`\"ˆèé êQ \"‰ ˆëìí !îQ!)ˆï  \"?…ebˆðñí !ñQ \"ˆ‚¯,*‡" [filter spell-filter buf description end spell-command start nil shell-file-name oldbuf t word newword case-fold-search case-replace get-buffer-create " *temp*" widen erase-buffer message "Checking spelling of %s..." "region" 10 string= "spell" call-process-region "-c" insert-buffer-substring funcall "Checking spelling of %s...%s" buffer-size 0 "not correct" "correct" downcase buffer-substring end-of-line forward-char 1 delete-region read-input "`" "' not recognized; edit a replacement: " flush-lines "^" regexp-quote "$" equal query-replace-regexp "\\b"] 30)) (defun spell-string (string) "\ Check spelling of string supplied as argument." (interactive "sSpell string: ") (byte-code "ňÆÇ!ŠqˆÈ ˆÉ ˆÊ Ë\"ˆÌÍ \"ƒ&ÎedÍÃÃ%‚1Îed ÃÃÅÏ &ˆÐÑ Uƒ@ÒÓ \"‚ZebˆÔËÅÃ#…RÕÖ!ˆ‚CˆÒ×ØÙd\"\"))‡" [buf string spell-command t shell-file-name nil get-buffer-create " *temp*" widen erase-buffer insert " " string= "spell" call-process-region "-c" 0 buffer-size message "%s is correct" search-forward replace-match " " "%sincorrect" buffer-substring 1] 16))