diff options
| author | Karoly Lorentey | 2006-10-14 16:56:21 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-10-14 16:56:21 +0000 |
| commit | 3f87f67ee215ffeecbd2f53bd7f342cdf03f47df (patch) | |
| tree | 16f2af9111af08a94d608d96a957f5c3ec5effcc /lisp/url | |
| parent | 350e4fb815d7413ef6d339dd664014706f742927 (diff) | |
| parent | 7a210b69c7f92650c524766d1b9d3f3eefdd67c7 (diff) | |
| download | emacs-3f87f67ee215ffeecbd2f53bd7f342cdf03f47df.tar.gz emacs-3f87f67ee215ffeecbd2f53bd7f342cdf03f47df.zip | |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-371
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-372
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-373
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-374
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-375
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-376
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-377
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-378
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-379
Merge from erc--emacs--21
* emacs@sv.gnu.org/emacs--devo--0--patch-380
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-381
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-382
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-383
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-384
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-385
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-386
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-387
Fix ERC bug introduced in last patch
* emacs@sv.gnu.org/emacs--devo--0--patch-388
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-389
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-390
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-391
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-392
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-393
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-394
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-395
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-396
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-397
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-398
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-399
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-400
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-401
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-402
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-403
Rcirc update from Ryan Yeske
* emacs@sv.gnu.org/emacs--devo--0--patch-404
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-405
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-406
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-407
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-408
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-409
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-410
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-411
Miscellaneous tq-related fixes.
* emacs@sv.gnu.org/emacs--devo--0--patch-412
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-121
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-122
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-123
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-124
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-125
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-126
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-127
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-581
Diffstat (limited to 'lisp/url')
| -rw-r--r-- | lisp/url/ChangeLog | 17 | ||||
| -rw-r--r-- | lisp/url/url-handlers.el | 2 | ||||
| -rw-r--r-- | lisp/url/url-util.el | 42 |
3 files changed, 45 insertions, 16 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 901fac01208..e4b54f9fc92 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2006-08-25 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * url-handlers.el (url-file-local-copy): Tell url-copy-file that the | ||
| 4 | dest file will already exist. | ||
| 5 | |||
| 6 | 2006-07-31 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 7 | |||
| 8 | * url-util.el (url-hexify-string): Only utf-8 encode if it's | ||
| 9 | a multibyte string. | ||
| 10 | (url-normalize-url): Remove unused var `grok'. | ||
| 11 | (url-truncate-url-for-viewing): Remove unused var `tail'. | ||
| 12 | |||
| 13 | 2006-07-30 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 14 | |||
| 15 | * url-util.el (url-hexify-string): Rewrite. | ||
| 16 | Suggested by David Smith <davidsmith@acm.org>. | ||
| 17 | |||
| 1 | 2006-07-12 Michael Olson <mwolson@gnu.org> | 18 | 2006-07-12 Michael Olson <mwolson@gnu.org> |
| 2 | 19 | ||
| 3 | * url-irc.el (url-irc-erc): Call erc-handle-irc-url. | 20 | * url-irc.el (url-irc-erc): Call erc-handle-irc-url. |
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el index 6c6d85a1e03..97d10003620 100644 --- a/lisp/url/url-handlers.el +++ b/lisp/url/url-handlers.el | |||
| @@ -213,7 +213,7 @@ A prefix arg makes KEEP-TIME non-nil." | |||
| 213 | Returns the name of the local copy, or nil, if FILE is directly | 213 | Returns the name of the local copy, or nil, if FILE is directly |
| 214 | accessible." | 214 | accessible." |
| 215 | (let ((filename (make-temp-file "url"))) | 215 | (let ((filename (make-temp-file "url"))) |
| 216 | (url-copy-file url filename) | 216 | (url-copy-file url filename 'ok-if-already-exists) |
| 217 | filename)) | 217 | filename)) |
| 218 | 218 | ||
| 219 | (defun url-insert (buffer &optional beg end) | 219 | (defun url-insert (buffer &optional beg end) |
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index f33a58950fc..0aeb141c017 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el | |||
| @@ -163,7 +163,7 @@ Also replaces the \" character, so that the result may be safely used as | |||
| 163 | (defun url-normalize-url (url) | 163 | (defun url-normalize-url (url) |
| 164 | "Return a 'normalized' version of URL. | 164 | "Return a 'normalized' version of URL. |
| 165 | Strips out default port numbers, etc." | 165 | Strips out default port numbers, etc." |
| 166 | (let (type data grok retval) | 166 | (let (type data retval) |
| 167 | (setq data (url-generic-parse-url url) | 167 | (setq data (url-generic-parse-url url) |
| 168 | type (url-type data)) | 168 | type (url-type data)) |
| 169 | (if (member type '("www" "about" "mailto" "info")) | 169 | (if (member type '("www" "about" "mailto" "info")) |
| @@ -352,17 +352,31 @@ forbidden in URL encoding." | |||
| 352 | This is taken from RFC 2396.") | 352 | This is taken from RFC 2396.") |
| 353 | 353 | ||
| 354 | ;;;###autoload | 354 | ;;;###autoload |
| 355 | (defun url-hexify-string (str) | 355 | (defun url-hexify-string (string) |
| 356 | "Escape characters in a string." | 356 | "Return a new string that is STRING URI-encoded. |
| 357 | (mapconcat | 357 | First, STRING is converted to utf-8, if necessary. Then, for each |
| 358 | (lambda (char) | 358 | character in the utf-8 string, those found in `url-unreserved-chars' |
| 359 | ;; Fixme: use a char table instead. | 359 | are left as-is, all others are represented as a three-character |
| 360 | (if (not (memq char url-unreserved-chars)) | 360 | string: \"%\" followed by two lowercase hex digits." |
| 361 | (if (> char 255) | 361 | ;; To go faster and avoid a lot of consing, we could do: |
| 362 | (error "Hexifying multibyte character %s" str) | 362 | ;; |
| 363 | (format "%%%02X" char)) | 363 | ;; (defconst url-hexify-table |
| 364 | (char-to-string char))) | 364 | ;; (let ((map (make-vector 256 nil))) |
| 365 | str "")) | 365 | ;; (dotimes (byte 256) (aset map byte |
| 366 | ;; (if (memq byte url-unreserved-chars) | ||
| 367 | ;; (char-to-string byte) | ||
| 368 | ;; (format "%%%02x" byte)))) | ||
| 369 | ;; map)) | ||
| 370 | ;; | ||
| 371 | ;; (mapconcat (curry 'aref url-hexify-table) ...) | ||
| 372 | (mapconcat (lambda (byte) | ||
| 373 | (if (memq byte url-unreserved-chars) | ||
| 374 | (char-to-string byte) | ||
| 375 | (format "%%%02x" byte))) | ||
| 376 | (if (multibyte-string-p string) | ||
| 377 | (encode-coding-string string 'utf-8) | ||
| 378 | string) | ||
| 379 | "")) | ||
| 366 | 380 | ||
| 367 | ;;;###autoload | 381 | ;;;###autoload |
| 368 | (defun url-file-extension (fname &optional x) | 382 | (defun url-file-extension (fname &optional x) |
| @@ -389,7 +403,6 @@ then return the basename of the file with the extension stripped off." | |||
| 389 | WIDTH defaults to the current frame width." | 403 | WIDTH defaults to the current frame width." |
| 390 | (let* ((fr-width (or width (frame-width))) | 404 | (let* ((fr-width (or width (frame-width))) |
| 391 | (str-width (length url)) | 405 | (str-width (length url)) |
| 392 | (tail (file-name-nondirectory url)) | ||
| 393 | (fname nil) | 406 | (fname nil) |
| 394 | (modified 0) | 407 | (modified 0) |
| 395 | (urlobj nil)) | 408 | (urlobj nil)) |
| @@ -397,8 +410,7 @@ WIDTH defaults to the current frame width." | |||
| 397 | (if (and (>= str-width fr-width) | 410 | (if (and (>= str-width fr-width) |
| 398 | (string-match "?" url)) | 411 | (string-match "?" url)) |
| 399 | (setq url (concat (substring url 0 (match-beginning 0)) "?...") | 412 | (setq url (concat (substring url 0 (match-beginning 0)) "?...") |
| 400 | str-width (length url) | 413 | str-width (length url))) |
| 401 | tail (file-name-nondirectory url))) | ||
| 402 | (if (< str-width fr-width) | 414 | (if (< str-width fr-width) |
| 403 | nil ; Hey, we are done! | 415 | nil ; Hey, we are done! |
| 404 | (setq urlobj (url-generic-parse-url url) | 416 | (setq urlobj (url-generic-parse-url url) |