[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r101317: gnus-html: Comment fix.; g
From: |
Katsumi Yamaoka |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r101317: 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. |
Date: |
Sat, 04 Sep 2010 00:12:44 +0000 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 101317
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Sat 2010-09-04 00:12:44 +0000
message:
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.
modified:
lisp/gnus/ChangeLog
lisp/gnus/gnus-art.el
lisp/gnus/gnus-html.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog 2010-09-03 06:10:04 +0000
+++ b/lisp/gnus/ChangeLog 2010-09-04 00:12:44 +0000
@@ -1,3 +1,9 @@
+2010-09-03 Lars Magne Ingebrigtsen <address@hidden>
+
+ * gnus-art.el (gnus-article-copy-string): New command and key binding.
+
+ * gnus-html.el: Doc fix.
+
2010-09-03 Katsumi Yamaoka <address@hidden>
* gnus-html.el (gnus-html-put-image): Use gnus-graphic-display-p,
=== modified file 'lisp/gnus/gnus-art.el'
--- a/lisp/gnus/gnus-art.el 2010-09-02 00:55:51 +0000
+++ b/lisp/gnus/gnus-art.el 2010-09-04 00:12:44 +0000
@@ -4823,6 +4823,22 @@
(vector (caddr c) (car c) :active t))
gnus-mime-button-commands)))
+(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)))
+ map))
+
+(easy-menu-define
+ gnus-url-button-menu gnus-url-button-map "URL button menu."
+ `("Url Button"
+ ,@(mapcar (lambda (c)
+ (vector (caddr c) (car c) :active t))
+ gnus-url-button-commands)))
+
(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 @@
(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)
+ (gnus-put-text-property
+ 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 @@
(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."
+ (interactive)
+ (gnus-article-check-buffer)
+ (let ((data (get-text-property (point) 'gnus-data)))
+ (when data
+ (with-temp-buffer
+ (insert data)
+ (copy-region-as-kill (point-min) (point-max))))))
+
;;; Internal functions:
(defun gnus-article-set-globals ()
=== modified file 'lisp/gnus/gnus-html.el'
--- a/lisp/gnus/gnus-html.el 2010-09-03 06:10:04 +0000
+++ b/lisp/gnus/gnus-html.el 2010-09-04 00:12:44 +0000
@@ -1,4 +1,4 @@
-;;; gnus-html.el --- Quoted-Printable functions
+;;; gnus-html.el --- Render HTML in a buffer.
;; Copyright (C) 2010 Free Software Foundation, Inc.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r101317: 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.,
Katsumi Yamaoka <=