comparison lisp/erc/erc-stamp.el @ 76856:2fae574a2382

Release ERC 5.2. I have updated the version of ERC to 5.2, since it fixes a bug with C-c C-SPC being bound globally by default. For the full list of changes in this version, see etc/ERC-NEWS. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-687 Creator: Michael Olson <mwolson@gnu.org>
author Miles Bader <miles@gnu.org>
date Sun, 01 Apr 2007 13:36:38 +0000
parents 7a3f13e2dd57
children 85d67fae9a94
comparison
equal deleted inserted replaced
76855:e6686c0a3d45 76856:2fae574a2382
145 (funcall erc-insert-timestamp-function 145 (funcall erc-insert-timestamp-function
146 (erc-format-timestamp ct erc-timestamp-format)) 146 (erc-format-timestamp ct erc-timestamp-format))
147 (error "Timestamp function unbound")) 147 (error "Timestamp function unbound"))
148 (when (and (fboundp erc-insert-away-timestamp-function) 148 (when (and (fboundp erc-insert-away-timestamp-function)
149 erc-away-timestamp-format 149 erc-away-timestamp-format
150 (with-current-buffer (erc-server-buffer) erc-away) 150 (erc-away-time)
151 (not erc-timestamp-format)) 151 (not erc-timestamp-format))
152 (funcall erc-insert-away-timestamp-function 152 (funcall erc-insert-away-timestamp-function
153 (erc-format-timestamp ct erc-away-timestamp-format))) 153 (erc-format-timestamp ct erc-away-timestamp-format)))
154 (add-text-properties (point-min) (point-max) 154 (add-text-properties (point-min) (point-max)
155 (list 'timestamp ct)) 155 (list 'timestamp ct))
201 (string-equal string erc-timestamp-last-inserted))) 201 (string-equal string erc-timestamp-last-inserted)))
202 (len (length string)) 202 (len (length string))
203 (s (if ignore-p (make-string len ? ) string))) 203 (s (if ignore-p (make-string len ? ) string)))
204 (unless ignore-p (setq erc-timestamp-last-inserted string)) 204 (unless ignore-p (setq erc-timestamp-last-inserted string))
205 (erc-put-text-property 0 len 'field 'erc-timestamp s) 205 (erc-put-text-property 0 len 'field 'erc-timestamp s)
206 (erc-put-text-property 0 len 'invisible 'timestamp s)
206 (insert s))) 207 (insert s)))
207 208
208 (defun erc-insert-aligned (string pos) 209 (defun erc-insert-aligned (string pos)
209 "Insert STRING at the POSth column. 210 "Insert STRING at the POSth column.
210 211
317 set, and timestamping is already active." 318 set, and timestamping is already active."
318 (interactive) 319 (interactive)
319 (setq erc-hide-timestamps nil) 320 (setq erc-hide-timestamps nil)
320 (erc-munge-invisibility-spec)) 321 (erc-munge-invisibility-spec))
321 322
323 (defun erc-toggle-timestamps ()
324 "Hide or show timestamps in ERC buffers.
325
326 Note that timestamps can only be shown for a message using this
327 function if `erc-timestamp-format' was set and timestamping was
328 enabled when the message was inserted."
329 (interactive)
330 (if erc-hide-timestamps
331 (setq erc-hide-timestamps nil)
332 (setq erc-hide-timestamps t))
333 (mapc (lambda (buffer)
334 (with-current-buffer buffer
335 (erc-munge-invisibility-spec)))
336 (erc-buffer-list)))
337
322 (defun erc-echo-timestamp (before now) 338 (defun erc-echo-timestamp (before now)
323 "Print timestamp text-property of an IRC message. 339 "Print timestamp text-property of an IRC message.
324 Argument BEFORE is where point was before it got moved and 340 Argument BEFORE is where point was before it got moved and
325 NOW is position of point currently." 341 NOW is position of point currently."
326 (when erc-echo-timestamps 342 (when erc-echo-timestamps