diff options
| author | Lars Magne Ingebrigtsen | 2010-09-04 00:12:44 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-09-04 00:12:44 +0000 |
| commit | 7426b4f7d05884c2f4677d825a4e6a3509e1eb5a (patch) | |
| tree | 51a561b7540b038942d5385574b1e39bec7d3f9a | |
| parent | eedf5e123a9cc34cfcb3bc14a01c39cb896ac7c9 (diff) | |
| download | emacs-7426b4f7d05884c2f4677d825a4e6a3509e1eb5a.tar.gz emacs-7426b4f7d05884c2f4677d825a4e6a3509e1eb5a.zip | |
gnus-html: Comment fix.; gnus-art.el: Provide an `u' command on urls and the like that copies the string over to the kill ring; Also have the `u' command work for HTML links.
| -rw-r--r-- | lisp/gnus/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 33 | ||||
| -rw-r--r-- | lisp/gnus/gnus-html.el | 2 |
3 files changed, 39 insertions, 2 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c23a59867e2..0377808ed7e 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * gnus-art.el (gnus-article-copy-string): New command and key binding. | ||
| 4 | |||
| 5 | * gnus-html.el: Doc fix. | ||
| 6 | |||
| 1 | 2010-09-03 Katsumi Yamaoka <yamaoka@jpl.org> | 7 | 2010-09-03 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 8 | ||
| 3 | * gnus-html.el (gnus-html-put-image): Use gnus-graphic-display-p, | 9 | * gnus-html.el (gnus-html-put-image): Use gnus-graphic-display-p, |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index a4675a75a81..56e78cc5544 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -4823,6 +4823,22 @@ General format specifiers can also be used. See Info node | |||
| 4823 | (vector (caddr c) (car c) :active t)) | 4823 | (vector (caddr c) (car c) :active t)) |
| 4824 | gnus-mime-button-commands))) | 4824 | gnus-mime-button-commands))) |
| 4825 | 4825 | ||
| 4826 | (defvar gnus-url-button-commands | ||
| 4827 | '((gnus-article-copy-string "u" "Copy URL to kill ring"))) | ||
| 4828 | |||
| 4829 | (defvar gnus-url-button-map | ||
| 4830 | (let ((map (make-sparse-keymap))) | ||
| 4831 | (dolist (c gnus-url-button-commands) | ||
| 4832 | (define-key map (cadr c) (car c))) | ||
| 4833 | map)) | ||
| 4834 | |||
| 4835 | (easy-menu-define | ||
| 4836 | gnus-url-button-menu gnus-url-button-map "URL button menu." | ||
| 4837 | `("Url Button" | ||
| 4838 | ,@(mapcar (lambda (c) | ||
| 4839 | (vector (caddr c) (car c) :active t)) | ||
| 4840 | gnus-url-button-commands))) | ||
| 4841 | |||
| 4826 | (defmacro gnus-bind-safe-url-regexp (&rest body) | 4842 | (defmacro gnus-bind-safe-url-regexp (&rest body) |
| 4827 | "Bind `mm-w3m-safe-url-regexp' according to `gnus-safe-html-newsgroups'." | 4843 | "Bind `mm-w3m-safe-url-regexp' according to `gnus-safe-html-newsgroups'." |
| 4828 | `(let ((mm-w3m-safe-url-regexp | 4844 | `(let ((mm-w3m-safe-url-regexp |
| @@ -7813,7 +7829,11 @@ specified by `gnus-button-alist'." | |||
| 7813 | (unless (and (eq (car entry) 'gnus-button-url-regexp) | 7829 | (unless (and (eq (car entry) 'gnus-button-url-regexp) |
| 7814 | (gnus-article-extend-url-button from start end)) | 7830 | (gnus-article-extend-url-button from start end)) |
| 7815 | (gnus-article-add-button start end | 7831 | (gnus-article-add-button start end |
| 7816 | 'gnus-button-push from))))))))) | 7832 | 'gnus-button-push from) |
| 7833 | (gnus-put-text-property | ||
| 7834 | start end | ||
| 7835 | 'gnus-data (buffer-substring-no-properties | ||
| 7836 | start end)))))))))) | ||
| 7817 | 7837 | ||
| 7818 | (defun gnus-article-extend-url-button (beg start end) | 7838 | (defun gnus-article-extend-url-button (beg start end) |
| 7819 | "Extend url button if url is folded into two or more lines. | 7839 | "Extend url button if url is folded into two or more lines. |
| @@ -7918,8 +7938,19 @@ url is put as the `gnus-button-url' overlay property on the button." | |||
| 7918 | (and data (list 'gnus-data data)))) | 7938 | (and data (list 'gnus-data data)))) |
| 7919 | (widget-convert-button 'link from to :action 'gnus-widget-press-button | 7939 | (widget-convert-button 'link from to :action 'gnus-widget-press-button |
| 7920 | :help-echo (or text "Follow the link") | 7940 | :help-echo (or text "Follow the link") |
| 7941 | :keymap gnus-url-button-map | ||
| 7921 | :button-keymap gnus-widget-button-keymap)) | 7942 | :button-keymap gnus-widget-button-keymap)) |
| 7922 | 7943 | ||
| 7944 | (defun gnus-article-copy-string () | ||
| 7945 | "Copy the string in the button to the kill ring." | ||
| 7946 | (interactive) | ||
| 7947 | (gnus-article-check-buffer) | ||
| 7948 | (let ((data (get-text-property (point) 'gnus-data))) | ||
| 7949 | (when data | ||
| 7950 | (with-temp-buffer | ||
| 7951 | (insert data) | ||
| 7952 | (copy-region-as-kill (point-min) (point-max)))))) | ||
| 7953 | |||
| 7923 | ;;; Internal functions: | 7954 | ;;; Internal functions: |
| 7924 | 7955 | ||
| 7925 | (defun gnus-article-set-globals () | 7956 | (defun gnus-article-set-globals () |
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index 8717a4630df..6687415ec16 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; gnus-html.el --- Quoted-Printable functions | 1 | ;;; gnus-html.el --- Render HTML in a buffer. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2010 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2010 Free Software Foundation, Inc. |
| 4 | 4 | ||