]> code.delx.au - gnu-emacs/blobdiff - lisp/url/url-util.el
Merge from emacs-23
[gnu-emacs] / lisp / url / url-util.el
index d63fc3e2838b67908602d8b0bb5b2022a300b43b..cce153bdb6b4d1b87a5648fcdd5079ecea72fd68 100644 (file)
@@ -43,7 +43,7 @@
 
 ;;;###autoload
 (defcustom url-debug nil
-  "*What types of debug messages from the URL library to show.
+  "What types of debug messages from the URL library to show.
 Debug messages are logged to the *URL-DEBUG* buffer.
 
 If t, all messages will be logged.
@@ -177,7 +177,9 @@ Strips out default port numbers, etc."
 (defun url-lazy-message (&rest args)
   "Just like `message', but is a no-op if called more than once a second.
 Will not do anything if `url-show-status' is nil."
-  (if (or (null url-show-status)
+  (if (or (and url-current-object
+              (url-silent url-current-object))
+         (null url-show-status)
          (active-minibuffer-window)
          (= url-lazy-message-time
             (setq url-lazy-message-time (nth 1 (current-time)))))
@@ -222,7 +224,9 @@ Will not do anything if `url-show-status' is nil."
 
 ;;;###autoload
 (defun url-display-percentage (fmt perc &rest args)
-  (when url-show-status
+  (when (and url-show-status
+            (or (null url-current-object)
+                (not (url-silent url-current-object))))
     (if (null fmt)
        (if (fboundp 'clear-progress-display)
            (clear-progress-display))
@@ -244,7 +248,7 @@ Will not do anything if `url-show-status' is nil."
   "Return the directory part of FILE, for a URL."
   (cond
    ((null file) "")
-   ((string-match (eval-when-compile (regexp-quote "?")) file)
+   ((string-match "\\?" file)
     (file-name-directory (substring file 0 (match-beginning 0))))
    (t (file-name-directory file))))
 
@@ -253,7 +257,7 @@ Will not do anything if `url-show-status' is nil."
   "Return the nondirectory part of FILE, for a URL."
   (cond
    ((null file) "")
-   ((string-match (eval-when-compile (regexp-quote "?")) file)
+   ((string-match "\\?" file)
     (file-name-nondirectory (substring file 0 (match-beginning 0))))
    (t (file-name-nondirectory file))))
 
@@ -432,10 +436,8 @@ This uses `url-current-object', set locally to the buffer."
        (url-recreate-url url-current-object)
       (message "%s" (url-recreate-url url-current-object)))))
 
-(eval-and-compile
-  (defvar url-get-url-filename-chars "-%.?@a-zA-Z0-9()_/:~=&"
-    "Valid characters in a URL.")
-  )
+(defvar url-get-url-filename-chars "-%.?@a-zA-Z0-9()_/:~=&"
+  "Valid characters in a URL.")
 
 (defun url-get-url-at-point (&optional pt)
   "Get the URL closest to point, but don't change position.
@@ -453,8 +455,7 @@ Has a preference for looking backward when not directly on a symbol."
                  (if (not (bobp))
                      (backward-char 1)))))
        (if (and (char-after (point))
-                (string-match (eval-when-compile
-                                (concat "[" url-get-url-filename-chars "]"))
+                (string-match (concat "[" url-get-url-filename-chars "]")
                               (char-to-string (char-after (point)))))
            (progn
              (skip-chars-backward url-get-url-filename-chars)