diff options
| author | Chong Yidong | 2005-09-01 16:38:39 +0000 |
|---|---|---|
| committer | Chong Yidong | 2005-09-01 16:38:39 +0000 |
| commit | 6fd388f37c90d733cd11925c73acfb6af17907cd (patch) | |
| tree | f394dd8c52dc78d9a0995b7103142944392d63d9 /lisp/url | |
| parent | 02de72e92c954fc0c1e125276af9f024bca437a8 (diff) | |
| download | emacs-6fd388f37c90d733cd11925c73acfb6af17907cd.tar.gz emacs-6fd388f37c90d733cd11925c73acfb6af17907cd.zip | |
*** empty log message ***
Diffstat (limited to 'lisp/url')
| -rw-r--r-- | lisp/url/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/url/url-mailto.el | 17 | ||||
| -rw-r--r-- | lisp/url/url-util.el | 8 |
3 files changed, 26 insertions, 8 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index e1d8406ae70..ad0ee150207 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2005-09-01 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * url-util.el (url-parse-query-string): New optional argument | ||
| 4 | allow-newlines allows decoding of newlines. | ||
| 5 | |||
| 6 | * url-mailto.el (url-mailto): Allow newlines in URL arguments. | ||
| 7 | Don't lose original "to" value when there is a "to" header. | ||
| 8 | Remove carriage return characters in message body. | ||
| 9 | |||
| 1 | 2005-08-24 Juanma Barranquero <lekktu@gmail.com> | 10 | 2005-08-24 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 11 | ||
| 3 | * url-news.el (nntp-open-tls-stream, nntp-open-ssl-stream): | 12 | * url-news.el (nntp-open-tls-stream, nntp-open-ssl-stream): |
diff --git a/lisp/url/url-mailto.el b/lisp/url/url-mailto.el index 86f5d4a88b6..9b63a35f3bd 100644 --- a/lisp/url/url-mailto.el +++ b/lisp/url/url-mailto.el | |||
| @@ -73,7 +73,7 @@ | |||
| 73 | (setq headers-start (match-end 0) | 73 | (setq headers-start (match-end 0) |
| 74 | to (url-unhex-string (substring url 0 (match-beginning 0))) | 74 | to (url-unhex-string (substring url 0 (match-beginning 0))) |
| 75 | args (url-parse-query-string | 75 | args (url-parse-query-string |
| 76 | (substring url headers-start nil) t)) | 76 | (substring url headers-start nil) t t)) |
| 77 | (setq to (url-unhex-string url))) | 77 | (setq to (url-unhex-string url))) |
| 78 | (setq source-url (url-view-url t)) | 78 | (setq source-url (url-view-url t)) |
| 79 | (if (and url-request-data (not (assoc "subject" args))) | 79 | (if (and url-request-data (not (assoc "subject" args))) |
| @@ -84,16 +84,23 @@ | |||
| 84 | (if (and source-url (not (assoc "x-url-from" args))) | 84 | (if (and source-url (not (assoc "x-url-from" args))) |
| 85 | (setq args (cons (list "x-url-from" source-url) args))) | 85 | (setq args (cons (list "x-url-from" source-url) args))) |
| 86 | 86 | ||
| 87 | (if (assoc "to" args) | 87 | (let ((tolist (assoc "to" args))) |
| 88 | (push (cdr (assoc "to" args)) to) | 88 | (if tolist |
| 89 | (setq args (cons (list "to" to) args))) | 89 | (if (not (string= to "")) |
| 90 | (setcdr tolist | ||
| 91 | (list (concat to ", " (nth 1 tolist))))) | ||
| 92 | (setq args (cons (list "to" to) args)))) | ||
| 93 | |||
| 90 | (setq subject (cdr-safe (assoc "subject" args))) | 94 | (setq subject (cdr-safe (assoc "subject" args))) |
| 91 | (if (fboundp url-mail-command) (funcall url-mail-command) (mail)) | 95 | (if (fboundp url-mail-command) (funcall url-mail-command) (mail)) |
| 92 | (while args | 96 | (while args |
| 93 | (if (string= (caar args) "body") | 97 | (if (string= (caar args) "body") |
| 94 | (progn | 98 | (progn |
| 95 | (goto-char (point-max)) | 99 | (goto-char (point-max)) |
| 96 | (insert (mapconcat 'identity (cdar args) "\n"))) | 100 | (insert (mapconcat |
| 101 | #'(lambda (string) | ||
| 102 | (replace-regexp-in-string "\r\n" "\n" string)) | ||
| 103 | (cdar args) "\n"))) | ||
| 97 | (url-mail-goto-field (caar args)) | 104 | (url-mail-goto-field (caar args)) |
| 98 | (setq func (intern-soft (concat "mail-" (caar args)))) | 105 | (setq func (intern-soft (concat "mail-" (caar args)))) |
| 99 | (insert (mapconcat 'identity (cdar args) ", "))) | 106 | (insert (mapconcat 'identity (cdar args) ", "))) |
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index bec0c7a3133..538eb3eca45 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el | |||
| @@ -270,7 +270,7 @@ Will not do anything if `url-show-status' is nil." | |||
| 270 | (t (file-name-directory file)))) | 270 | (t (file-name-directory file)))) |
| 271 | 271 | ||
| 272 | ;;;###autoload | 272 | ;;;###autoload |
| 273 | (defun url-parse-query-string (query &optional downcase) | 273 | (defun url-parse-query-string (query &optional downcase allow-newlines) |
| 274 | (let (retval pairs cur key val) | 274 | (let (retval pairs cur key val) |
| 275 | (setq pairs (split-string query "&")) | 275 | (setq pairs (split-string query "&")) |
| 276 | (while pairs | 276 | (while pairs |
| @@ -278,8 +278,10 @@ Will not do anything if `url-show-status' is nil." | |||
| 278 | pairs (cdr pairs)) | 278 | pairs (cdr pairs)) |
| 279 | (if (not (string-match "=" cur)) | 279 | (if (not (string-match "=" cur)) |
| 280 | nil ; Grace | 280 | nil ; Grace |
| 281 | (setq key (url-unhex-string (substring cur 0 (match-beginning 0))) | 281 | (setq key (url-unhex-string (substring cur 0 (match-beginning 0)) |
| 282 | val (url-unhex-string (substring cur (match-end 0) nil))) | 282 | allow-newlines)) |
| 283 | (setq val (url-unhex-string (substring cur (match-end 0) nil) | ||
| 284 | allow-newlines)) | ||
| 283 | (if downcase | 285 | (if downcase |
| 284 | (setq key (downcase key))) | 286 | (setq key (downcase key))) |
| 285 | (setq cur (assoc key retval)) | 287 | (setq cur (assoc key retval)) |