1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-11 09:20:51 +00:00

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.
This commit is contained in:
Gnus developers 2010-10-14 22:39:54 +00:00 committed by Katsumi Yamaoka
parent 7a9fc59350
commit 030158f32d
6 changed files with 103 additions and 34 deletions

View 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

View 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))

View 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))

View 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)

View 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

View 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