diff options
| author | Miles Bader | 2008-05-26 07:03:02 +0000 |
|---|---|---|
| committer | Miles Bader | 2008-05-26 07:03:02 +0000 |
| commit | c9087628695cb90dfba56867ff392df2f961bf3c (patch) | |
| tree | a2ee7b490321bda3d55584c0df53f05f69842db1 | |
| parent | 16cf244edb9f5b9dfb8d575921caee6f5365f38e (diff) | |
| download | emacs-c9087628695cb90dfba56867ff392df2f961bf3c.tar.gz emacs-c9087628695cb90dfba56867ff392df2f961bf3c.zip | |
Merge from gnus--rel--5.10
Revision: emacs@sv.gnu.org/emacs--rel--22--patch-272
| -rw-r--r-- | lisp/gnus/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 95 | ||||
| -rw-r--r-- | lisp/gnus/gnus-registry.el | 5 |
3 files changed, 91 insertions, 21 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index d934d6c2c2e..d4b770287e3 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2008-05-25 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-art.el (gnus-button-alist): Exclude newline in RFC2396-compliant | ||
| 4 | url pattern; remove duplicate one. | ||
| 5 | (gnus-article-extend-url-button): New function. | ||
| 6 | (gnus-article-add-buttons): Use it. | ||
| 7 | (gnus-button-push): Use concatenated url that it makes. | ||
| 8 | |||
| 9 | 2008-05-07 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 10 | |||
| 11 | * gnus-registry.el: Adjusted copyright dates and added a keyword. | ||
| 12 | |||
| 1 | 2008-04-24 Luca Capello <luca@pca.it> (tiny change) | 13 | 2008-04-24 Luca Capello <luca@pca.it> (tiny change) |
| 2 | 14 | ||
| 3 | * mm-encode.el (mm-safer-encoding): Add optional argument `type'. | 15 | * mm-encode.el (mm-safer-encoding): Add optional argument `type'. |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index d509fd414f7..742532b0c5e 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -6668,13 +6668,10 @@ positives are possible." | |||
| 6668 | ;; here to determine where it ends. | 6668 | ;; here to determine where it ends. |
| 6669 | 1 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-key 3) | 6669 | 1 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-key 3) |
| 6670 | ;; This is how URLs _should_ be embedded in text (RFC 1738, RFC 2396)... | 6670 | ;; This is how URLs _should_ be embedded in text (RFC 1738, RFC 2396)... |
| 6671 | ("<URL: *\\([^<>]*\\)>" | 6671 | ("<URL: *\\([^\n<>]*\\)>" |
| 6672 | 1 (>= gnus-button-browse-level 0) gnus-button-embedded-url 1) | 6672 | 1 (>= gnus-button-browse-level 0) gnus-button-embedded-url 1) |
| 6673 | ;; RFC 2396 (2.4.3., delims) ... | 6673 | ;; RFC 2396 (2.4.3., delims) ... |
| 6674 | ("\"URL: *\\([^\"]*\\)\"" | 6674 | ("\"URL: *\\([^\n\"]*\\)\"" |
| 6675 | 1 (>= gnus-button-browse-level 0) gnus-button-embedded-url 1) | ||
| 6676 | ;; RFC 2396 (2.4.3., delims) ... | ||
| 6677 | ("\"URL: *\\([^\"]*\\)\"" | ||
| 6678 | 1 (>= gnus-button-browse-level 0) gnus-button-embedded-url 1) | 6675 | 1 (>= gnus-button-browse-level 0) gnus-button-embedded-url 1) |
| 6679 | ;; Raw URLs. | 6676 | ;; Raw URLs. |
| 6680 | (gnus-button-url-regexp | 6677 | (gnus-button-url-regexp |
| @@ -6902,19 +6899,79 @@ specified by `gnus-button-alist'." | |||
| 6902 | (setq regexp (eval (car entry))) | 6899 | (setq regexp (eval (car entry))) |
| 6903 | (goto-char beg) | 6900 | (goto-char beg) |
| 6904 | (while (re-search-forward regexp nil t) | 6901 | (while (re-search-forward regexp nil t) |
| 6905 | (let* ((start (and entry (match-beginning (nth 1 entry)))) | 6902 | (let ((start (match-beginning (nth 1 entry))) |
| 6906 | (end (and entry (match-end (nth 1 entry)))) | 6903 | (end (match-end (nth 1 entry))) |
| 6907 | (from (match-beginning 0))) | 6904 | (from (match-beginning 0))) |
| 6908 | (when (and (or (eq t (nth 2 entry)) | 6905 | (when (and (or (eq t (nth 2 entry)) |
| 6909 | (eval (nth 2 entry))) | 6906 | (eval (nth 2 entry))) |
| 6910 | (not (gnus-button-in-region-p | 6907 | (not (gnus-button-in-region-p |
| 6911 | start end 'gnus-callback))) | 6908 | start end 'gnus-callback))) |
| 6912 | ;; That optional form returned non-nil, so we add the | 6909 | ;; That optional form returned non-nil, so we add the |
| 6913 | ;; button. | 6910 | ;; button. |
| 6914 | (gnus-article-add-button | 6911 | (setq from (set-marker (make-marker) from)) |
| 6915 | start end 'gnus-button-push | 6912 | (push from gnus-button-marker-list) |
| 6916 | (car (push (set-marker (make-marker) from) | 6913 | (unless (and (eq (car entry) 'gnus-button-url-regexp) |
| 6917 | gnus-button-marker-list)))))))))) | 6914 | (gnus-article-extend-url-button from start end)) |
| 6915 | (gnus-article-add-button start end | ||
| 6916 | 'gnus-button-push from))))))))) | ||
| 6917 | |||
| 6918 | (defun gnus-article-extend-url-button (beg start end) | ||
| 6919 | "Extend url button if url is folded into two or more lines. | ||
| 6920 | Return non-nil if button is extended. BEG is a marker that points to | ||
| 6921 | the beginning position of a text containing url. START and END are | ||
| 6922 | the endpoints of a url button before it is extended. The concatenated | ||
| 6923 | url is put as the `gnus-button-url' overlay property on the button." | ||
| 6924 | (let ((opoint (point)) | ||
| 6925 | (points (list start end)) | ||
| 6926 | url delim regexp) | ||
| 6927 | (prog1 | ||
| 6928 | (when (and (progn | ||
| 6929 | (goto-char end) | ||
| 6930 | (not (looking-at "[\t ]*[\">]"))) | ||
| 6931 | (progn | ||
| 6932 | (goto-char start) | ||
| 6933 | (string-match | ||
| 6934 | "\\(?:\"\\|\\(<\\)\\)[\t ]*\\(?:url[\t ]*:[\t ]*\\)?\\'" | ||
| 6935 | (buffer-substring (point-at-bol) start))) | ||
| 6936 | (progn | ||
| 6937 | (setq url (list (buffer-substring start end)) | ||
| 6938 | delim (if (match-beginning 1) ">" "\"")) | ||
| 6939 | (beginning-of-line) | ||
| 6940 | (setq regexp (concat | ||
| 6941 | (when (and (looking-at | ||
| 6942 | message-cite-prefix-regexp) | ||
| 6943 | (< (match-end 0) start)) | ||
| 6944 | (regexp-quote (match-string 0))) | ||
| 6945 | "\ | ||
| 6946 | \[\t ]*\\(?:\\([^\t\n \">]+\\)[\t ]*$\\|\\([^\t\n \">]*\\)[\t ]*" | ||
| 6947 | delim "\\)")) | ||
| 6948 | (while (progn | ||
| 6949 | (forward-line 1) | ||
| 6950 | (and (looking-at regexp) | ||
| 6951 | (prog1 | ||
| 6952 | (match-beginning 1) | ||
| 6953 | (push (or (match-string 2) | ||
| 6954 | (match-string 1)) | ||
| 6955 | url) | ||
| 6956 | (push (setq end (or (match-end 2) | ||
| 6957 | (match-end 1))) | ||
| 6958 | points) | ||
| 6959 | (push (or (match-beginning 2) | ||
| 6960 | (match-beginning 1)) | ||
| 6961 | points))))) | ||
| 6962 | (match-beginning 2))) | ||
| 6963 | (let (gnus-article-mouse-face widget-mouse-face) | ||
| 6964 | (while points | ||
| 6965 | (gnus-article-add-button (pop points) (pop points) | ||
| 6966 | 'gnus-button-push beg))) | ||
| 6967 | (let ((overlay (gnus-make-overlay start end))) | ||
| 6968 | (gnus-overlay-put overlay 'evaporate t) | ||
| 6969 | (gnus-overlay-put overlay 'gnus-button-url | ||
| 6970 | (list (mapconcat 'identity (nreverse url) ""))) | ||
| 6971 | (when gnus-article-mouse-face | ||
| 6972 | (gnus-overlay-put overlay 'mouse-face gnus-article-mouse-face))) | ||
| 6973 | t) | ||
| 6974 | (goto-char opoint)))) | ||
| 6918 | 6975 | ||
| 6919 | ;; Add buttons to the head of an article. | 6976 | ;; Add buttons to the head of an article. |
| 6920 | (defun gnus-article-add-buttons-to-head () | 6977 | (defun gnus-article-add-buttons-to-head () |
| @@ -7016,12 +7073,14 @@ specified by `gnus-button-alist'." | |||
| 7016 | (let* ((entry (gnus-button-entry)) | 7073 | (let* ((entry (gnus-button-entry)) |
| 7017 | (inhibit-point-motion-hooks t) | 7074 | (inhibit-point-motion-hooks t) |
| 7018 | (fun (nth 3 entry)) | 7075 | (fun (nth 3 entry)) |
| 7019 | (args (mapcar (lambda (group) | 7076 | (args (or (and (eq (car entry) 'gnus-button-url-regexp) |
| 7020 | (let ((string (match-string group))) | 7077 | (get-char-property marker 'gnus-button-url)) |
| 7021 | (gnus-set-text-properties | 7078 | (mapcar (lambda (group) |
| 7022 | 0 (length string) nil string) | 7079 | (let ((string (match-string group))) |
| 7023 | string)) | 7080 | (set-text-properties |
| 7024 | (nthcdr 4 entry)))) | 7081 | 0 (length string) nil string) |
| 7082 | string)) | ||
| 7083 | (nthcdr 4 entry))))) | ||
| 7025 | (cond | 7084 | (cond |
| 7026 | ((fboundp fun) | 7085 | ((fboundp fun) |
| 7027 | (apply fun args)) | 7086 | (apply fun args)) |
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 11c5e3624d5..903676e1a9b 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el | |||
| @@ -1,10 +1,9 @@ | |||
| 1 | ;;; gnus-registry.el --- article registry for Gnus | 1 | ;;; gnus-registry.el --- article registry for Gnus |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, | 3 | ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. |
| 4 | ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | ||
| 5 | 4 | ||
| 6 | ;; Author: Ted Zlatanov <tzz@lifelogs.com> | 5 | ;; Author: Ted Zlatanov <tzz@lifelogs.com> |
| 7 | ;; Keywords: news | 6 | ;; Keywords: news registry |
| 8 | 7 | ||
| 9 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 10 | 9 | ||