erc-commit
[Top][All Lists]
Advanced

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

[Erc-commit] [commit][emacs22] Made left-side whitespace invisible. Adde


From: mwolson
Subject: [Erc-commit] [commit][emacs22] Made left-side whitespace invisible. Added erc-toggle-timestamps.
Date: Sun, 14 Oct 2007 00:48:43 -0400

commit cc9891a23357885ebaeb6be0b83b505a9406fc2c
Author: Diane Murray <address@hidden>
Date:   Tue Jan 16 21:03:02 2007 +0000

    Made left-side whitespace invisible.  Added erc-toggle-timestamps.
    
    * erc-stamp.el (erc-insert-timestamp-left): Fixed so that the
    whitespace string filler is hidden correctly when timestamps are
    hidden.
    (erc-toggle-timestamps): New function to use instead of
    `erc-show-timestamps' and `erc-hide-timestamps'.
    git-archimport-id: address@hidden/erc--main--0--patch-93

diff --git a/ChangeLog b/ChangeLog
index bc6b1c9..6d40830 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-01-16  Diane Murray  <address@hidden>
 
+       * erc-stamp.el (erc-insert-timestamp-left): Fixed so that the
+       whitespace string filler is hidden correctly when timestamps are
+       hidden.
+       (erc-toggle-timestamps): New function to use instead of
+       `erc-show-timestamps' and `erc-hide-timestamps'.
+
        * erc.el (erc-restore-text-properties): Moved here from
        erc-fill.el since it could be useful in general.
 
diff --git a/erc-stamp.el b/erc-stamp.el
index 6b03713..9edc40d 100644
--- a/erc-stamp.el
+++ b/erc-stamp.el
@@ -203,6 +203,7 @@ space before a right timestamp in any saved logs."
         (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 @@ set, and timestamping is already active."
   (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]