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 485392251c6576f9402d98126399b65f98e5513f
Author: Michael Olson <address@hidden>
Date:   Sun Jul 9 04:20:19 2006 +0000

    Merged from erc--rel--5.1.
    
    Patches applied:
    
     * address@hidden/erc--rel--5.1--patch-20
       erc-log: Do not immediately insinuate when the file is loaded.
    git-archimport-id: address@hidden/erc--main--0--patch-16

diff --git a/ChangeLog b/ChangeLog
index 9bfa4bc..2cc0745 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-07-09  Michael Olson  <address@hidden>
+
+       * erc-log.el (log): Move all add-hook calls here, rather than
+       executing them immediately, and also cause them to be un-hooked
+       when the module is removed.
+
 2006-07-08  Michael Olson  <address@hidden>
 
        * erc-log.el (erc-log-insert-log-on-open): Make this nil by
diff --git a/erc-log.el b/erc-log.el
index 2454a2a..8328881 100644
--- a/erc-log.el
+++ b/erc-log.el
@@ -208,30 +208,27 @@ also be a predicate function. To only log when you are 
not set away, use:
          (not erc-away))))"
   ;; enable
   ((when erc-log-write-after-insert
-     (add-hook 'erc-insert-post-hook
-              'erc-save-buffer-in-logs))
+     (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)))
+     (add-hook 'erc-send-post-hook 'erc-save-buffer-in-logs))
+   (add-hook 'erc-kill-buffer-hook 'erc-save-buffer-in-logs)
+   (add-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs)
+   (add-hook 'erc-quit-hook 'erc-conditional-save-queries)
+   (add-hook 'erc-part-hook 'erc-conditional-save-buffer)
+   ;; append, so that 'erc-initialize-log-marker runs first
+   (add-hook 'erc-connect-pre-hook 'erc-log-setup-logging 'append))
   ;; disable
-  ((remove-hook 'erc-insert-post-hook
-               'erc-save-buffer-in-logs)
-   (remove-hook 'erc-send-post-hook
-               'erc-save-buffer-in-logs)))
-
-(when erc-enable-logging
-  (add-hook 'erc-kill-buffer-hook
-           'erc-save-buffer-in-logs)
-  (add-hook 'erc-kill-channel-hook
-           'erc-save-buffer-in-logs)
-  (add-hook 'erc-quit-hook
-           'erc-conditional-save-queries)
-  (add-hook 'erc-part-hook
-           'erc-conditional-save-buffer))
+  ((remove-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs)
+   (remove-hook 'erc-send-post-hook 'erc-save-buffer-in-logs)
+   (remove-hook 'erc-kill-buffer-hook 'erc-save-buffer-in-logs)
+   (remove-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs)
+   (remove-hook 'erc-quit-hook 'erc-conditional-save-queries)
+   (remove-hook 'erc-part-hook 'erc-conditional-save-buffer)
+   (remove-hook 'erc-connect-pre-hook 'erc-log-setup-logging)))
 
 (define-key erc-mode-map "\C-c\C-l" 'erc-save-buffer-in-logs)
 
-;;;functionality referenced from erc.el
+;;; functionality referenced from erc.el
 (defun erc-log-setup-logging ()
   "Setup the buffer-local logging variables in the current buffer.
 This function is destined to be run from `erc-connect-pre-hook'."
@@ -252,9 +249,6 @@ This function is destined to be run from 
`erc-connect-pre-hook'."
                     (move-marker erc-last-saved-position
                                  (1- (point-max)))))))
 
-;;; Append, so that 'erc-initialize-log-marker keeps running first.
-(add-hook 'erc-connect-pre-hook 'erc-log-setup-logging 'append)
-
 (defun erc-log-all-but-server-buffers (buffer)
   "Returns t if logging should be enabled in BUFFER.
 Returns nil iff `erc-server-buffer-p' returns t."




reply via email to

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