Function: ispell-add-per-file-word-list

ispell-add-per-file-word-list is a byte-compiled function defined in ispell.el.gz.

Signature

(ispell-add-per-file-word-list WORD)

Documentation

Add WORD to the per-file word list.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/ispell.el.gz
(defun ispell-add-per-file-word-list (word)
  "Add WORD to the per-file word list."
  (or ispell-buffer-local-name
      (setq ispell-buffer-local-name (buffer-name)))
  (save-excursion
    (goto-char (point-min))
    (let (line-okay search done found)
      (while (not done)
        (let ((case-fold-search nil))
          (setq search (search-forward ispell-words-keyword nil t)
	      found (or found search)
	      line-okay (< (+ (length word) 1 ; 1 for space after word..
			      (progn (end-of-line) (current-column)))
                             fill-column)))
	(if (or (and search line-okay)
		(null search))
	    (progn
	      (setq done t)
	      (if (null search)
		  (progn
		    (if found (insert "\n")  ;; after an existing LocalWords
                      (goto-char (point-max)) ;; no LocalWords, go to end of file
                      (open-line 1)
                      (newline))
		    (insert (if comment-start
                                (concat
                                  (progn
                                   ;; Try and use the proper comment marker,
                                   ;; e.g. ";;" rather than ";".
                                    (comment-normalize-vars)
                                    (comment-padright comment-start
                                                      (comment-add nil))
                                    comment-start)
                                  " ")
                              "")
                            ispell-words-keyword)
                    (if (and comment-end (> (length comment-end) 0))
			(save-excursion
			  (newline)
			  (insert comment-end)))))
	      (insert (concat " " word))))))))