From: Lars Magne Ingebrigtsen Date: Mon, 1 Nov 2010 23:11:37 +0000 (+0000) Subject: gnus-sum.el (gnus-print-buffer): Rewrite to use with-temp-buffer. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~417 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=285cf7c8fe81d9110fd03486c6d5a0661b9ef71f;p=emacs.git gnus-sum.el (gnus-print-buffer): Rewrite to use with-temp-buffer. gnus-sum.el (gnus-print-buffer): Just print the buffer as is. gnus-cite.el (gnus-article-foldable-buffer): Protect against degenerate articles. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index d233a667126..a9424496bd7 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,12 @@ 2010-11-01 Lars Magne Ingebrigtsen + * gnus-cite.el (gnus-article-foldable-buffer): Protect against + degenerate articles. + + * gnus-sum.el (gnus-print-buffer): Rewrite to use with-temp-buffer. + (gnus-print-buffer): Just print the buffer as is, without any copying + to a buffer and then re-highlighting. + * nnimap.el (nnimap-request-group): Store the new updated info. (nnimap-request-group): Select the group when we don't know whether it exists or not. diff --git a/lisp/gnus/gnus-cite.el b/lisp/gnus/gnus-cite.el index 2d44e36258a..c99cb5cf2e3 100644 --- a/lisp/gnus/gnus-cite.el +++ b/lisp/gnus/gnus-cite.el @@ -571,7 +571,8 @@ longer than the frame width." columns) (goto-char (point-min)) (while (not (eobp)) - (forward-char (length prefix)) + (unless (> (length prefix) (- (point-max) (point))) + (forward-char (length prefix))) (skip-chars-forward " \t") (unless (eolp) (let ((elem (assq (current-column) columns))) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 7de7a0a4a26..0f49ed84fac 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9330,41 +9330,26 @@ to save in." (ps-despool filename)) (defun gnus-print-buffer () - (let ((buffer (generate-new-buffer " *print*"))) - (unwind-protect - (progn - (copy-to-buffer buffer (point-min) (point-max)) - (set-buffer buffer) - (gnus-remove-text-with-property 'gnus-decoration) - (when (gnus-visual-p 'article-highlight 'highlight) - ;; Copy-to-buffer doesn't copy overlay. So redo - ;; highlight. - (let ((gnus-article-buffer buffer)) - (gnus-article-highlight-citation t) - (gnus-article-highlight-signature) - (gnus-article-emphasize) - (gnus-article-delete-invisible-text))) - (let ((ps-left-header - (list - (concat "(" - (gnus-summary-print-truncate-and-quote - (mail-header-subject gnus-current-headers) - 66) ")") - (concat "(" - (gnus-summary-print-truncate-and-quote - (mail-header-from gnus-current-headers) - 45) ")"))) - (ps-right-header - (list - "/pagenumberstring load" - (concat "(" - (mail-header-date gnus-current-headers) ")")))) - (gnus-run-hooks 'gnus-ps-print-hook) - (save-excursion - (if ps-print-color-p - (ps-spool-buffer-with-faces) - (ps-spool-buffer))))) - (kill-buffer buffer)))) + (let ((ps-left-header + (list + (concat "(" + (gnus-summary-print-truncate-and-quote + (mail-header-subject gnus-current-headers) + 66) ")") + (concat "(" + (gnus-summary-print-truncate-and-quote + (mail-header-from gnus-current-headers) + 45) ")"))) + (ps-right-header + (list + "/pagenumberstring load" + (concat "(" + (mail-header-date gnus-current-headers) ")")))) + (gnus-run-hooks 'gnus-ps-print-hook) + (save-excursion + (if ps-print-color-p + (ps-spool-buffer-with-faces) + (ps-spool-buffer))))) (defun gnus-summary-show-complete-article () "Show a complete version of the current article.