emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107151: Merge changes made in No Gnu


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107151: Merge changes made in No Gnus
Date: Tue, 07 Feb 2012 00:42:21 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107151
author: Lars Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Tue 2012-02-07 00:42:21 +0000
message:
  Merge changes made in No Gnus
  
  shr-color.el (shr-color-set-minimum-interval): Renamed to add prefix 
(bug#10732).
  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).
  gnus-sum.el (gnus-summary-exit-no-update): Really deaden the summary buffer 
if `gnus-kill-summary-on-exit' is nil.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-sum.el
  lisp/gnus/shr-color.el
  lisp/gnus/shr.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2012-02-06 22:52:55 +0000
+++ b/lisp/gnus/ChangeLog       2012-02-07 00:42:21 +0000
@@ -1,3 +1,19 @@
+2012-02-07  Lars Ingebrigtsen  <address@hidden>
+
+       * shr-color.el (shr-color-set-minimum-interval): Renamed to add prefix
+       (bug#10732).
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
 
        * gnus-sum.el (gnus-summary-show-thread):

=== modified file 'lisp/gnus/gnus-sum.el'
--- a/lisp/gnus/gnus-sum.el     2012-02-06 22:52:55 +0000
+++ b/lisp/gnus/gnus-sum.el     2012-02-07 00:42:21 +0000
@@ -7328,9 +7328,11 @@
        (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

=== modified file 'lisp/gnus/shr-color.el'
--- a/lisp/gnus/shr-color.el    2012-01-05 09:46:05 +0000
+++ b/lisp/gnus/shr-color.el    2012-02-07 00:42:21 +0000
@@ -267,7 +267,8 @@
      (t
       nil))))
 
-(defun set-minimum-interval (val1 val2 min max interval &optional fixed)
+(defun shr-color-set-minimum-interval (val1 val2 min max interval
+                                           &optional fixed)
   "Set minimum interval between VAL1 and VAL2 to INTERVAL.
 The values are bound by MIN and MAX.
 If FIXED is t, then VAL1 will not be touched."
@@ -341,9 +342,9 @@
                 (>= luminance-distance shr-color-visible-luminance-min))
            (list bg fg)
          ;; Not visible, try to change luminance to make them visible
-         (let ((Ls (set-minimum-interval (car bg-lab) (car fg-lab) 0 100
-                                         shr-color-visible-luminance-min
-                                         fixed-background)))
+         (let ((Ls (shr-color-set-minimum-interval
+                    (car bg-lab) (car fg-lab) 0 100
+                    shr-color-visible-luminance-min fixed-background)))
            (unless fixed-background
              (setcar bg-lab (car Ls)))
            (setcar fg-lab (cadr Ls))

=== modified file 'lisp/gnus/shr.el'
--- a/lisp/gnus/shr.el  2012-01-28 02:25:57 +0000
+++ b/lisp/gnus/shr.el  2012-02-07 00:42:21 +0000
@@ -128,6 +128,7 @@
 ;; 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)
@@ -139,12 +140,29 @@
 
 ;;;###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.


reply via email to

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