Show
Ignore:
Timestamp:
04/07/07 15:49:28 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/erc/erc-spelling.el

    r4190 r4200  
    4242  ((add-hook 'erc-connect-pre-hook 'erc-spelling-init) 
    4343   (dolist (buffer (erc-buffer-list)) 
    44      (when (buffer-live-p buffer) 
    45        (with-current-buffer buffer (erc-spelling-init))))) 
     44     (erc-spelling-init buffer))) 
    4645  ((remove-hook 'erc-connect-pre-hook 'erc-spelling-init) 
    4746   (dolist (buffer (erc-buffer-list)) 
    48      (when (buffer-live-p buffer) 
    49        (with-current-buffer buffer (flyspell-mode 0)))))) 
     47     (with-current-buffer buffer (flyspell-mode 0))))) 
    5048 
    5149(defcustom erc-spelling-dictionaries nil 
     
    6159  :group 'erc-spelling) 
    6260 
    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. 
     63The 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))) 
    8177 
    8278(defun erc-spelling-unhighlight-word (word)