]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc-dcc.el
Do not prompt twice to save a buffer
[gnu-emacs] / lisp / erc / erc-dcc.el
index 182f1e0592148ceae3fadcd87f8f0f6bbcba84b7..9152527d4be2e757a8e8a2e50f0aa71ee68a0039 100644 (file)
@@ -1,6 +1,6 @@
 ;;; 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>
@@ -166,7 +166,7 @@ All values of the list must be uppercase strings.")
   "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."
@@ -315,10 +315,10 @@ Should be set to a string or nil.  If nil, use the value of
 
 (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)))
 
@@ -594,14 +594,9 @@ It lists the current state of `erc-dcc-list' in an easy to read manner."
                                             (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
@@ -718,9 +713,9 @@ match, returns that regexp and nil otherwise."
 
 (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)))
 
@@ -1210,7 +1205,7 @@ other client."
         (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)))))