;;; erc-dcc.el --- CTCP DCC module for ERC
-;; Copyright (C) 1993-1995, 1998, 2002-2004, 2006-2015 Free Software
+;; Copyright (C) 1993-1995, 1998, 2002-2004, 2006-2016 Free Software
;; Foundation, Inc.
;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu>
"Return the first matching entry in `erc-dcc-list' which satisfies the
constraints given as a plist in ARGS. Returns nil on no match.
-The property :nick is treated specially, if it contains a '!' character,
+The property :nick is treated specially, if it contains a `!' character,
it is treated as a nick!user@host string, and compared with the :nick property
value of the individual elements using string-equal. Otherwise it is
compared with `erc-nick-equal-p' which is IRC case-insensitive."
(defcustom erc-dcc-send-request 'ask
"How to treat incoming DCC Send requests.
-'ask - Report the Send request, and wait for the user to manually accept it
- You might want to set `erc-dcc-auto-masks' for this.
-'auto - Automatically accept the request and begin downloading the file
-'ignore - Ignore incoming DCC Send requests completely."
+`ask' - Report the Send request, and wait for the user to manually accept it
+ You might want to set `erc-dcc-auto-masks' for this.
+`auto' - Automatically accept the request and begin downloading the file
+`ignore' - Ignore incoming DCC Send requests completely."
:group 'erc-dcc
:type '(choice (const ask) (const auto) (const ignore)))
(get-buffer (plist-get elt :file))
(+ (buffer-size) 0.0
erc-dcc-byte-count))))
- (concat " ("
- (if (= byte-count 0)
- "0"
- (number-to-string
- (truncate
- (* 100
- (/ byte-count (plist-get elt :size))))))
- "%)"))))
+ (format " (%d%%)"
+ (floor (* 100.0 byte-count)
+ (plist-get elt :size))))))
?f (or (and (plist-member elt :file) (plist-get elt :file)) "")))
(erc-display-message
nil 'notice 'active
(defcustom erc-dcc-chat-request 'ask
"How to treat incoming DCC Chat requests.
-'ask - Report the Chat request, and wait for the user to manually accept it
-'auto - Automatically accept the request and open a new chat window
-'ignore - Ignore incoming DCC chat requests completely."
+`ask' - Report the Chat request, and wait for the user to manually accept it
+`auto' - Automatically accept the request and open a new chat window
+`ignore' - Ignore incoming DCC chat requests completely."
:group 'erc-dcc
:type '(choice (const ask) (const auto) (const ignore)))
(setq posn (match-end 0))
(erc-display-message
nil nil proc
- 'dcc-chat-privmsg ?n (erc-propertize erc-dcc-from 'face
+ 'dcc-chat-privmsg ?n (erc-propertize erc-dcc-from 'font-lock-face
'erc-nick-default-face) ?m line))
(setq erc-dcc-unprocessed-output (substring str posn)))))