diff options
| author | Richard M. Stallman | 1996-12-09 06:37:30 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-12-09 06:37:30 +0000 |
| commit | ea7cceff155f6fdfb4677b9c49e22974558dcae4 (patch) | |
| tree | 41292f64d758e84c5c01d8140873f3735b862fd0 /lisp | |
| parent | 4442951c8f7499ca2d59fa989be58a035b42e60e (diff) | |
| download | emacs-ea7cceff155f6fdfb4677b9c49e22974558dcae4.tar.gz emacs-ea7cceff155f6fdfb4677b9c49e22974558dcae4.zip | |
(gnus-button-alist): Allow whitespace in `<URL:...'
markup (rfc1738), done last, after possible partial matches.
(gnus-button-url): Zap any whitespace from a <URL:...> match.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/gnus-vis.el | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/gnus-vis.el b/lisp/gnus-vis.el index baddc09e087..0258368cce8 100644 --- a/lisp/gnus-vis.el +++ b/lisp/gnus-vis.el | |||
| @@ -217,11 +217,13 @@ | |||
| 217 | ("\\(<?\\(url: ?\\)?news:\\([^>\n\t ]*\\)>?\\)" 1 t | 217 | ("\\(<?\\(url: ?\\)?news:\\([^>\n\t ]*\\)>?\\)" 1 t |
| 218 | gnus-button-message-id 3) | 218 | gnus-button-message-id 3) |
| 219 | ("\\(<URL: *\\)?mailto: *\\([^> \n\t]+\\)>?" 0 t gnus-button-reply 2) | 219 | ("\\(<URL: *\\)?mailto: *\\([^> \n\t]+\\)>?" 0 t gnus-button-reply 2) |
| 220 | ;; This is how URLs _should_ be embedded in text... | ||
| 221 | ("<URL: *\\([^\n\r>]*\\)>" 0 t gnus-button-url 1) | ||
| 222 | ;; Next regexp stolen from highlight-headers.el. | 220 | ;; Next regexp stolen from highlight-headers.el. |
| 223 | ;; Modified by Vladimir Alexiev. | 221 | ;; Modified by Vladimir Alexiev. |
| 224 | (,gnus-button-url-regexp 0 t gnus-button-url 0)) | 222 | (,gnus-button-url-regexp 0 t gnus-button-url 0) |
| 223 | ;; This is how URLs _should_ be embedded in text... It should go | ||
| 224 | ;; last to avoid matching only a subset of the URL, depending on | ||
| 225 | ;; how it was broken across lines. | ||
| 226 | ("<URL:\\([^>]+\\)>" 0 t gnus-button-url 1)) | ||
| 225 | "Alist of regexps matching buttons in article bodies. | 227 | "Alist of regexps matching buttons in article bodies. |
| 226 | 228 | ||
| 227 | Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where | 229 | Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where |
| @@ -1518,7 +1520,13 @@ specified by `gnus-button-alist'." | |||
| 1518 | 1520 | ||
| 1519 | (defun gnus-button-url (address) | 1521 | (defun gnus-button-url (address) |
| 1520 | "Browse ADDRESS." | 1522 | "Browse ADDRESS." |
| 1521 | (funcall browse-url-browser-function address)) | 1523 | (funcall browse-url-browser-function |
| 1524 | ;; Zap whitespace in case <URL:...> contained it. | ||
| 1525 | ;; (Whitespace illegal in raw URL.) | ||
| 1526 | (let ((stripped-address address)) | ||
| 1527 | (while (string-match "\\s +\\|\n+" stripped-address) | ||
| 1528 | (setq stripped-address (replace-match "" t t stripped-address))) | ||
| 1529 | stripped-address))) | ||
| 1522 | 1530 | ||
| 1523 | ;;; Next/prev buttons in the article buffer. | 1531 | ;;; Next/prev buttons in the article buffer. |
| 1524 | 1532 | ||