emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r102214: gnus-sum.el (gnus-print-buff


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102214: gnus-sum.el (gnus-print-buffer): Rewrite to use with-temp-buffer.
Date: Mon, 01 Nov 2010 23:11:37 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102214
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Mon 2010-11-01 23:11:37 +0000
message:
  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.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-cite.el
  lisp/gnus/gnus-sum.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2010-11-01 22:21:10 +0000
+++ b/lisp/gnus/ChangeLog       2010-11-01 23:11:37 +0000
@@ -1,5 +1,12 @@
 2010-11-01  Lars Magne Ingebrigtsen  <address@hidden>
 
+       * 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.

=== modified file 'lisp/gnus/gnus-cite.el'
--- a/lisp/gnus/gnus-cite.el    2010-11-01 22:21:10 +0000
+++ b/lisp/gnus/gnus-cite.el    2010-11-01 23:11:37 +0000
@@ -571,7 +571,8 @@
        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)))

=== modified file 'lisp/gnus/gnus-sum.el'
--- a/lisp/gnus/gnus-sum.el     2010-10-31 22:31:24 +0000
+++ b/lisp/gnus/gnus-sum.el     2010-11-01 23:11:37 +0000
@@ -9330,41 +9330,26 @@
   (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.


reply via email to

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