Commit 5589b70e authored by Glenn Morris's avatar Glenn Morris
Browse files

Cosmetic changes for some lisp/url files.

* lisp/url/url-util.el (url-get-url-filename-chars): Don't eval-and-compile.
(url-get-url-at-point): Don't use eval-when-compile.

* lisp/url/url-cache.el (url-cache-create-filename-human-readable)
(url-cache-create-filename-using-md5):
* lisp/url/url-util.el (url-file-directory, url-file-nondirectory):
Don't use eval-when-compile and regexp-quote.
parent e2afe435
2010-10-03 Glenn Morris <rgm@gnu.org>
* url-util.el (url-get-url-filename-chars): Don't eval-and-compile.
(url-get-url-at-point): Don't use eval-when-compile.
* url-cache.el (url-cache-create-filename-human-readable)
(url-cache-create-filename-using-md5):
* url-util.el (url-file-directory, url-file-nondirectory):
Don't use eval-when-compile and regexp-quote.
2010-10-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
* url-vars.el (url-mime-charset-string): Changed the default to
......
......@@ -103,8 +103,7 @@ The actual return value is the last modification time of the cache file."
(user-real-login-name)
(cons (or protocol "file")
(reverse (split-string (or hostname "localhost")
(eval-when-compile
(regexp-quote ".")))))))
"\\.")))))
(fname (url-filename urlobj)))
(if (and fname (/= (length fname) 0) (= (aref fname 0) ?/))
(setq fname (substring fname 1 nil)))
......@@ -164,8 +163,7 @@ Very fast if you have an `md5' primitive function, suitably fast otherwise."
(nreverse
(delq nil
(split-string (or hostname "localhost")
(eval-when-compile
(regexp-quote "."))))))))
"\\."))))))
(fname (url-filename urlobj)))
(and fname
(expand-file-name checksum
......
......@@ -248,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))))
......@@ -257,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))))
......@@ -436,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.
......@@ -457,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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment