Commit 7426b4f7 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen Committed by Katsumi Yamaoka
Browse files

gnus-html: Comment fix.; gnus-art.el: Provide an `u' command on urls and the...

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.
parent eedf5e12
2010-09-03 Lars Magne Ingebrigtsen <>
* gnus-art.el (gnus-article-copy-string): New command and key binding.
* gnus-html.el: Doc fix.
2010-09-03 Katsumi Yamaoka <>
* gnus-html.el (gnus-html-put-image): Use gnus-graphic-display-p,
......@@ -4823,6 +4823,22 @@ General format specifiers can also be used. See Info node
(vector (caddr c) (car c) :active t))
(defvar gnus-url-button-commands
'((gnus-article-copy-string "u" "Copy URL to kill ring")))
(defvar gnus-url-button-map
(let ((map (make-sparse-keymap)))
(dolist (c gnus-url-button-commands)
(define-key map (cadr c) (car c)))
gnus-url-button-menu gnus-url-button-map "URL button menu."
`("Url Button"
,@(mapcar (lambda (c)
(vector (caddr c) (car c) :active t))
(defmacro gnus-bind-safe-url-regexp (&rest body)
"Bind `mm-w3m-safe-url-regexp' according to `gnus-safe-html-newsgroups'."
`(let ((mm-w3m-safe-url-regexp
......@@ -7813,7 +7829,11 @@ specified by `gnus-button-alist'."
(unless (and (eq (car entry) 'gnus-button-url-regexp)
(gnus-article-extend-url-button from start end))
(gnus-article-add-button start end
'gnus-button-push from)))))))))
'gnus-button-push from)
start end
'gnus-data (buffer-substring-no-properties
start end))))))))))
(defun gnus-article-extend-url-button (beg start end)
"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."
(and data (list 'gnus-data data))))
(widget-convert-button 'link from to :action 'gnus-widget-press-button
:help-echo (or text "Follow the link")
:keymap gnus-url-button-map
:button-keymap gnus-widget-button-keymap))
(defun gnus-article-copy-string ()
"Copy the string in the button to the kill ring."
(let ((data (get-text-property (point) 'gnus-data)))
(when data
(insert data)
(copy-region-as-kill (point-min) (point-max))))))
;;; Internal functions:
(defun gnus-article-set-globals ()
;;; gnus-html.el --- Quoted-Printable functions
;;; gnus-html.el --- Render HTML in a buffer.
;; Copyright (C) 2010 Free Software Foundation, Inc.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment