emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101318: gnus-agent.el: Change the de


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101318: gnus-agent.el: Change the default so that nnimap methods aren't agentized by default. There's apparently many problems related to agent/imap behaviour; gnus-art.el: Don't reuse the 'gnus-data text property, but use a new property. This avoids stomping over other functions that use this for other things; gnus-html.el: Add a new `i' command to insert images.
Date: Sat, 04 Sep 2010 00:21:34 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101318
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Sat 2010-09-04 00:21:34 +0000
message:
  gnus-agent.el: Change the default so that nnimap methods aren't agentized by 
default. There's apparently many problems related to agent/imap behaviour; 
gnus-art.el: Don't reuse the 'gnus-data text property, but use a new property.  
This avoids stomping over other functions that use this for other things; 
gnus-html.el: Add a new `i' command to insert images.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-agent.el
  lisp/gnus/gnus-art.el
  lisp/gnus/gnus-html.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2010-09-04 00:12:44 +0000
+++ b/lisp/gnus/ChangeLog       2010-09-04 00:21:34 +0000
@@ -1,5 +1,13 @@
 2010-09-03  Lars Magne Ingebrigtsen  <address@hidden>
 
+       * gnus-html.el (gnus-html-put-image): Allow images to be removed.
+       (gnus-html-wash-tags): Add a new `i' command to insert images.
+       (gnus-html-insert-image): New command and keystroke.
+
+       * gnus-agent.el (gnus-agent-auto-agentize-methods): Change the default
+       so that nnimap methods aren't agentized by default.  There's apparently
+       many problems related to agent/imap behaviour.
+
        * gnus-art.el (gnus-article-copy-string): New command and key binding.
 
        * gnus-html.el: Doc fix.

=== modified file 'lisp/gnus/gnus-agent.el'
--- a/lisp/gnus/gnus-agent.el   2010-09-02 03:39:33 +0000
+++ b/lisp/gnus/gnus-agent.el   2010-09-04 00:21:34 +0000
@@ -184,7 +184,7 @@
   :type 'boolean
   :group 'gnus-agent)
 
-(defcustom gnus-agent-auto-agentize-methods '(nntp nnimap)
+(defcustom gnus-agent-auto-agentize-methods '(nntp)
   "Initially, all servers from these methods are agentized.
 The user may remove or add servers using the Server buffer.
 See Info node `(gnus)Server Buffer'."

=== modified file 'lisp/gnus/gnus-art.el'
--- a/lisp/gnus/gnus-art.el     2010-09-04 00:12:44 +0000
+++ b/lisp/gnus/gnus-art.el     2010-09-04 00:21:34 +0000
@@ -7832,8 +7832,8 @@
                                         'gnus-button-push from)
                (gnus-put-text-property
                 start end
-                'gnus-data (buffer-substring-no-properties
-                            start end))))))))))
+                'gnus-string (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.
@@ -7945,7 +7945,7 @@
   "Copy the string in the button to the kill ring."
   (interactive)
   (gnus-article-check-buffer)
-  (let ((data (get-text-property (point) 'gnus-data)))
+  (let ((data (get-text-property (point) 'gnus-string)))
     (when data
       (with-temp-buffer
        (insert data)

=== modified file 'lisp/gnus/gnus-html.el'
--- a/lisp/gnus/gnus-html.el    2010-09-04 00:12:44 +0000
+++ b/lisp/gnus/gnus-html.el    2010-09-04 00:21:34 +0000
@@ -66,6 +66,12 @@
   :group 'gnus-art
   :type 'float)
 
+(defvar gnus-html-image-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "u" 'gnus-article-copy-string)
+    (define-key map "i" 'gnus-html-insert-image)
+    map))
+
 ;;;###autoload
 (defun gnus-article-html (handle)
   (let ((article-buffer (current-buffer)))
@@ -142,12 +148,24 @@
                    (delete-region start end)
                    (gnus-put-image image (gnus-string-or string "*")))))
            ;; Normal, external URL.
-           (unless (gnus-html-image-url-blocked-p
-                    url
-                    (if (buffer-live-p gnus-summary-buffer)
-                        (with-current-buffer gnus-summary-buffer
-                          gnus-blocked-images)
-                      gnus-blocked-images))
+           (if (gnus-html-image-url-blocked-p
+                url
+                (if (buffer-live-p gnus-summary-buffer)
+                    (with-current-buffer gnus-summary-buffer
+                      gnus-blocked-images)
+                  gnus-blocked-images))
+               (progn
+                 (widget-convert-button
+                  'link start end
+                  :action 'gnus-html-insert-image
+                  :help-echo url
+                  :keymap gnus-html-image-map
+                  :button-keymap gnus-html-image-map)
+                 (gnus-put-text-property
+                  start end
+                  'gnus-image (list url
+                                    (set-marker (make-marker) start)
+                                    (set-marker (make-marker) end))))
              (let ((file (gnus-html-image-id url))
                    width height)
                (when (string-match "height=\"?\\([0-9]+\\)" parameters)
@@ -184,6 +202,7 @@
          (let ((overlay (gnus-make-overlay start end)))
            (gnus-overlay-put overlay 'evaporate t)
            (gnus-overlay-put overlay 'gnus-button-url url)
+           (gnus-put-text-property start end 'gnus-string url)
            (when gnus-article-mouse-face
              (gnus-overlay-put overlay 'mouse-face gnus-article-mouse-face)))))
        ;; The upper-case IMG_ALT is apparently just an artifact that
@@ -202,6 +221,12 @@
     (when images
       (gnus-html-schedule-image-fetching (current-buffer) (nreverse images)))))
 
+(defun gnus-html-insert-image ()
+  "Fetch and insert the image under point."
+  (interactive)
+  (gnus-html-schedule-image-fetching
+   (current-buffer) (list (get-text-property (point) 'gnus-image))))
+
 (defun gnus-html-schedule-image-fetching (buffer images)
   (gnus-message 8 "gnus-html-schedule-image-fetching: buffer %s, images %s"
                 buffer images)
@@ -268,7 +293,9 @@
                           (= (cdr size) 30))))
            (progn
              (gnus-put-image (gnus-html-rescale-image image file size)
-                             (gnus-string-or string "*"))
+                             (gnus-string-or string "*")
+                             'external)
+             (gnus-add-image 'external image)
              t)
          (insert string)
          (when (fboundp 'find-image)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]