From: Stefan Monnier Date: Fri, 1 Sep 2006 02:31:24 +0000 (+0000) Subject: (url-recreate-url-attributes): New function, code moved from `url-recreate-url'. X-Git-Tag: emacs-pretest-22.0.90~816 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fb7dc310ed646b55225d58d1a7a3ed7fbdda9847;p=emacs.git (url-recreate-url-attributes): New function, code moved from `url-recreate-url'. (url-recreate-url): Use it. Put the `url-target' at the end of the URL. --- diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el index f84bf1a7ba2..1e4d93a861e 100644 --- a/lisp/url/url-parse.el +++ b/lisp/url/url-parse.el @@ -100,17 +100,20 @@ (not (equal (url-port urlobj) (url-scheme-get-property (url-type urlobj) 'default-port)))) (format ":%d" (url-port urlobj))) - (or (url-filename urlobj) "/") + (or (url-filename urlobj) "/") + (url-recreate-url-attributes urlobj) (if (url-target urlobj) - (concat "#" (url-target urlobj))) - (if (url-attributes urlobj) - (concat ";" - (mapconcat - (function - (lambda (x) - (if (cdr x) - (concat (car x) "=" (cdr x)) - (car x)))) (url-attributes urlobj) ";"))))) + (concat "#" (url-target urlobj))))) + +(defun url-recreate-url-attributes (urlobj) + "Recreate the attributes of an URL string from the parsed URLOBJ." + (when (url-attributes urlobj) + (concat ";" + (mapconcat (lambda (x) + (if (cdr x) + (concat (car x) "=" (cdr x)) + (car x))) + (url-attributes urlobj) ";")))) ;;;###autoload (defun url-generic-parse-url (url)