aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGnus developers2010-10-14 22:39:54 +0000
committerKatsumi Yamaoka2010-10-14 22:39:54 +0000
commit030158f32daaefe34476bbd0ec7156b46c2f3f2a (patch)
treedcb65508d10559d8a27f931b50b3dcb22d88a0a7
parent7a9fc593508250c2a84320a5430dda49e7354fef (diff)
downloademacs-030158f32daaefe34476bbd0ec7156b46c2f3f2a.tar.gz
emacs-030158f32daaefe34476bbd0ec7156b46c2f3f2a.zip
Merge changes made in Gnus trunk.
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.
-rw-r--r--lisp/gnus/ChangeLog26
-rw-r--r--lisp/gnus/gnus-art.el3
-rw-r--r--lisp/gnus/gnus-int.el6
-rw-r--r--lisp/gnus/gnus-sum.el46
-rw-r--r--lisp/gnus/nnimap.el26
-rw-r--r--lisp/gnus/shr.el30
6 files changed, 103 insertions, 34 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 7a8a9e171d0..27363445e35 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,5 +1,31 @@
12010-10-14 Lars Magne Ingebrigtsen <larsi@gnus.org> 12010-10-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 2
3 * nnimap.el (nnimap-open-connection): Message when opening connection
4 for debugging purposes.
5
6 * gnus-art.el (gnus-article-setup-buffer): Set article mode truncation
7 on every setup buffer call to allow this to change from article to
8 article.
9
10 * shr.el (shr-tag-table): Experimental feature: Truncate lines in
11 buffers where we have a wide table.
12
132010-10-14 Andrew Cohen <cohen@andy.bu.edu>
14
15 * gnus-sum.el (gnus-summary-refer-thread): Implement a version that
16 uses *-request-thread.
17
182010-10-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
19
20 * nnimap.el (nnimap-open-connection): Remove %s from openssl
21 incantation, which is no longer valid.
22
232010-10-14 Julien Danjou <julien@danjou.info>
24
25 * shr.el: Fix defcustom type (char -> character).
26
272010-10-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
28
3 * nnimap.el (nnimap-open-connection): tls-program should be a list of 29 * nnimap.el (nnimap-open-connection): tls-program should be a list of
4 programs. 30 programs.
5 31
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index f84b134163c..32411066da1 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -4474,7 +4474,6 @@ commands:
4474 ;; face. 4474 ;; face.
4475 (set (make-local-variable 'nobreak-char-display) nil) 4475 (set (make-local-variable 'nobreak-char-display) nil)
4476 (setq cursor-in-non-selected-windows nil) 4476 (setq cursor-in-non-selected-windows nil)
4477 (setq truncate-lines gnus-article-truncate-lines)
4478 (gnus-set-default-directory) 4477 (gnus-set-default-directory)
4479 (buffer-disable-undo) 4478 (buffer-disable-undo)
4480 (setq buffer-read-only t 4479 (setq buffer-read-only t
@@ -4534,9 +4533,11 @@ Internal variable.")
4534 (setq gnus-button-marker-list nil) 4533 (setq gnus-button-marker-list nil)
4535 (unless (eq major-mode 'gnus-article-mode) 4534 (unless (eq major-mode 'gnus-article-mode)
4536 (gnus-article-mode)) 4535 (gnus-article-mode))
4536 (setq truncate-lines gnus-article-truncate-lines)
4537 (current-buffer)) 4537 (current-buffer))
4538 (with-current-buffer (gnus-get-buffer-create name) 4538 (with-current-buffer (gnus-get-buffer-create name)
4539 (gnus-article-mode) 4539 (gnus-article-mode)
4540 (setq truncate-lines gnus-article-truncate-lines)
4540 (make-local-variable 'gnus-summary-buffer) 4541 (make-local-variable 'gnus-summary-buffer)
4541 (setq gnus-summary-buffer 4542 (setq gnus-summary-buffer
4542 (gnus-summary-buffer-name gnus-newsgroup-name)) 4543 (gnus-summary-buffer-name gnus-newsgroup-name))
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index b210df452ca..19bcffe0049 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -504,6 +504,12 @@ If BUFFER, insert the article in that group."
504 article (gnus-group-real-name group) 504 article (gnus-group-real-name group)
505 (nth 1 gnus-command-method) buffer))) 505 (nth 1 gnus-command-method) buffer)))
506 506
507(defun gnus-request-thread (id)
508 "Request the thread containing the article specified by Message-ID id."
509 (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name)))
510 (funcall (gnus-get-function gnus-command-method 'request-thread)
511 id)))
512
507(defun gnus-request-head (article group) 513(defun gnus-request-head (article group)
508 "Request the head of ARTICLE in GROUP." 514 "Request the head of ARTICLE in GROUP."
509 (let* ((gnus-command-method (gnus-find-method-for-group group)) 515 (let* ((gnus-command-method (gnus-find-method-for-group group))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 1086e28882c..568e2976268 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -8824,31 +8824,35 @@ Return the number of articles fetched."
8824 8824
8825(defun gnus-summary-refer-thread (&optional limit) 8825(defun gnus-summary-refer-thread (&optional limit)
8826 "Fetch all articles in the current thread. 8826 "Fetch all articles in the current thread.
8827If LIMIT (the numerical prefix), fetch that many old headers instead 8827If no backend-specific 'request-thread function is available
8828of what's specified by the `gnus-refer-thread-limit' variable." 8828fetch LIMIT (the numerical prefix) old headers. If LIMIT is nil
8829fetch what's specified by the `gnus-refer-thread-limit'
8830variable."
8829 (interactive "P") 8831 (interactive "P")
8830 (let ((id (mail-header-id (gnus-summary-article-header))) 8832 (let ((id (mail-header-id (gnus-summary-article-header)))
8831 (limit (if limit (prefix-numeric-value limit) 8833 (limit (if limit (prefix-numeric-value limit)
8832 gnus-refer-thread-limit))) 8834 gnus-refer-thread-limit)))
8833 (unless (eq gnus-fetch-old-headers 'invisible) 8835 (if (gnus-check-backend-function 'request-thread gnus-newsgroup-name)
8834 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) 8836 (gnus-request-thread id)
8835 ;; Retrieve the headers and read them in. 8837 (unless (eq gnus-fetch-old-headers 'invisible)
8836 (if (eq (if (numberp limit) 8838 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name)
8837 (gnus-retrieve-headers 8839 ;; Retrieve the headers and read them in.
8838 (list (min 8840 (if (numberp limit)
8839 (+ (mail-header-number 8841 (gnus-retrieve-headers
8840 (gnus-summary-article-header)) 8842 (list (min
8841 limit) 8843 (+ (mail-header-number
8842 gnus-newsgroup-end)) 8844 (gnus-summary-article-header))
8843 gnus-newsgroup-name (* limit 2)) 8845 limit)
8844 ;; gnus-refer-thread-limit is t, i.e. fetch _all_ 8846 gnus-newsgroup-end))
8845 ;; headers. 8847 gnus-newsgroup-name (* limit 2))
8846 (gnus-retrieve-headers (list gnus-newsgroup-end) 8848 ;; gnus-refer-thread-limit is t, i.e. fetch _all_
8847 gnus-newsgroup-name limit)) 8849 ;; headers.
8848 'nov) 8850 (gnus-retrieve-headers (list gnus-newsgroup-end)
8849 (gnus-build-all-threads) 8851 gnus-newsgroup-name limit)
8850 (error "Can't fetch thread from back ends that don't support NOV")) 8852 (gnus-message 5 "Fetching headers for %s...done"
8851 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name)) 8853 gnus-newsgroup-name))))
8854 (when (eq gnus-headers-retrieved-by 'nov)
8855 (gnus-build-all-threads))
8852 (gnus-summary-limit-include-thread id))) 8856 (gnus-summary-limit-include-thread id)))
8853 8857
8854(defun gnus-summary-refer-article (message-id) 8858(defun gnus-summary-refer-article (message-id)
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 3fbcef60bc0..bb9f5691984 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -304,6 +304,7 @@ textual parts.")
304 ((or (eq nnimap-stream 'network) 304 ((or (eq nnimap-stream 'network)
305 (and (eq nnimap-stream 'starttls) 305 (and (eq nnimap-stream 'starttls)
306 (fboundp 'open-gnutls-stream))) 306 (fboundp 'open-gnutls-stream)))
307 (message "Opening connection to %s..." nnimap-address)
307 (open-network-stream 308 (open-network-stream
308 "*nnimap*" (current-buffer) nnimap-address 309 "*nnimap*" (current-buffer) nnimap-address
309 (setq port 310 (setq port
@@ -313,18 +314,22 @@ textual parts.")
313 "143")))) 314 "143"))))
314 '("143" "imap")) 315 '("143" "imap"))
315 ((eq nnimap-stream 'shell) 316 ((eq nnimap-stream 'shell)
317 (message "Opening connection to %s via shell..." nnimap-address)
316 (nnimap-open-shell-stream 318 (nnimap-open-shell-stream
317 "*nnimap*" (current-buffer) nnimap-address 319 "*nnimap*" (current-buffer) nnimap-address
318 (setq port (or nnimap-server-port "imap"))) 320 (setq port (or nnimap-server-port "imap")))
319 '("imap")) 321 '("imap"))
320 ((eq nnimap-stream 'starttls) 322 ((eq nnimap-stream 'starttls)
323 (message "Opening connection to %s via starttls..."
324 nnimap-address)
321 (let ((tls-program 325 (let ((tls-program
322 '("openssl s_client %s -connect %h:%p -no_ssl2 -ign_eof -starttls imap"))) 326 '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof -starttls imap")))
323 (open-tls-stream 327 (open-tls-stream
324 "*nnimap*" (current-buffer) nnimap-address 328 "*nnimap*" (current-buffer) nnimap-address
325 (setq port (or nnimap-server-port "imap")))) 329 (setq port (or nnimap-server-port "imap"))))
326 '("imap")) 330 '("imap"))
327 ((memq nnimap-stream '(ssl tls)) 331 ((memq nnimap-stream '(ssl tls))
332 (message "Opening connection to %s via tls..." nnimap-address)
328 (funcall (if (fboundp 'open-gnutls-stream) 333 (funcall (if (fboundp 'open-gnutls-stream)
329 'open-gnutls-stream 334 'open-gnutls-stream
330 'open-tls-stream) 335 'open-tls-stream)
@@ -1311,6 +1316,25 @@ textual parts.")
1311 (setq nnimap-status-string "Read-only server") 1316 (setq nnimap-status-string "Read-only server")
1312 nil) 1317 nil)
1313 1318
1319(deffoo nnimap-request-thread (id)
1320 (let* ((refs (split-string
1321 (or (mail-header-references (gnus-summary-article-header))
1322 "")))
1323 (cmd (let ((value
1324 (format
1325 "(OR HEADER REFERENCES %s HEADER Message-Id %s)"
1326 id id)))
1327 (dolist (refid refs value)
1328 (setq value (format
1329 "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)"
1330 refid refid value)))))
1331 (result
1332 (with-current-buffer (nnimap-buffer)
1333 (nnimap-command "UID SEARCH %s" cmd))))
1334 (gnus-fetch-headers (and (car result)
1335 (delete 0 (mapcar #'string-to-number
1336 (cdr (assoc "SEARCH" (cdr result)))))))))
1337
1314(defun nnimap-possibly-change-group (group server) 1338(defun nnimap-possibly-change-group (group server)
1315 (let ((open-result t)) 1339 (let ((open-result t))
1316 (when (and server 1340 (when (and server
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index cfabf1a8bfc..4d70a62ac50 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -56,17 +56,17 @@ fit these criteria."
56(defcustom shr-table-line ?- 56(defcustom shr-table-line ?-
57 "Character used to draw table line." 57 "Character used to draw table line."
58 :group 'shr 58 :group 'shr
59 :type 'char) 59 :type 'character)
60 60
61(defcustom shr-table-corner ?+ 61(defcustom shr-table-corner ?+
62 "Character used to draw table corner." 62 "Character used to draw table corner."
63 :group 'shr 63 :group 'shr
64 :type 'char) 64 :type 'character)
65 65
66(defcustom shr-hr-line ?- 66(defcustom shr-hr-line ?-
67 "Character used to draw hr line." 67 "Character used to draw hr line."
68 :group 'shr 68 :group 'shr
69 :type 'char) 69 :type 'character)
70 70
71(defcustom shr-width fill-column 71(defcustom shr-width fill-column
72 "Frame width to use for rendering." 72 "Frame width to use for rendering."
@@ -404,14 +404,17 @@ Return a string with image data."
404 (width (string-to-number width))) 404 (width (string-to-number width)))
405 (when (< width max-width) 405 (when (< width max-width)
406 (let ((align (cdr (assq :align cont)))) 406 (let ((align (cdr (assq :align cont))))
407 (cond ((string= align "right") 407 (cond
408 (insert (propertize 408 ((string= align "right")
409 " " 'display 409 (insert (propertize
410 `(space . (:align-to ,(list (- max-width width))))))) 410 " " 'display
411 ((string= align "center") 411 `(space . (:align-to
412 (insert (propertize 412 ,(list (- max-width width)))))))
413 " " 'display 413 ((string= align "center")
414 `(space . (:balign-to ,(list (- (/ max-width 2) width)))))))))))) 414 (insert (propertize
415 " " 'display
416 `(space . (:balign-to
417 ,(list (- (/ max-width 2) width))))))))))))
415 (let ((start (point-marker))) 418 (let ((start (point-marker)))
416 (when (zerop (length alt)) 419 (when (zerop (length alt))
417 (setq alt "[img]")) 420 (setq alt "[img]"))
@@ -537,6 +540,11 @@ Return a string with image data."
537 ;; unbreakable text). 540 ;; unbreakable text).
538 (sketch (shr-make-table cont suggested-widths)) 541 (sketch (shr-make-table cont suggested-widths))
539 (sketch-widths (shr-table-widths sketch suggested-widths))) 542 (sketch-widths (shr-table-widths sketch suggested-widths)))
543 ;; This probably won't work very well.
544 (when (> (1+ (loop for width across sketch-widths
545 summing (1+ width)))
546 (frame-width))
547 (setq truncate-lines t))
540 ;; Then render the table again with these new "hard" widths. 548 ;; Then render the table again with these new "hard" widths.
541 (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths)) 549 (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths))
542 ;; Finally, insert all the images after the table. The Emacs buffer 550 ;; Finally, insert all the images after the table. The Emacs buffer