emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/erc/erc-spelling.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/erc/erc-spelling.el,v
Date: Sun, 01 Apr 2007 13:36:40 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     07/04/01 13:36:38

Index: lisp/erc/erc-spelling.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/erc/erc-spelling.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- lisp/erc/erc-spelling.el    21 Jan 2007 02:47:36 -0000      1.6
+++ lisp/erc/erc-spelling.el    1 Apr 2007 13:36:37 -0000       1.7
@@ -41,12 +41,10 @@
   ;; called AFTER the server buffer is initialized.
   ((add-hook 'erc-connect-pre-hook 'erc-spelling-init)
    (dolist (buffer (erc-buffer-list))
-     (when (buffer-live-p buffer)
-       (with-current-buffer buffer (erc-spelling-init)))))
+     (erc-spelling-init buffer)))
   ((remove-hook 'erc-connect-pre-hook 'erc-spelling-init)
    (dolist (buffer (erc-buffer-list))
-     (when (buffer-live-p buffer)
-       (with-current-buffer buffer (flyspell-mode 0))))))
+     (with-current-buffer buffer (flyspell-mode 0)))))
 
 (defcustom erc-spelling-dictionaries nil
   "An alist mapping buffer names to dictionaries.
@@ -60,8 +58,10 @@
                                (string :tag "Dictionary"))))
   :group 'erc-spelling)
 
-(defun erc-spelling-init ()
-  "Enable flyspell mode in an ERC buffer."
+(defun erc-spelling-init (buffer)
+  "Enable flyspell mode in an ERC buffer.
+The current buffer is given by BUFFER."
+  (with-current-buffer buffer
   (let ((name (downcase (buffer-name)))
         (dicts erc-spelling-dictionaries))
     (when dicts
@@ -71,13 +71,9 @@
       (setq ispell-local-dictionary
             (if dicts
                 (cadr (car dicts))
-              (let ((server (erc-server-buffer)))
-                (if server
-                    (with-current-buffer server
-                      ispell-local-dictionary)
-                  nil))))))
+                (erc-with-server-buffer ispell-local-dictionary)))))
   (setq flyspell-generic-check-word-p 'erc-spelling-flyspell-verify)
-  (flyspell-mode 1))
+    (flyspell-mode 1)))
 
 (defun erc-spelling-unhighlight-word (word)
   "Unhighlight the given WORD.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]