| 63 | | (defun erc-spelling-init () |
|---|
| 64 | | "Enable flyspell mode in an ERC buffer." |
|---|
| 65 | | (let ((name (downcase (buffer-name))) |
|---|
| 66 | | (dicts erc-spelling-dictionaries)) |
|---|
| 67 | | (when dicts |
|---|
| 68 | | (while (and dicts |
|---|
| 69 | | (not (string= name (downcase (caar dicts))))) |
|---|
| 70 | | (setq dicts (cdr dicts))) |
|---|
| 71 | | (setq ispell-local-dictionary |
|---|
| 72 | | (if dicts |
|---|
| 73 | | (cadr (car dicts)) |
|---|
| 74 | | (let ((server (erc-server-buffer))) |
|---|
| 75 | | (if server |
|---|
| 76 | | (with-current-buffer server |
|---|
| 77 | | ispell-local-dictionary) |
|---|
| 78 | | nil)))))) |
|---|
| 79 | | (setq flyspell-generic-check-word-p 'erc-spelling-flyspell-verify) |
|---|
| 80 | | (flyspell-mode 1)) |
|---|
| | 61 | (defun erc-spelling-init (buffer) |
|---|
| | 62 | "Enable flyspell mode in an ERC buffer. |
|---|
| | 63 | The current buffer is given by BUFFER." |
|---|
| | 64 | (with-current-buffer buffer |
|---|
| | 65 | (let ((name (downcase (buffer-name))) |
|---|
| | 66 | (dicts erc-spelling-dictionaries)) |
|---|
| | 67 | (when dicts |
|---|
| | 68 | (while (and dicts |
|---|
| | 69 | (not (string= name (downcase (caar dicts))))) |
|---|
| | 70 | (setq dicts (cdr dicts))) |
|---|
| | 71 | (setq ispell-local-dictionary |
|---|
| | 72 | (if dicts |
|---|
| | 73 | (cadr (car dicts)) |
|---|
| | 74 | (erc-with-server-buffer ispell-local-dictionary))))) |
|---|
| | 75 | (setq flyspell-generic-check-word-p 'erc-spelling-flyspell-verify) |
|---|
| | 76 | (flyspell-mode 1))) |
|---|