Function: flyspell-accept-buffer-local-defs

flyspell-accept-buffer-local-defs is a byte-compiled function defined in flyspell.el.gz.

Signature

(flyspell-accept-buffer-local-defs &optional FORCE)

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/flyspell.el.gz
(defun flyspell-accept-buffer-local-defs (&optional force)
  ;; When flyspell-word is used inside a loop (e.g. when processing
  ;; flyspell-changes), the calls to `ispell-accept-buffer-local-defs' end
  ;; up dwarfing everything else, so only do it when the buffer has changed.
  (when (or force (not (eq flyspell-last-buffer (current-buffer))))
    (setq flyspell-last-buffer (current-buffer))
    ;; Strange problem:  If buffer in current window has font-lock turned on,
    ;; but SET-BUFFER was called to point to an invisible buffer, this ispell
    ;; call will reset the buffer to the buffer in the current window.
    ;; However, it only happens at startup (fix by Albert L. Ting).
    (save-current-buffer
      (ispell-accept-buffer-local-defs))
    (unless (and (eq flyspell-dash-dictionary ispell-dictionary)
                 (eq flyspell-dash-local-dictionary ispell-local-dictionary))
      ;; The dictionary has changed
      (setq flyspell-dash-dictionary ispell-dictionary)
      (setq flyspell-dash-local-dictionary ispell-local-dictionary)
      (setq flyspell-consider-dash-as-word-delimiter-flag
            (member (or ispell-local-dictionary ispell-dictionary)
                    flyspell-dictionaries-that-consider-dash-as-word-delimiter)))))