* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
@ 2011-05-20 18:37 Ian Eure
2011-05-23 14:36 ` Ted Zlatanov
0 siblings, 1 reply; 25+ messages in thread
From: Ian Eure @ 2011-05-20 18:37 UTC (permalink / raw)
To: 8706
This patch adds a url-build-query-string method, which performs the opposite job of url-parse-query-string. I find myself needing this method in many projects, and having it in url-util.el seems beneficial.
--- url-util.el.orig 2011-05-20 11:32:42.000000000 -0700
+++ url-util.el 2011-05-20 11:32:15.000000000 -0700
@@ -281,6 +281,20 @@
(setq retval (cons (list key val) retval)))))
retval))
+;;;###autoload
+(defun url-build-query-string (query)
+ "Build a query-string.
+
+Given a QUERY in the form:
+'((key1 val1)
+ (key2 val2))
+
+This will return a string `key1=val1&key2=val2'. Keys may be strings
+or symbols; if they are symbols, the string name will be used."
+
+ (c-concat-separated
+ (mapcar (lambda (pair) (apply 'format "%s=%s" pair)) query) "&"))
+
(defun url-unhex (x)
(if (> x ?9)
(if (>= x ?a)
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-05-20 18:37 bug#8706: 24.0.50; [PATCH] Function to build a URL query-string Ian Eure
@ 2011-05-23 14:36 ` Ted Zlatanov
[not found] ` <87zkmaopfs.fsf@lifelogs.com>
0 siblings, 1 reply; 25+ messages in thread
From: Ted Zlatanov @ 2011-05-23 14:36 UTC (permalink / raw)
To: bug-gnu-emacs
On Fri, 20 May 2011 11:37:45 -0700 Ian Eure <ian@simplegeo.com> wrote:
IE> This patch adds a url-build-query-string method, which performs the
IE> opposite job of url-parse-query-string. I find myself needing this
IE> method in many projects, and having it in url-util.el seems
IE> beneficial.
I think this is useful.
IE> + (c-concat-separated
IE> + (mapcar (lambda (pair) (apply 'format "%s=%s" pair)) query) "&"))
I would use `mapconcat' (it's what `c-concat-separated' uses under the
hood anyhow).
Also `format' errors out if it doesn't have enough arguments and it's
legitimate to build a URL query like "url?x;y;z" where x, y, and z don't
have values. So I would change the lambda to (untested):
(lambda (pair)
(if (nth 1 pair)
(apply 'format "%s=%s" pair)
(format "%s" (car-safe pair))))
This also handles the case where `pair' is nil by design or by accident.
Finally, the key and the value should be URL-encoded. Do you assume
that will be done before the function is called?
Thanks
Ted
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
[not found] ` <87zkmaopfs.fsf@lifelogs.com>
@ 2011-05-25 16:32 ` Ian Eure
2011-05-25 20:31 ` Ted Zlatanov
2011-05-26 0:02 ` Stefan Monnier
0 siblings, 2 replies; 25+ messages in thread
From: Ian Eure @ 2011-05-25 16:32 UTC (permalink / raw)
To: tzz, 8706
On May 25, 2011, at 6:55 AM, Ted Zlatanov wrote:
> Ian, did you see my followup?
>
I didn't; I'm not on the list, so I only get direct replies.
> On Mon, 23 May 2011 09:36:12 -0500 Ted Zlatanov <tzz@lifelogs.com> wrote:
>
> TZ> On Fri, 20 May 2011 11:37:45 -0700 Ian Eure <ian@simplegeo.com> wrote:
> IE> This patch adds a url-build-query-string method, which performs the
> IE> opposite job of url-parse-query-string. I find myself needing this
> IE> method in many projects, and having it in url-util.el seems
> IE> beneficial.
>
> TZ> I think this is useful.
>
> IE> + (c-concat-separated
> IE> + (mapcar (lambda (pair) (apply 'format "%s=%s" pair)) query) "&"))
>
> TZ> I would use `mapconcat' (it's what `c-concat-separated' uses under the
> TZ> hood anyhow).
>
Done.
> TZ> Also `format' errors out if it doesn't have enough arguments and it's
> TZ> legitimate to build a URL query like "url?x;y;z" where x, y, and z don't
> TZ> have values. So I would change the lambda to (untested):
>
> TZ> (lambda (pair)
> TZ> (if (nth 1 pair)
> TZ> (apply 'format "%s=%s" pair)
> TZ> (format "%s" (car-safe pair))))
>
> TZ> This also handles the case where `pair' is nil by design or by accident.
>
You can do this by passing a sequence such as '((x "")), which results in "x=". I think this is fine, since this mirrors what you're actually doing — sending an empty string. I think if we wanted to accept lots of different formats, we'd need to do something like:
1. Two-element sequences should work as they do now.
2. One-element sequences should get an empty string appended.
3. Invalid sequences ignored.
I'm not sure it makes sense to support #2, since it seems somewhat opaque and you can do the same thing with an empty string in scenario #1. #3 I'm not sure how to do without using remove-if from cl-seq.
I don't know why someone would pass in nil in place of a k/v pair, and it seems better to raise an error about that rather than silently accepting it, since it seems likely to be an error in the calling code.
I'm happy to discuss further if you think there's a good reason to change it, but I feel like this iteration is acceptable.
> TZ> Finally, the key and the value should be URL-encoded. Do you assume
> TZ> that will be done before the function is called?
>
An oversight on my part; an updated patch is attached. Thank you for the feedback.
--- url-util.el.orig 2011-05-25 09:09:03.000000000 -0700
+++ url-util.el 2011-05-25 09:09:47.000000000 -0700
@@ -281,6 +281,25 @@
(setq retval (cons (list key val) retval)))))
retval))
+;;;###autoload
+(defun url-build-query-string (query)
+ "Build a query-string.
+
+Given a QUERY in the form:
+'((key1 val1)
+ (key2 val2))
+
+This will return a string `key1=val1&key2=val2'. Keys may be strings
+or symbols; if they are symbols, the string name will be used."
+
+ (mapconcat
+ (lambda (pair)
+ (apply 'format "%s=%s"
+ (mapcar
+ (lambda (sym)
+ (url-hexify-string (if (symbolp sym) (symbol-name sym) sym)))
+ pair))) query "&"))
+
(defun url-unhex (x)
(if (> x ?9)
(if (>= x ?a)
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-05-25 16:32 ` Ian Eure
@ 2011-05-25 20:31 ` Ted Zlatanov
2011-06-07 17:07 ` Ian Eure
2011-05-26 0:02 ` Stefan Monnier
1 sibling, 1 reply; 25+ messages in thread
From: Ted Zlatanov @ 2011-05-25 20:31 UTC (permalink / raw)
To: Ian Eure, 8706
On Wed, 25 May 2011 09:32:15 -0700 Ian Eure <ian@simplegeo.com> wrote:
IE> 1. Two-element sequences should work as they do now.
IE> 2. One-element sequences should get an empty string appended.
IE> 3. Invalid sequences ignored.
IE> I'm not sure it makes sense to support #2, since it seems somewhat
IE> opaque and you can do the same thing with an empty string in scenario
IE> #1.
Single-element parameters, shown as just "key" instead of "key=val", are
a well-known URL query string convention. They are not opaque. I think
they should be explicitly supported.
IE> #3 I'm not sure how to do without using remove-if from cl-seq.
IE> I don't know why someone would pass in nil in place of a k/v pair, and
IE> it seems better to raise an error about that rather than silently
IE> accepting it, since it seems likely to be an error in the calling
IE> code.
OK, let's make #3 an error. That works for me. Can you just comment on
it in the source so it's clear we punt to the caller?
Thanks!
Ted
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-05-25 16:32 ` Ian Eure
2011-05-25 20:31 ` Ted Zlatanov
@ 2011-05-26 0:02 ` Stefan Monnier
2011-05-26 14:33 ` Ted Zlatanov
1 sibling, 1 reply; 25+ messages in thread
From: Stefan Monnier @ 2011-05-26 0:02 UTC (permalink / raw)
To: Ian Eure; +Cc: tzz, 8706
> 1. Two-element sequences should work as they do now.
> 2. One-element sequences should get an empty string appended.
> 3. Invalid sequences ignored.
Actually, I think that instead of a (KEY VAL) list, the code should use
a (KEY . VAL) cons cell. And if you want to use VAL=nil as a convention
to put just "key" rather than "key=VAL", that's fine.
Stefan
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-05-26 0:02 ` Stefan Monnier
@ 2011-05-26 14:33 ` Ted Zlatanov
0 siblings, 0 replies; 25+ messages in thread
From: Ted Zlatanov @ 2011-05-26 14:33 UTC (permalink / raw)
To: Ian Eure, 8706
On Wed, 25 May 2011 21:02:56 -0300 Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> 1. Two-element sequences should work as they do now.
>> 2. One-element sequences should get an empty string appended.
>> 3. Invalid sequences ignored.
SM> Actually, I think that instead of a (KEY VAL) list, the code should use
SM> a (KEY . VAL) cons cell. And if you want to use VAL=nil as a convention
SM> to put just "key" rather than "key=VAL", that's fine.
Ian, let me know if I should implement that on top of the latest version
you posted. Should be trivial. I look forward to getting it into
Emacs :)
Thanks
Ted
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-05-25 20:31 ` Ted Zlatanov
@ 2011-06-07 17:07 ` Ian Eure
2011-06-07 18:12 ` Stefan Monnier
2011-06-07 18:58 ` Ted Zlatanov
0 siblings, 2 replies; 25+ messages in thread
From: Ian Eure @ 2011-06-07 17:07 UTC (permalink / raw)
To: Ted Zlatanov; +Cc: 8706
Apologies for the late response, I got distracted by other things.
On May 25, 2011, at 1:31 PM, Ted Zlatanov wrote:
> On Wed, 25 May 2011 09:32:15 -0700 Ian Eure <ian@simplegeo.com> wrote:
>
> IE> 1. Two-element sequences should work as they do now.
> IE> 2. One-element sequences should get an empty string appended.
> IE> 3. Invalid sequences ignored.
>
> IE> I'm not sure it makes sense to support #2, since it seems somewhat
> IE> opaque and you can do the same thing with an empty string in scenario
> IE> #1.
>
> Single-element parameters, shown as just "key" instead of "key=val", are
> a well-known URL query string convention. They are not opaque. I think
> they should be explicitly supported.
>
As I said, they _are_ supported. You just have to explicitly pass an empty string in the pair:
(url-build-query-string '(("a" "b") ("c" "")) -> "a=b&c="
I believe this is the correct behavior. It's also precisely what url-parse-query-string returns:
(url-parse-query-string "a=b&c=") -> (("c" "") ("a" "b"))
This is also relevant to Stefan's comment. All else being equal, I think we should support the same conventions it does. The one issue I discovered is how it handles sending multiple values for the same key. Given "a=one&a=two", it returns: (("a" "one" "two")), which my previous iterations don't know what to do with.
Here's an updated patch which should correctly support everything url-parse-query-string produces. I also updated it to allow empty keys, as this was fairly easy with the code refactored to support (key val val val) syntax.
Updated patch:
--- url-util.el.orig 2011-06-07 09:56:36.000000000 -0700
+++ url-util.el 2011-06-07 10:06:09.000000000 -0700
@@ -281,6 +281,31 @@
(setq retval (cons (list key val) retval)))))
retval))
+;;;###autoload
+(defun url-build-query-string (query)
+ "Build a query-string.
+
+Given a QUERY in the form:
+'((key1 val1)
+ (key2 val2)
+ (key3 val1 val2))
+
+\(This is the same format as produced by `url-parse-query-string')
+
+This will return a string
+`key1=val1&key2=val2&key3=val1&key3=val2'. Keys may be strings or
+symbols; if they are symbols, the string name will be used."
+
+ (mapconcat
+ (lambda (key-vals)
+ (let ((escaped
+ (mapcar (lambda (sym)
+ (url-hexify-string (format "%s" sym))) key-vals)))
+
+ (mapconcat (lambda (val) (format "%s=%s" (car escaped) val))
+ (or (cdr escaped) '("")) "&")))
+ query "&"))
+
(defun url-unhex (x)
(if (> x ?9)
(if (>= x ?a)
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-07 17:07 ` Ian Eure
@ 2011-06-07 18:12 ` Stefan Monnier
2011-06-07 18:58 ` Ted Zlatanov
1 sibling, 0 replies; 25+ messages in thread
From: Stefan Monnier @ 2011-06-07 18:12 UTC (permalink / raw)
To: Ian Eure; +Cc: Ted Zlatanov, 8706
> (url-parse-query-string "a=b&c=") -> (("c" "") ("a" "b"))
The question at hand is different and relates to what is returned by
(url-parse-query-string "a&c") which happens to be nil. Not sure if
that's right, tho.
> Here's an updated patch which should correctly support everything
> url-parse-query-string produces. I also updated it to allow empty
> keys, as this was fairly easy with the code refactored to support (key
> val val val) syntax.
> +symbols; if they are symbols, the string name will be used."
^^^^^^
symbol
-- Stefan
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-07 17:07 ` Ian Eure
2011-06-07 18:12 ` Stefan Monnier
@ 2011-06-07 18:58 ` Ted Zlatanov
2011-06-11 1:15 ` Ted Zlatanov
1 sibling, 1 reply; 25+ messages in thread
From: Ted Zlatanov @ 2011-06-07 18:58 UTC (permalink / raw)
Cc: Ian Eure, 8706
On Tue, 7 Jun 2011 10:07:40 -0700 Ian Eure <ian@simplegeo.com> wrote:
IE> On May 25, 2011, at 1:31 PM, Ted Zlatanov wrote:
>> Single-element parameters, shown as just "key" instead of "key=val", are
>> a well-known URL query string convention. They are not opaque. I think
>> they should be explicitly supported.
>>
IE> As I said, they _are_ supported. You just have to explicitly pass an empty string in the pair:
(url-build-query-string '(("a" "b") ("c" "") (d)))
=> "a=b&c=&d="
IE> I believe this is the correct behavior.
You're right, it's not incorrect, but it's not optimal. The extra "="
can be safely omitted and it's preferrable to do so (for readability and
to save bytes). Maybe that could be optional behavior.
Also we could add an option to make ";" the separator (though the
default should still be "&").
IE> It's also precisely what url-parse-query-string returns:
IE> (url-parse-query-string "a=b&c=") -> (("c" "") ("a" "b"))
It's actually broken for valid URLs: (url-parse-query-string "a=b&c")
=> (("a" "b"))
Plus it doesn't support the ";" separator.
Ugh. Sorry to be a pain... but it's broken...
IE> Here's an updated patch which should correctly support everything
IE> url-parse-query-string produces. I also updated it to allow empty
IE> keys, as this was fairly easy with the code refactored to support
IE> (key val val val) syntax.
That all works great (I see it in the first example above).
Let me know how much of the above you want to do; I can implement all
the things I asked for if you're too busy. I appreciate your help.
Thanks
Ted
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-07 18:58 ` Ted Zlatanov
@ 2011-06-11 1:15 ` Ted Zlatanov
2011-06-11 6:32 ` Deniz Dogan
2011-06-14 1:15 ` Ted Zlatanov
0 siblings, 2 replies; 25+ messages in thread
From: Ted Zlatanov @ 2011-06-11 1:15 UTC (permalink / raw)
To: Ian Eure; +Cc: 8706
[-- Attachment #1: Type: text/plain, Size: 566 bytes --]
(second try for this, the first one I posted through Gmane disappeared)
Attached is a patch which:
- adds optional SEMICOLONS and KEEP-EMPTY to `url-build-query-string' to
separate parameters with semicolons and to keep empty values
- fixes `url-parse-query-string' to understand the '=' is not required
in a parameter
- adds ERT tests for `url-build-query-string' and
`url-parse-query-string'
Ian, if you could look it over, I'd appreciate it. In particular if you
think KEEP-EMPTY should be the default or if you see any other problems...
Thanks
Ted
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: url-build-and-parse.patch --]
[-- Type: text/x-diff, Size: 4342 bytes --]
=== modified file 'lisp/url/url-util.el'
--- lisp/url/url-util.el 2011-01-25 04:08:28 +0000
+++ lisp/url/url-util.el 2011-06-09 16:43:39 +0000
@@ -26,7 +26,8 @@
(require 'url-parse)
(require 'url-vars)
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl)
+ (require 'ert))
(autoload 'timezone-parse-date "timezone")
(autoload 'timezone-make-date-arpa-standard "timezone")
(autoload 'mail-header-extract "mailheader")
@@ -263,24 +264,65 @@
;;;###autoload
(defun url-parse-query-string (query &optional downcase allow-newlines)
(let (retval pairs cur key val)
- (setq pairs (split-string query "&"))
+ (setq pairs (split-string query "[;&]"))
(while pairs
(setq cur (car pairs)
pairs (cdr pairs))
- (if (not (string-match "=" cur))
- nil ; Grace
- (setq key (url-unhex-string (substring cur 0 (match-beginning 0))
- allow-newlines))
- (setq val (url-unhex-string (substring cur (match-end 0) nil)
- allow-newlines))
- (if downcase
- (setq key (downcase key)))
- (setq cur (assoc key retval))
- (if cur
- (setcdr cur (cons val (cdr cur)))
- (setq retval (cons (list key val) retval)))))
+ (unless (string-match "=" cur)
+ (setq cur (concat cur "=")))
+
+ (when (string-match "=" cur)
+ (setq key (url-unhex-string (substring cur 0 (match-beginning 0))
+ allow-newlines))
+ (setq val (url-unhex-string (substring cur (match-end 0) nil)
+ allow-newlines))
+ (if downcase
+ (setq key (downcase key)))
+ (setq cur (assoc key retval))
+ (if cur
+ (setcdr cur (cons val (cdr cur)))
+ (setq retval (cons (list key val) retval)))))
retval))
+;;;###autoload
+(defun url-build-query-string (query &optional semicolons keep-empty)
+ "Build a query-string.
+
+Given a QUERY in the form:
+'((key1 val1)
+ (key2 val2)
+ (key3 val1 val2)
+ (key4)
+ (key5 ""))
+
+\(This is the same format as produced by `url-parse-query-string')
+
+This will return a string
+\"key1=val1&key2=val2&key3=val1&key3=val2&key4&key5\". Keys may
+be strings or symbols; if they are symbols, the symbol name will
+be used.
+
+When SEMICOLONS is given, the separator will be \";\".
+
+When KEEP-EMPTY is given, empty values will show as \"key=\"
+instead of just \"key\" as in the example above."
+ (mapconcat
+ (lambda (key-vals)
+ (let ((escaped
+ (mapcar (lambda (sym)
+ (url-hexify-string (format "%s" sym))) key-vals)))
+ (mapconcat (lambda (val)
+ (let ((vprint (format "%s" val))
+ (eprint (format "%s" (car escaped))))
+ (concat eprint
+ (if (or keep-empty
+ (and val (not (zerop (length vprint)))))
+ "="
+ "")
+ vprint)))
+ (or (cdr escaped) '("")) (if semicolons ";" "&"))))
+ query (if semicolons ";" "&")))
+
(defun url-unhex (x)
(if (> x ?9)
(if (>= x ?a)
@@ -529,6 +571,27 @@
(error "Danger: `%s' is a symbolic link" file))
(set-file-modes file #o0600))))
+(ert-deftest url-build-and-parse-query-string ()
+ (let ((tests
+ '(("key1=val1&key2=val2&key3=val1&key3=val2&key4&key5"
+ ((key1 val1) (key2 "val2") (key3 val1 val2) (key4) (key5 "")))
+ ("key1=val1;key2=val2;key3=val1;key3=val2;key4;key5"
+ ((key1 "val1") (key2 val2) (key3 val1 val2) ("key4") (key5 "")) t)
+ ("key1=val1;key2=val2;key3=val1;key3=val2;key4=;key5="
+ ((key1 val1) (key2 val2) ("key3" val1 val2) (key4) (key5 "")) t t)))
+ test)
+ (while tests
+ (setq test (car tests)
+ tests (cdr tests))
+ (should (equal (apply 'url-build-query-string (cdr test)) (car test)))))
+ (should (equal (url-parse-query-string
+ "key1=val1&key2=val2&key3=val1&key3=val2&key4=&key5")
+ '(("key5" "")
+ ("key4" "")
+ ("key3" "val2" "val1")
+ ("key2" "val2")
+ ("key1" "val1")))))
+
(provide 'url-util)
;;; url-util.el ends here
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-11 1:15 ` Ted Zlatanov
@ 2011-06-11 6:32 ` Deniz Dogan
2011-06-11 10:29 ` Ted Zlatanov
2011-06-14 1:15 ` Ted Zlatanov
1 sibling, 1 reply; 25+ messages in thread
From: Deniz Dogan @ 2011-06-11 6:32 UTC (permalink / raw)
To: 8706
On 2011-06-11 03:15, Ted Zlatanov wrote:
> (second try for this, the first one I posted through Gmane disappeared)
>
> Attached is a patch which:
>
> - adds optional SEMICOLONS and KEEP-EMPTY to `url-build-query-string' to
> separate parameters with semicolons and to keep empty values
>
Why semicolons? Wouldn't it be more appropriate to have SEPARATOR as an
optional argument instead?
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-11 6:32 ` Deniz Dogan
@ 2011-06-11 10:29 ` Ted Zlatanov
0 siblings, 0 replies; 25+ messages in thread
From: Ted Zlatanov @ 2011-06-11 10:29 UTC (permalink / raw)
To: Deniz Dogan; +Cc: 8706
On Sat, 11 Jun 2011 08:32:14 +0200 Deniz Dogan <deniz@dogan.se> wrote:
DD> On 2011-06-11 03:15, Ted Zlatanov wrote:
>> (second try for this, the first one I posted through Gmane disappeared)
>>
>> Attached is a patch which:
>>
>> - adds optional SEMICOLONS and KEEP-EMPTY to `url-build-query-string' to
>> separate parameters with semicolons and to keep empty values
>>
DD> Why semicolons? Wouldn't it be more appropriate to have SEPARATOR as
DD> an optional argument instead?
URL query paramaters can only be separated by "&" and ";" and "&" is the
default :)
Ted
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-11 1:15 ` Ted Zlatanov
2011-06-11 6:32 ` Deniz Dogan
@ 2011-06-14 1:15 ` Ted Zlatanov
2011-06-14 1:29 ` Ian Eure
2012-05-13 19:31 ` Lars Magne Ingebrigtsen
1 sibling, 2 replies; 25+ messages in thread
From: Ted Zlatanov @ 2011-06-14 1:15 UTC (permalink / raw)
To: Ian Eure; +Cc: 8706
On Fri, 10 Jun 2011 20:15:48 -0500 Ted Zlatanov <tzz@lifelogs.com> wrote:
TZ> (second try for this, the first one I posted through Gmane disappeared)
TZ> Attached is a patch which:
TZ> - adds optional SEMICOLONS and KEEP-EMPTY to `url-build-query-string' to
TZ> separate parameters with semicolons and to keep empty values
TZ> - fixes `url-parse-query-string' to understand the '=' is not required
TZ> in a parameter
TZ> - adds ERT tests for `url-build-query-string' and
TZ> `url-parse-query-string'
TZ> Ian, if you could look it over, I'd appreciate it. In particular if you
TZ> think KEEP-EMPTY should be the default or if you see any other problems...
Ian, I'd like to commit this. I think it's pretty close to your
original code so you should be the author, which is why I'm asking for
your feedback (I can split the commits if you prefer). I see one commit
with your name in ChangeLog.14:
2009-02-14 Ian Eure <ian@digg.com> (tiny change)
This is not a tiny change, though, even if we split the commits. Do you
have Emacs assignment papers on file?
Thanks
Ted
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-14 1:15 ` Ted Zlatanov
@ 2011-06-14 1:29 ` Ian Eure
2011-06-14 16:14 ` Glenn Morris
2012-05-13 19:31 ` Lars Magne Ingebrigtsen
1 sibling, 1 reply; 25+ messages in thread
From: Ian Eure @ 2011-06-14 1:29 UTC (permalink / raw)
To: Ted Zlatanov; +Cc: 8706
On Jun 13, 2011, at 6:15 PM, Ted Zlatanov wrote:
> On Fri, 10 Jun 2011 20:15:48 -0500 Ted Zlatanov <tzz@lifelogs.com> wrote:
>
> TZ> (second try for this, the first one I posted through Gmane disappeared)
> TZ> Attached is a patch which:
>
> TZ> - adds optional SEMICOLONS and KEEP-EMPTY to `url-build-query-string' to
> TZ> separate parameters with semicolons and to keep empty values
>
> TZ> - fixes `url-parse-query-string' to understand the '=' is not required
> TZ> in a parameter
>
> TZ> - adds ERT tests for `url-build-query-string' and
> TZ> `url-parse-query-string'
>
> TZ> Ian, if you could look it over, I'd appreciate it. In particular if you
> TZ> think KEEP-EMPTY should be the default or if you see any other problems...
>
Looks good to me.
> Ian, I'd like to commit this. I think it's pretty close to your
> original code so you should be the author, which is why I'm asking for
> your feedback (I can split the commits if you prefer). I see one commit
> with your name in ChangeLog.14:
>
> 2009-02-14 Ian Eure <ian@digg.com> (tiny change)
>
> This is not a tiny change, though, even if we split the commits. Do you
> have Emacs assignment papers on file?
>
Yes, I filed them for that change. I've subsequently switched jobs, but there's no chance there is an IP claim against it.
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-14 1:29 ` Ian Eure
@ 2011-06-14 16:14 ` Glenn Morris
2011-06-14 16:27 ` Glenn Morris
2011-06-14 16:56 ` Ted Zlatanov
0 siblings, 2 replies; 25+ messages in thread
From: Glenn Morris @ 2011-06-14 16:14 UTC (permalink / raw)
To: Ian Eure; +Cc: Ted Zlatanov, 8706
Ian Eure wrote:
>> This is not a tiny change, though, even if we split the commits.
Splitting commits is never relevant for this kind of thing. It's the
total that counts.
>> Do you have Emacs assignment papers on file?
>>
> Yes, I filed them for that change. I've subsequently switched jobs,
> but there's no chance there is an IP claim against it.
I did not see an assignment in the file that records these things, so I
asked assign@gnu about it. They said that the assignment process was not
completed. Please contact assign@gnu directly to sort this out.
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-14 16:14 ` Glenn Morris
@ 2011-06-14 16:27 ` Glenn Morris
2011-06-14 16:56 ` Ted Zlatanov
1 sibling, 0 replies; 25+ messages in thread
From: Glenn Morris @ 2011-06-14 16:27 UTC (permalink / raw)
To: Ian Eure, Ted Zlatanov, 8706
> >> This is not a tiny change, though, even if we split the commits.
>
> Splitting commits is never relevant for this kind of thing. It's the
> total that counts.
Oh, I might have misunderstood what was meant by "splitting" in this
context (eg between more than one author, that would be relevant).
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-14 16:14 ` Glenn Morris
2011-06-14 16:27 ` Glenn Morris
@ 2011-06-14 16:56 ` Ted Zlatanov
2011-06-14 16:57 ` Ian Eure
1 sibling, 1 reply; 25+ messages in thread
From: Ted Zlatanov @ 2011-06-14 16:56 UTC (permalink / raw)
To: Glenn Morris; +Cc: Ian Eure, 8706
On Tue, 14 Jun 2011 12:14:41 -0400 Glenn Morris <rgm@gnu.org> wrote:
GM> Ian Eure wrote:
>> Yes, I filed them for that change. I've subsequently switched jobs,
>> but there's no chance there is an IP claim against it.
GM> I did not see an assignment in the file that records these things, so I
GM> asked assign@gnu about it. They said that the assignment process was not
GM> completed. Please contact assign@gnu directly to sort this out.
Ian, please let me know when this is done and I'll commit the patch. I
hope we can get it done before the Emacs pretest.
On Tue, 14 Jun 2011 12:27:42 -0400 Glenn Morris <rgm@gnu.org> wrote:
>> >> This is not a tiny change, though, even if we split the commits.
>>
>> Splitting commits is never relevant for this kind of thing. It's the
>> total that counts.
GM> Oh, I might have misunderstood what was meant by "splitting" in this
GM> context (eg between more than one author, that would be relevant).
Yeah, I meant Ian's original as one commit and my minor changes on top.
Sorry I wasn't clearer.
Thanks
Ted
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-14 16:56 ` Ted Zlatanov
@ 2011-06-14 16:57 ` Ian Eure
2012-04-12 19:31 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 25+ messages in thread
From: Ian Eure @ 2011-06-14 16:57 UTC (permalink / raw)
To: Ted Zlatanov; +Cc: 8706
On Jun 14, 2011, at 9:56 AM, Ted Zlatanov wrote:
> On Tue, 14 Jun 2011 12:14:41 -0400 Glenn Morris <rgm@gnu.org> wrote:
>
> GM> Ian Eure wrote:
>>> Yes, I filed them for that change. I've subsequently switched jobs,
>>> but there's no chance there is an IP claim against it.
>
> GM> I did not see an assignment in the file that records these things, so I
> GM> asked assign@gnu about it. They said that the assignment process was not
> GM> completed. Please contact assign@gnu directly to sort this out.
>
> Ian, please let me know when this is done and I'll commit the patch. I
> hope we can get it done before the Emacs pretest.
>
I've emailed assign@gnu and hope to have it sorted out soon.
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-14 16:57 ` Ian Eure
@ 2012-04-12 19:31 ` Lars Magne Ingebrigtsen
2012-04-12 19:34 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-04-12 19:31 UTC (permalink / raw)
To: Ian Eure; +Cc: Ted Zlatanov, 8706
Ian Eure <ian@simplegeo.com> writes:
>> Ian, please let me know when this is done and I'll commit the patch. I
>> hope we can get it done before the Emacs pretest.
>>
> I've emailed assign@gnu and hope to have it sorted out soon.
Was there any progress on the assignment paperwork status?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2012-04-12 19:31 ` Lars Magne Ingebrigtsen
@ 2012-04-12 19:34 ` Lars Magne Ingebrigtsen
2012-04-15 23:51 ` Ted Zlatanov
0 siblings, 1 reply; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-04-12 19:34 UTC (permalink / raw)
To: Ian Eure; +Cc: Ted Zlatanov, 8706
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Was there any progress on the assignment paperwork status?
Mail to Ian bounced...
ian@simplegeo.com
SMTP error from remote mail server after RCPT TO:<ian@simplegeo.com>:
host ASPMX.L.GOOGLE.com [209.85.173.26]: 550 5.2.1 The email account that you tried to reach is disabled. sq7si3330628lab.10
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2012-04-12 19:34 ` Lars Magne Ingebrigtsen
@ 2012-04-15 23:51 ` Ted Zlatanov
2012-04-16 0:58 ` Glenn Morris
0 siblings, 1 reply; 25+ messages in thread
From: Ted Zlatanov @ 2012-04-15 23:51 UTC (permalink / raw)
To: Lars Magne Ingebrigtsen; +Cc: Ian Eure, 8706
On Thu, 12 Apr 2012 21:34:52 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
LMI> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>> Was there any progress on the assignment paperwork status?
LMI> Mail to Ian bounced...
LMI> ian@simplegeo.com
LMI> SMTP error from remote mail server after RCPT TO:<ian@simplegeo.com>:
LMI> host ASPMX.L.GOOGLE.com [209.85.173.26]: 550 5.2.1 The email account that you tried to reach is disabled. sq7si3330628lab.10
Considering the change is fairly small and simple I could just rewrite it.
Ted
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2012-04-15 23:51 ` Ted Zlatanov
@ 2012-04-16 0:58 ` Glenn Morris
2012-04-18 22:37 ` Glenn Morris
0 siblings, 1 reply; 25+ messages in thread
From: Glenn Morris @ 2012-04-16 0:58 UTC (permalink / raw)
To: Ted Zlatanov; +Cc: Lars Magne Ingebrigtsen, Ian Eure, 8706
Ted Zlatanov wrote:
> LMI> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>>> Was there any progress on the assignment paperwork status?
>
> LMI> Mail to Ian bounced...
I think the assignment may have been completed. Let me check with
assign@gnu.
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2012-04-16 0:58 ` Glenn Morris
@ 2012-04-18 22:37 ` Glenn Morris
0 siblings, 0 replies; 25+ messages in thread
From: Glenn Morris @ 2012-04-18 22:37 UTC (permalink / raw)
To: Ted Zlatanov; +Cc: Lars Magne Ingebrigtsen, Ian Eure, 8706
Glenn Morris wrote:
> I think the assignment may have been completed. Let me check with
> assign@gnu.
Yes, it's done. Fron that point of view, it is ok to install whatever it
is.
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2011-06-14 1:15 ` Ted Zlatanov
2011-06-14 1:29 ` Ian Eure
@ 2012-05-13 19:31 ` Lars Magne Ingebrigtsen
2012-05-15 8:54 ` Ted Zlatanov
1 sibling, 1 reply; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-05-13 19:31 UTC (permalink / raw)
To: Ian Eure; +Cc: Ted Zlatanov, 8706
Ted Zlatanov <tzz@lifelogs.com> writes:
> Ian, I'd like to commit this. I think it's pretty close to your
> original code so you should be the author, which is why I'm asking for
> your feedback (I can split the commits if you prefer). I see one commit
> with your name in ChangeLog.14:
Ted, the paperwork is OK, so please go ahead and apply the patch. It's
a useful function.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 25+ messages in thread
* bug#8706: 24.0.50; [PATCH] Function to build a URL query-string
2012-05-13 19:31 ` Lars Magne Ingebrigtsen
@ 2012-05-15 8:54 ` Ted Zlatanov
0 siblings, 0 replies; 25+ messages in thread
From: Ted Zlatanov @ 2012-05-15 8:54 UTC (permalink / raw)
To: Lars Magne Ingebrigtsen; +Cc: 8706
On Sun, 13 May 2012 21:31:41 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
>> Ian, I'd like to commit this. I think it's pretty close to your
>> original code so you should be the author, which is why I'm asking for
>> your feedback (I can split the commits if you prefer). I see one commit
>> with your name in ChangeLog.14:
LMI> Ted, the paperwork is OK, so please go ahead and apply the patch. It's
LMI> a useful function.
OK; done. Ian is listed as the author of the change.
Ted
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2012-05-15 8:54 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-20 18:37 bug#8706: 24.0.50; [PATCH] Function to build a URL query-string Ian Eure
2011-05-23 14:36 ` Ted Zlatanov
[not found] ` <87zkmaopfs.fsf@lifelogs.com>
2011-05-25 16:32 ` Ian Eure
2011-05-25 20:31 ` Ted Zlatanov
2011-06-07 17:07 ` Ian Eure
2011-06-07 18:12 ` Stefan Monnier
2011-06-07 18:58 ` Ted Zlatanov
2011-06-11 1:15 ` Ted Zlatanov
2011-06-11 6:32 ` Deniz Dogan
2011-06-11 10:29 ` Ted Zlatanov
2011-06-14 1:15 ` Ted Zlatanov
2011-06-14 1:29 ` Ian Eure
2011-06-14 16:14 ` Glenn Morris
2011-06-14 16:27 ` Glenn Morris
2011-06-14 16:56 ` Ted Zlatanov
2011-06-14 16:57 ` Ian Eure
2012-04-12 19:31 ` Lars Magne Ingebrigtsen
2012-04-12 19:34 ` Lars Magne Ingebrigtsen
2012-04-15 23:51 ` Ted Zlatanov
2012-04-16 0:58 ` Glenn Morris
2012-04-18 22:37 ` Glenn Morris
2012-05-13 19:31 ` Lars Magne Ingebrigtsen
2012-05-15 8:54 ` Ted Zlatanov
2011-05-26 0:02 ` Stefan Monnier
2011-05-26 14:33 ` Ted Zlatanov
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.