# HG changeset patch # User Stefan Monnier # Date 1157077884 0 # Node ID f6c1ac4c14c78df18000816e4598735c8ff43af6 # Parent 97860dfadca5c4f1d3c4208c5d4b81bf33be3d38 (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 -r 97860dfadca5 -r f6c1ac4c14c7 lisp/url/url-parse.el --- a/lisp/url/url-parse.el Thu Aug 31 23:16:03 2006 +0000 +++ b/lisp/url/url-parse.el Fri Sep 01 02:31:24 2006 +0000 @@ -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)