(defmacro liece-insert-info (buffer msg)
`(liece-insert ,buffer (concat liece-info-prefix ,msg)))
-(defmacro liece-insert-timestamp (buffer msg)
- `(liece-insert ,buffer (concat liece-timestamp-prefix ,msg)))
-
(defmacro liece-insert-dcc (buffer msg)
`(liece-insert ,buffer (concat liece-dcc-prefix ,msg)))
liece-own-freeze-indicator (if liece-own-freeze "M" "-"))
(force-mode-line-update)))
-(defun liece-own-frozen (buffer)
- (with-current-buffer buffer liece-own-freeze))
-
(defun liece-ignore-this-p (nick user-at-host)
;; Remove entries which are expired.
(let ((time (current-time)) expire-time)
(liece-message-direction 'outgoing))
(liece-display-message ,message)))
-(defmacro liece-own-message (message)
- `(if (eq liece-command-buffer-mode 'channel)
- (liece-own-channel-message ,message)
- (liece-own-channel-message ,message)))
-
(defvar liece-idle-point nil "Timestamp of last idle reset.")
(defmacro liece-reset-idle ()
(concat "[" ,hostname "]")
,hostname)))
-(defmacro liece-scroll-if-visible (window)
- `(if ,window (set-window-point ,window (point-max))))
-
(defmacro liece-pick-buffer-1 (chnl)
`(cdr (string-assoc-ignore-case ,chnl liece-channel-buffer-alist)))
(floor (mod seconds 65536))
(floor (* (- seconds (ffloor seconds)) 1000000))))
-(defun liece-generate-hex-timestamp (&optional time)
- "Generate timestamp string as hexadecimal.
-If optional argument TIME is nil, calculate timestamp using current time."
- (or time
- (setq time (current-time)))
- (format "%04x%04x" (car time) (cadr time)))
-
(defmacro liece-hex-char-to-integer (character)
"Convert single hex digit CHARACTER to integer."
`(if (and (>= ,character ?0) (<= ,character ?9))
(setq hex-string (substring hex-string 1)))
hex-num))
-(defmacro liece-hex-timestamp-valid (timestamp limit)
- "Is TIMESTAMP valid within LIMIT?"
- `(let (t1 t2 diff (timestamp ,timestamp))
- (if (not (and (stringp timestamp)
- (string-match
- "^[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$" timestamp)))
- nil
- (setq t1 (liece-hex-string-to-integer (substring timestamp 0 4))
- t2 (liece-hex-string-to-integer (substring timestamp 4 8))
- diff (liece-time-difference
- (list t1 t2 0) (current-time)))
- (or (>= ,limit 0)
- (and (< diff ,limit) (> diff (- 0 ,limit)))))))
-
(provide 'liece-misc)
;;; liece-misc.el ends here