emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107603: Merge changes made in No Gnus
Date: Wed, 14 Mar 2012 22:15:04 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107603
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Wed 2012-03-14 22:15:04 +0000
message:
  Merge changes made in No Gnus
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-msg.el
  lisp/gnus/gnus-sum.el
  lisp/gnus/shr.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2012-03-12 11:48:55 +0000
+++ b/lisp/gnus/ChangeLog       2012-03-14 22:15:04 +0000
@@ -1,3 +1,22 @@
+2012-03-14  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * gnus-sum.el (gnus-update-marks): Don't propagate marks unless
+       requested (bug#10961).
+
+       * shr.el (shr-table-widths): Divide the extra width more fairly over
+       the TDs (bug#10973).
+       (shr-render-td): Don't delete too much padding.
+       (shr-natural-width): Compute the natural width more correctly.
+       (shr-insert): Allow the natural width to be computed for tables again.
+       (shr-tag-table-1): Rework how the natural widths are computed by
+       rendering the table a third time.
+       (shr-natural-width): Removed.
+       (shr-buffer-width): New function.
+       (shr-expand-newlines): Use it.
+
+       * gnus-msg.el (gnus-bug): Don't delete the other windows.  We may be
+       using a `gnus-use-full-window' setup (bug#11013).
+
 2012-03-12  Lars Magne Ingebrigtsen  <address@hidden>
 
        * gnus-int.el (gnus-backend-trace): Flip default to nil before Emacs

=== modified file 'lisp/gnus/gnus-msg.el'
--- a/lisp/gnus/gnus-msg.el     2012-03-04 22:19:10 +0000
+++ b/lisp/gnus/gnus-msg.el     2012-03-14 22:15:04 +0000
@@ -1453,7 +1453,6 @@
     (error "Gnus has been shut down"))
   (gnus-setup-message (if (message-mail-user-agent) 'message 'bug)
     (unless (message-mail-user-agent)
-      (delete-other-windows)
       (when gnus-bug-create-help-buffer
        (switch-to-buffer "*Gnus Help Bug*")
        (erase-buffer)

=== modified file 'lisp/gnus/gnus-sum.el'
--- a/lisp/gnus/gnus-sum.el     2012-02-20 11:17:07 +0000
+++ b/lisp/gnus/gnus-sum.el     2012-03-14 22:15:04 +0000
@@ -6074,6 +6074,10 @@
 
        (when (and (gnus-check-backend-function
                    'request-set-mark gnus-newsgroup-name)
+                  (or gnus-propagate-marks
+                      (gnus-method-option-p
+                       (gnus-find-method-for-group gnus-newsgroup-name)
+                       'server-marks))
                   (not (gnus-article-unpropagatable-p (cdr type))))
          (let* ((old (cdr (assq (cdr type) (gnus-info-marks info))))
                 ;; Don't do anything about marks for articles we

=== modified file 'lisp/gnus/shr.el'
--- a/lisp/gnus/shr.el  2012-02-25 13:20:57 +0000
+++ b/lisp/gnus/shr.el  2012-03-14 22:15:04 +0000
@@ -341,7 +341,6 @@
            (delete-char -1))
          (insert "\n")
          (unless found
-           (put-text-property (1- (point)) (point) 'shr-break t)
            ;; No space is needed at the beginning of a line.
            (when (eq (following-char) ? )
              (delete-char 1)))
@@ -711,7 +710,7 @@
     (forward-line 1)
     (setq end (point))
     (narrow-to-region start end)
-    (let ((width (shr-natural-width))
+    (let ((width (shr-buffer-width))
          column)
       (goto-char (point-min))
       (while (not (eobp))
@@ -1048,7 +1047,10 @@
         ;; be smaller (if there's little text) or bigger (if there's
         ;; unbreakable text).
         (sketch (shr-make-table cont suggested-widths))
-        (sketch-widths (shr-table-widths sketch suggested-widths)))
+        ;; Compute the "natural" width by setting each column to 500
+        ;; characters and see how wide they really render.
+        (natural (shr-make-table cont (make-vector (length columns) 500)))
+        (sketch-widths (shr-table-widths sketch natural suggested-widths)))
     ;; This probably won't work very well.
     (when (> (+ (loop for width across sketch-widths
                      summing (1+ width))
@@ -1186,31 +1188,35 @@
            shr-table-corner))
   (insert "\n"))
 
-(defun shr-table-widths (table suggested-widths)
+(defun shr-table-widths (table natural-table suggested-widths)
   (let* ((length (length suggested-widths))
         (widths (make-vector length 0))
         (natural-widths (make-vector length 0)))
     (dolist (row table)
       (let ((i 0))
        (dolist (column row)
-         (aset widths i (max (aref widths i)
-                             (car column)))
-         (aset natural-widths i (max (aref natural-widths i)
-                                     (cadr column)))
+         (aset widths i (max (aref widths i) column))
+         (setq i (1+ i)))))
+    (dolist (row natural-table)
+      (let ((i 0))
+       (dolist (column row)
+         (aset natural-widths i (max (aref natural-widths i) column))
          (setq i (1+ i)))))
     (let ((extra (- (apply '+ (append suggested-widths nil))
                    (apply '+ (append widths nil))))
          (expanded-columns 0))
+      ;; We have extra, unused space, so divide this space amongst the
+      ;; columns.
       (when (> extra 0)
+       ;; If the natural width is wider than the rendered width, we
+       ;; want to allow the column to expand.
        (dotimes (i length)
-         ;; If the natural width is wider than the rendered width, we
-         ;; want to allow the column to expand.
          (when (> (aref natural-widths i) (aref widths i))
            (setq expanded-columns (1+ expanded-columns))))
        (dotimes (i length)
          (when (> (aref natural-widths i) (aref widths i))
            (aset widths i (min
-                           (1+ (aref natural-widths i))
+                           (aref natural-widths i)
                            (+ (/ extra expanded-columns)
                               (aref widths i))))))))
     widths))
@@ -1265,10 +1271,13 @@
          (let ((shr-width width)
                (shr-indentation 0))
            (shr-descend (cons 'td cont)))
+         ;; Delete padding at the bottom of the TDs.
          (delete-region
           (point)
-          (+ (point)
-             (skip-chars-backward " \t\n")))
+          (progn
+            (skip-chars-backward " \t\n")
+            (end-of-line)
+            (point)))
          (push (list (cons width cont) (buffer-string)
                      (shr-overlays-in-region (point-min) (point-max)))
                shr-content-cache)))
@@ -1302,19 +1311,14 @@
                  (split-string (buffer-string) "\n")
                  (shr-collect-overlays)
                  (car actual-colors))
-         (list max
-               (shr-natural-width)))))))
+         max)))))
 
-(defun shr-natural-width ()
+(defun shr-buffer-width ()
   (goto-char (point-min))
-  (let ((current 0)
-       (max 0))
+  (let ((max 0))
     (while (not (eobp))
       (end-of-line)
-      (setq current (+ current (current-column)))
-      (unless (get-text-property (point) 'shr-break)
-       (setq max (max max current)
-             current 0))
+      (setq max (max max (current-column)))
       (forward-line 1))
     max))
 


reply via email to

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