Function: ispell-buffer-local-dict

ispell-buffer-local-dict is a byte-compiled function defined in ispell.el.gz.

Signature

(ispell-buffer-local-dict &optional NO-RELOAD)

Documentation

Initialize local dictionary and local personal dictionary.

If optional NO-RELOAD is non-nil, do not reload any dictionary. When a dictionary is defined in the buffer (see variable ispell-dictionary-keyword), it will override the local setting from M-x ispell-change-dictionary (ispell-change-dictionary). Both should not be used to define a buffer-local dictionary.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/ispell.el.gz
;; Can kill the current ispell process

(defun ispell-buffer-local-dict (&optional no-reload)
  "Initialize local dictionary and local personal dictionary.
If optional NO-RELOAD is non-nil, do not reload any dictionary.
When a dictionary is defined in the buffer (see variable
`ispell-dictionary-keyword'), it will override the local setting
from \\[ispell-change-dictionary].
Both should not be used to define a buffer-local dictionary."
  (save-excursion
    (goto-char (point-min))
    (let (end)
      ;; Override the local variable definition.
      ;; Uses last occurrence of ispell-dictionary-keyword.
      (goto-char (point-max))
      (unless ispell-local-dictionary-overridden
	(if (search-backward ispell-dictionary-keyword nil t)
	    (progn
	      (search-forward ispell-dictionary-keyword)
              (setq end (line-end-position))
	      (if (re-search-forward " *\\([^ \"]+\\)" end t)
		  (setq ispell-local-dictionary
			(match-string-no-properties 1))))))
      (goto-char (point-max))
      (if (search-backward ispell-pdict-keyword nil t)
	  (progn
	    (search-forward ispell-pdict-keyword)
            (setq end (line-end-position))
	    (if (re-search-forward " *\\([^ \"]+\\)" end t)
		(setq ispell-local-pdict
		      (match-string-no-properties 1)))))))
  (unless no-reload
    ;; Reload if new dictionary (maybe the personal one) defined.
    (ispell-internal-change-dictionary)))