]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge changes made in Gnus trunk.
authorGnus developers <ding@gnus.org>
Thu, 14 Oct 2010 22:39:54 +0000 (22:39 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 14 Oct 2010 22:39:54 +0000 (22:39 +0000)
shr.el: Fix defcustom type (char -> character).
nnimap.el (nnimap-open-connection): Remove %s from openssl incantation, which is no longer valid.
gnus-sum.el (gnus-summary-refer-thread): Implement a version that uses *-request-thread.
gnus-int.el (gnus-request-thread): New back end function.
nnimap.el (nnimap-request-thread): New back end function.
shr.el: Indent.
gnus-art.el, shr.el: Have shr switch buffer truncation on if there are big tables.
(nnimap-open-connection): Message when opening connection for debugging purposes.

lisp/gnus/ChangeLog
lisp/gnus/gnus-art.el
lisp/gnus/gnus-int.el
lisp/gnus/gnus-sum.el
lisp/gnus/nnimap.el
lisp/gnus/shr.el

index 7a8a9e171d0e1425e98bc5a1e16db7d3382fc33d..27363445e35e50c04808c728d8bba7ce7f525c58 100644 (file)
@@ -1,3 +1,29 @@
+2010-10-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * nnimap.el (nnimap-open-connection): Message when opening connection
+       for debugging purposes.
+
+       * gnus-art.el (gnus-article-setup-buffer): Set article mode truncation
+       on every setup buffer call to allow this to change from article to
+       article.
+
+       * shr.el (shr-tag-table): Experimental feature: Truncate lines in
+       buffers where we have a wide table.
+
+2010-10-14  Andrew Cohen  <cohen@andy.bu.edu>
+
+       * gnus-sum.el (gnus-summary-refer-thread): Implement a version that
+       uses *-request-thread.
+
+2010-10-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * nnimap.el (nnimap-open-connection): Remove %s from openssl
+       incantation, which is no longer valid.
+
+2010-10-14  Julien Danjou  <julien@danjou.info>
+
+       * shr.el: Fix defcustom type (char -> character).
+
 2010-10-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * nnimap.el (nnimap-open-connection): tls-program should be a list of
index f84b134163c1c1a36a7d00ff943f0afbd1040e00..32411066da1111a8ba233bdeb8a71aa61ca27ccd 100644 (file)
@@ -4474,7 +4474,6 @@ commands:
   ;; face.
   (set (make-local-variable 'nobreak-char-display) nil)
   (setq cursor-in-non-selected-windows nil)
-  (setq truncate-lines gnus-article-truncate-lines)
   (gnus-set-default-directory)
   (buffer-disable-undo)
   (setq buffer-read-only t
@@ -4534,9 +4533,11 @@ Internal variable.")
          (setq gnus-button-marker-list nil)
          (unless (eq major-mode 'gnus-article-mode)
            (gnus-article-mode))
+         (setq truncate-lines gnus-article-truncate-lines)
          (current-buffer))
       (with-current-buffer (gnus-get-buffer-create name)
        (gnus-article-mode)
+       (setq truncate-lines gnus-article-truncate-lines)
        (make-local-variable 'gnus-summary-buffer)
        (setq gnus-summary-buffer
              (gnus-summary-buffer-name gnus-newsgroup-name))
index b210df452cacd7ebe1f237f06fc48a8a3a10838d..19bcffe004948ba25dc2a40de14c6e65b5f10ae3 100644 (file)
@@ -504,6 +504,12 @@ If BUFFER, insert the article in that group."
             article (gnus-group-real-name group)
             (nth 1 gnus-command-method) buffer)))
 
+(defun gnus-request-thread (id)
+  "Request the thread containing the article specified by Message-ID id."
+  (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name)))
+    (funcall (gnus-get-function gnus-command-method 'request-thread)
+            id)))
+
 (defun gnus-request-head (article group)
   "Request the head of ARTICLE in GROUP."
   (let* ((gnus-command-method (gnus-find-method-for-group group))
index 1086e28882c4263f2a82358e6479830cc2a65ebe..568e29762685d7eedc04e93811f6dfaa0d76fdb5 100644 (file)
@@ -8824,31 +8824,35 @@ Return the number of articles fetched."
 
 (defun gnus-summary-refer-thread (&optional limit)
   "Fetch all articles in the current thread.
-If LIMIT (the numerical prefix), fetch that many old headers instead
-of what's specified by the `gnus-refer-thread-limit' variable."
+If no backend-specific 'request-thread function is available
+fetch LIMIT (the numerical prefix) old headers. If LIMIT is nil
+fetch what's specified by the `gnus-refer-thread-limit'
+variable."
   (interactive "P")
   (let ((id (mail-header-id (gnus-summary-article-header)))
        (limit (if limit (prefix-numeric-value limit)
                 gnus-refer-thread-limit)))
-    (unless (eq gnus-fetch-old-headers 'invisible)
-      (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name)
-      ;; Retrieve the headers and read them in.
-      (if (eq (if (numberp limit)
-                 (gnus-retrieve-headers
-                  (list (min
-                         (+ (mail-header-number
-                             (gnus-summary-article-header))
-                            limit)
-                         gnus-newsgroup-end))
-                  gnus-newsgroup-name (* limit 2))
-               ;; gnus-refer-thread-limit is t, i.e. fetch _all_
-               ;; headers.
-               (gnus-retrieve-headers (list gnus-newsgroup-end)
-                                      gnus-newsgroup-name limit))
-             'nov)
-         (gnus-build-all-threads)
-       (error "Can't fetch thread from back ends that don't support NOV"))
-      (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name))
+    (if  (gnus-check-backend-function 'request-thread gnus-newsgroup-name)
+       (gnus-request-thread id)
+      (unless (eq gnus-fetch-old-headers 'invisible)
+       (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name)
+       ;;      Retrieve the headers and read them in.
+       (if (numberp limit)
+           (gnus-retrieve-headers
+            (list (min
+                   (+ (mail-header-number
+                       (gnus-summary-article-header))
+                      limit)
+                   gnus-newsgroup-end))
+            gnus-newsgroup-name (* limit 2))
+         ;; gnus-refer-thread-limit is t, i.e. fetch _all_
+         ;; headers.
+         (gnus-retrieve-headers (list gnus-newsgroup-end)
+                                gnus-newsgroup-name limit)
+         (gnus-message 5 "Fetching headers for %s...done"
+                       gnus-newsgroup-name))))
+    (when (eq gnus-headers-retrieved-by 'nov)
+      (gnus-build-all-threads))
     (gnus-summary-limit-include-thread id)))
 
 (defun gnus-summary-refer-article (message-id)
index 3fbcef60bc0005c4ab7ee23310b4a31b80c2e3fa..bb9f569198476567827c27b0ba3c53508b6839ef 100644 (file)
@@ -304,6 +304,7 @@ textual parts.")
               ((or (eq nnimap-stream 'network)
                    (and (eq nnimap-stream 'starttls)
                         (fboundp 'open-gnutls-stream)))
+               (message "Opening connection to %s..." nnimap-address)
                (open-network-stream
                 "*nnimap*" (current-buffer) nnimap-address
                 (setq port
@@ -313,18 +314,22 @@ textual parts.")
                             "143"))))
                '("143" "imap"))
               ((eq nnimap-stream 'shell)
+               (message "Opening connection to %s via shell..." nnimap-address)
                (nnimap-open-shell-stream
                 "*nnimap*" (current-buffer) nnimap-address
                 (setq port (or nnimap-server-port "imap")))
                '("imap"))
               ((eq nnimap-stream 'starttls)
+               (message "Opening connection to %s via starttls..."
+                        nnimap-address)
                (let ((tls-program
-                      '("openssl s_client %s -connect %h:%p -no_ssl2 -ign_eof -starttls imap")))
+                      '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof -starttls imap")))
                  (open-tls-stream
                   "*nnimap*" (current-buffer) nnimap-address
                   (setq port (or nnimap-server-port "imap"))))
                '("imap"))
               ((memq nnimap-stream '(ssl tls))
+               (message "Opening connection to %s via tls..." nnimap-address)
                (funcall (if (fboundp 'open-gnutls-stream)
                             'open-gnutls-stream
                           'open-tls-stream)
@@ -1311,6 +1316,25 @@ textual parts.")
   (setq nnimap-status-string "Read-only server")
   nil)
 
+(deffoo nnimap-request-thread (id)
+    (let* ((refs (split-string
+              (or (mail-header-references (gnus-summary-article-header))
+                  "")))
+          (cmd (let ((value
+                      (format
+                       "(OR HEADER REFERENCES %s HEADER Message-Id %s)"
+                       id id)))
+                 (dolist (refid refs value)
+                   (setq value (format
+                                "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)"
+                                refid refid value)))))
+          (result
+           (with-current-buffer (nnimap-buffer)
+             (nnimap-command  "UID SEARCH %s" cmd))))
+      (gnus-fetch-headers (and (car result)
+          (delete 0 (mapcar #'string-to-number
+                            (cdr (assoc "SEARCH" (cdr result)))))))))
+
 (defun nnimap-possibly-change-group (group server)
   (let ((open-result t))
     (when (and server
index cfabf1a8bfc1e9333ac445834c697cbe04063ff1..4d70a62ac50b92fa9c540cd484d950a36cf1c67f 100644 (file)
@@ -56,17 +56,17 @@ fit these criteria."
 (defcustom shr-table-line ?-
   "Character used to draw table line."
   :group 'shr
-  :type 'char)
+  :type 'character)
 
 (defcustom shr-table-corner ?+
   "Character used to draw table corner."
   :group 'shr
-  :type 'char)
+  :type 'character)
 
 (defcustom shr-hr-line ?-
   "Character used to draw hr line."
   :group 'shr
-  :type 'char)
+  :type 'character)
 
 (defcustom shr-width fill-column
   "Frame width to use for rendering."
@@ -404,14 +404,17 @@ Return a string with image data."
             (width (string-to-number width)))
         (when (< width max-width)
           (let ((align (cdr (assq :align cont))))
-            (cond ((string= align "right")
-                   (insert (propertize
-                            " " 'display
-                            `(space . (:align-to ,(list (- max-width width)))))))
-                  ((string= align "center")
-                   (insert (propertize
-                            " " 'display
-                            `(space . (:balign-to ,(list (- (/ max-width 2) width))))))))))))
+            (cond
+            ((string= align "right")
+             (insert (propertize
+                      " " 'display
+                      `(space . (:align-to
+                                 ,(list (- max-width width)))))))
+            ((string= align "center")
+             (insert (propertize
+                      " " 'display
+                      `(space . (:balign-to
+                                 ,(list (- (/ max-width 2) width))))))))))))
     (let ((start (point-marker)))
       (when (zerop (length alt))
         (setq alt "[img]"))
@@ -537,6 +540,11 @@ Return a string with image data."
         ;; unbreakable text).
         (sketch (shr-make-table cont suggested-widths))
         (sketch-widths (shr-table-widths sketch suggested-widths)))
+    ;; This probably won't work very well.
+    (when (> (1+ (loop for width across sketch-widths
+                      summing (1+ width)))
+            (frame-width))
+      (setq truncate-lines t))
     ;; Then render the table again with these new "hard" widths.
     (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths))
   ;; Finally, insert all the images after the table.  The Emacs buffer