erc-commit
[Top][All Lists]
Advanced

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

[Erc-commit] [commit][emacs22] Merged from erc--rel--5.1.


From: mwolson
Subject: [Erc-commit] [commit][emacs22] Merged from erc--rel--5.1.
Date: Sun, 14 Oct 2007 00:48:18 -0400

commit a4a667c6df7437f91e5584f09be8ba95bc74abe1
Author: Michael Olson <address@hidden>
Date:   Sun Jul 9 03:54:15 2006 +0000

    Merged from erc--rel--5.1.
    
    Patches applied:
    
     * address@hidden/erc--rel--5.1--patch-17
       erc-pcomplete: Fix nil element issue.
    
     * address@hidden/erc--rel--5.1--patch-19
       erc-log: Add a few options for times to save logs.
    git-archimport-id: address@hidden/erc--main--0--patch-15

diff --git a/ChangeLog b/ChangeLog
index 9345e9a..9bfa4bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-07-08  Michael Olson  <address@hidden>
+
+       * erc-log.el (erc-log-insert-log-on-open): Make this nil by
+       default, since most IRC clients don't do this.
+       (erc-log-write-after-send): New option that determines whether the
+       log file will be written to after every sent message.
+       (erc-log-write-after-insert): New option that determines whether
+       the log file will be written to when new text is added to a logged
+       ERC buffer.
+       (log): Use the aforementioned options.
+
+       * erc-pcomplete.el (pcomplete-erc-nicks): Make sure that we don't
+       have a nil element in the list when ignore-self is non-nil.
+
 2006-07-02  Michael Olson  <address@hidden>
 
        * erc-backend.el (erc-call-hooks): Fix (stringp nil) error that
diff --git a/erc-log.el b/erc-log.el
index 42695b0..2454a2a 100644
--- a/erc-log.el
+++ b/erc-log.el
@@ -153,7 +153,7 @@ directory should not end with a trailing slash."
   :type '(choice directory
                 (const nil)))
 
-(defcustom erc-log-insert-log-on-open t
+(defcustom erc-log-insert-log-on-open nil
   "*Insert log file contents into the buffer if a log file exists."
   :group 'erc-log
   :type 'boolean)
@@ -164,6 +164,23 @@ See the variable `erc-save-buffer-on-part' for details."
   :group 'erc-log
   :type 'boolean)
 
+(defcustom erc-log-write-after-send t
+  "*If non-nil, write to log file after every message you send.
+
+If you set this to nil, you may want to enable both
+`erc-save-buffer-on-part' and `erc-save-queries-on-quit'."
+  :group 'erc-log
+  :type 'boolean)
+
+(defcustom erc-log-write-after-insert t
+  "*If non-nil, write to log file when new text is added to a
+logged ERC buffer.
+
+If you set this to nil, you may want to enable both
+`erc-save-buffer-on-part' and `erc-save-queries-on-quit'."
+  :group 'erc-log
+  :type 'boolean)
+
 (defcustom erc-log-file-coding-system (if (featurep 'xemacs)
                                          'binary
                                        'emacs-mule)
@@ -190,10 +207,12 @@ also be a predicate function. To only log when you are 
not set away, use:
        (with-current-buffer buffer
          (not erc-away))))"
   ;; enable
-  ((add-hook 'erc-insert-post-hook
-            'erc-save-buffer-in-logs)
-   (add-hook 'erc-send-post-hook
-            'erc-save-buffer-in-logs))
+  ((when erc-log-write-after-insert
+     (add-hook 'erc-insert-post-hook
+              'erc-save-buffer-in-logs))
+   (when erc-log-write-after-send
+     (add-hook 'erc-send-post-hook
+              'erc-save-buffer-in-logs)))
   ;; disable
   ((remove-hook 'erc-insert-post-hook
                'erc-save-buffer-in-logs)
diff --git a/erc-pcomplete.el b/erc-pcomplete.el
index 695138b..33494bf 100644
--- a/erc-pcomplete.el
+++ b/erc-pcomplete.el
@@ -222,15 +222,16 @@ If optional argument IGNORE-SELF is non-nil, don't return 
the current nick."
   (let ((users (if erc-pcomplete-order-nickname-completions
                    (erc-sort-channel-users-by-activity
                     (erc-get-channel-user-list))
-                 (erc-get-channel-user-list))))
-    (mapcar (lambda (x)
-              (cond (ignore-self
-                     (if (string= (erc-server-user-nickname (car x))
-                                  (erc-current-nick))
-                         nil
-                       (concat (erc-server-user-nickname (car x)) postfix)))
-                    (t (concat (erc-server-user-nickname (car x)) postfix))))
-            users)))
+                 (erc-get-channel-user-list)))
+        (nicks nil))
+    (dolist (user users)
+      (unless (and ignore-self
+                   (string= (erc-server-user-nickname (car user))
+                            (erc-current-nick)))
+        (setq nicks (cons (concat (erc-server-user-nickname (car user))
+                                  postfix)
+                          nicks))))
+    (nreverse nicks)))
 
 (defun pcomplete-erc-all-nicks (&optional postfix)
   "Returns a list of all nicks on the current server."




reply via email to

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