Merge remote-tracking branch 'origin/no-gnus'
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 7 Feb 2012 00:22:43 +0000 (01:22 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 7 Feb 2012 00:22:43 +0000 (01:22 +0100)
lisp/ChangeLog
lisp/gnus-sum.el
lisp/shr.el

index 2bea734..5c17627 100644 (file)
        next-single-char-property-change may return nil in XEmacs.
        (gnus-summary-article-map): Fix typo.
 
+2012-02-07  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * shr.el (shr-insert-document): Add doc string.
+       (shr-visit-file): Ditto.
+       (shr-remove-trailing-whitespace): New function.
+       (shr-insert-document): Use it to clean up trailing whitespace as the
+       final step (bug#10714).
+
+2012-02-06  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-sum.el (gnus-summary-exit-no-update): Really deaden the summary
+       buffer if `gnus-kill-summary-on-exit' is nil.
+
+2012-02-06  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-sum.el (gnus-summary-show-thread):
+       next-single-char-property-change may return nil in XEmacs.
+
 2012-02-06  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-sum.el (gnus-handle-ephemeral-exit): Allow exiting from Gnus
index 52eb448..cd836dd 100644 (file)
@@ -7330,9 +7330,11 @@ If FORCE (the prefix), also save the .newsrc file(s)."
        (gnus-kill-buffer gnus-original-article-buffer)
        (setq gnus-article-current nil))
       ;; Return to the group buffer.
-      (gnus-configure-windows 'group 'force)
       (if (not gnus-kill-summary-on-exit)
-         (gnus-deaden-summary)
+         (progn
+           (gnus-deaden-summary)
+           (gnus-configure-windows 'group 'force))
+       (gnus-configure-windows 'group 'force)
        (gnus-close-group group)
        (gnus-kill-buffer gnus-summary-buffer))
       (unless gnus-single-article-buffer
index 83392cd..e0b4441 100644 (file)
@@ -129,6 +129,7 @@ cid: URL as the argument.")
 ;; Public functions and commands.
 
 (defun shr-visit-file (file)
+  "Parse FILE as an HTML document, and render it in a new buffer."
   (interactive "fHTML file name: ")
   (pop-to-buffer "*html*")
   (erase-buffer)
@@ -140,12 +141,29 @@ cid: URL as the argument.")
 
 ;;;###autoload
 (defun shr-insert-document (dom)
+  "Render the parsed document DOM into the current buffer.
+DOM should be a parse tree as generated by
+`libxml-parse-html-region' or similar."
   (setq shr-content-cache nil)
-  (let ((shr-state nil)
+  (let ((start (point))
+       (shr-state nil)
        (shr-start nil)
        (shr-base nil)
        (shr-width (or shr-width (window-width))))
-    (shr-descend (shr-transform-dom dom))))
+    (shr-descend (shr-transform-dom dom))
+    (shr-remove-trailing-whitespace start (point))))
+
+(defun shr-remove-trailing-whitespace (start end)
+  (save-restriction
+    (narrow-to-region start end)
+    (delete-trailing-whitespace)
+    (goto-char start)
+    (while (not (eobp))
+      (end-of-line)
+      (dolist (overlay (overlays-at (point)))
+       (when (overlay-get overlay 'before-string)
+         (overlay-put overlay 'before-string nil)))
+      (forward-line 1))))
 
 (defun shr-copy-url ()
   "Copy the URL under point to the kill ring.