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-stamp.el,v


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

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

Index: lisp/erc/erc-stamp.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/erc/erc-stamp.el,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- lisp/erc/erc-stamp.el       21 Jan 2007 02:47:36 -0000      1.8
+++ lisp/erc/erc-stamp.el       1 Apr 2007 13:36:37 -0000       1.9
@@ -147,7 +147,7 @@
        (error "Timestamp function unbound"))
       (when (and (fboundp erc-insert-away-timestamp-function)
                 erc-away-timestamp-format
-                (with-current-buffer (erc-server-buffer) erc-away)
+                (erc-away-time)
                 (not erc-timestamp-format))
        (funcall erc-insert-away-timestamp-function
                 (erc-format-timestamp ct erc-away-timestamp-format)))
@@ -203,6 +203,7 @@
         (s (if ignore-p (make-string len ? ) string)))
     (unless ignore-p (setq erc-timestamp-last-inserted string))
     (erc-put-text-property 0 len 'field 'erc-timestamp s)
+    (erc-put-text-property 0 len 'invisible 'timestamp s)
     (insert s)))
 
 (defun erc-insert-aligned (string pos)
@@ -319,6 +320,21 @@
   (setq erc-hide-timestamps nil)
   (erc-munge-invisibility-spec))
 
+(defun erc-toggle-timestamps ()
+  "Hide or show timestamps in ERC buffers.
+
+Note that timestamps can only be shown for a message using this
+function if `erc-timestamp-format' was set and timestamping was
+enabled when the message was inserted."
+  (interactive)
+  (if erc-hide-timestamps
+      (setq erc-hide-timestamps nil)
+    (setq erc-hide-timestamps t))
+  (mapc (lambda (buffer)
+         (with-current-buffer buffer
+           (erc-munge-invisibility-spec)))
+       (erc-buffer-list)))
+
 (defun erc-echo-timestamp (before now)
   "Print timestamp text-property of an IRC message.
 Argument BEFORE is where point was before it got moved and




reply via email to

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