aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2012-03-14 22:15:04 +0000
committerKatsumi Yamaoka2012-03-14 22:15:04 +0000
commit160ae063e09dca0c8dec52f5a6479211b69b07f1 (patch)
tree16c727ffe351776b662c63930c4471af30746afb
parentcc2ab7327027e47a0a5dff2fb8c1051a866baf40 (diff)
downloademacs-160ae063e09dca0c8dec52f5a6479211b69b07f1.tar.gz
emacs-160ae063e09dca0c8dec52f5a6479211b69b07f1.zip
Merge changes made in No Gnus
-rw-r--r--lisp/gnus/ChangeLog19
-rw-r--r--lisp/gnus/gnus-msg.el1
-rw-r--r--lisp/gnus/gnus-sum.el4
-rw-r--r--lisp/gnus/shr.el48
4 files changed, 49 insertions, 23 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 1e787642664..d0d35407367 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,22 @@
12012-03-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * gnus-sum.el (gnus-update-marks): Don't propagate marks unless
4 requested (bug#10961).
5
6 * shr.el (shr-table-widths): Divide the extra width more fairly over
7 the TDs (bug#10973).
8 (shr-render-td): Don't delete too much padding.
9 (shr-natural-width): Compute the natural width more correctly.
10 (shr-insert): Allow the natural width to be computed for tables again.
11 (shr-tag-table-1): Rework how the natural widths are computed by
12 rendering the table a third time.
13 (shr-natural-width): Removed.
14 (shr-buffer-width): New function.
15 (shr-expand-newlines): Use it.
16
17 * gnus-msg.el (gnus-bug): Don't delete the other windows. We may be
18 using a `gnus-use-full-window' setup (bug#11013).
19
12012-03-12 Lars Magne Ingebrigtsen <larsi@gnus.org> 202012-03-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 21
3 * gnus-int.el (gnus-backend-trace): Flip default to nil before Emacs 22 * gnus-int.el (gnus-backend-trace): Flip default to nil before Emacs
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 7c8d194f26b..500ace9e8ff 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1453,7 +1453,6 @@ If YANK is non-nil, include the original article."
1453 (error "Gnus has been shut down")) 1453 (error "Gnus has been shut down"))
1454 (gnus-setup-message (if (message-mail-user-agent) 'message 'bug) 1454 (gnus-setup-message (if (message-mail-user-agent) 'message 'bug)
1455 (unless (message-mail-user-agent) 1455 (unless (message-mail-user-agent)
1456 (delete-other-windows)
1457 (when gnus-bug-create-help-buffer 1456 (when gnus-bug-create-help-buffer
1458 (switch-to-buffer "*Gnus Help Bug*") 1457 (switch-to-buffer "*Gnus Help Bug*")
1459 (erase-buffer) 1458 (erase-buffer)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 9770b8f9982..7f095e15496 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -6074,6 +6074,10 @@ If SELECT-ARTICLES, only select those articles from GROUP."
6074 6074
6075 (when (and (gnus-check-backend-function 6075 (when (and (gnus-check-backend-function
6076 'request-set-mark gnus-newsgroup-name) 6076 'request-set-mark gnus-newsgroup-name)
6077 (or gnus-propagate-marks
6078 (gnus-method-option-p
6079 (gnus-find-method-for-group gnus-newsgroup-name)
6080 'server-marks))
6077 (not (gnus-article-unpropagatable-p (cdr type)))) 6081 (not (gnus-article-unpropagatable-p (cdr type))))
6078 (let* ((old (cdr (assq (cdr type) (gnus-info-marks info)))) 6082 (let* ((old (cdr (assq (cdr type) (gnus-info-marks info))))
6079 ;; Don't do anything about marks for articles we 6083 ;; Don't do anything about marks for articles we
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 41f12243971..53c0063de2e 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -341,7 +341,6 @@ the URL of the image to the kill buffer instead."
341 (delete-char -1)) 341 (delete-char -1))
342 (insert "\n") 342 (insert "\n")
343 (unless found 343 (unless found
344 (put-text-property (1- (point)) (point) 'shr-break t)
345 ;; No space is needed at the beginning of a line. 344 ;; No space is needed at the beginning of a line.
346 (when (eq (following-char) ? ) 345 (when (eq (following-char) ? )
347 (delete-char 1))) 346 (delete-char 1)))
@@ -711,7 +710,7 @@ ones, in case fg and bg are nil."
711 (forward-line 1) 710 (forward-line 1)
712 (setq end (point)) 711 (setq end (point))
713 (narrow-to-region start end) 712 (narrow-to-region start end)
714 (let ((width (shr-natural-width)) 713 (let ((width (shr-buffer-width))
715 column) 714 column)
716 (goto-char (point-min)) 715 (goto-char (point-min))
717 (while (not (eobp)) 716 (while (not (eobp))
@@ -1048,7 +1047,10 @@ ones, in case fg and bg are nil."
1048 ;; be smaller (if there's little text) or bigger (if there's 1047 ;; be smaller (if there's little text) or bigger (if there's
1049 ;; unbreakable text). 1048 ;; unbreakable text).
1050 (sketch (shr-make-table cont suggested-widths)) 1049 (sketch (shr-make-table cont suggested-widths))
1051 (sketch-widths (shr-table-widths sketch suggested-widths))) 1050 ;; Compute the "natural" width by setting each column to 500
1051 ;; characters and see how wide they really render.
1052 (natural (shr-make-table cont (make-vector (length columns) 500)))
1053 (sketch-widths (shr-table-widths sketch natural suggested-widths)))
1052 ;; This probably won't work very well. 1054 ;; This probably won't work very well.
1053 (when (> (+ (loop for width across sketch-widths 1055 (when (> (+ (loop for width across sketch-widths
1054 summing (1+ width)) 1056 summing (1+ width))
@@ -1186,31 +1188,35 @@ ones, in case fg and bg are nil."
1186 shr-table-corner)) 1188 shr-table-corner))
1187 (insert "\n")) 1189 (insert "\n"))
1188 1190
1189(defun shr-table-widths (table suggested-widths) 1191(defun shr-table-widths (table natural-table suggested-widths)
1190 (let* ((length (length suggested-widths)) 1192 (let* ((length (length suggested-widths))
1191 (widths (make-vector length 0)) 1193 (widths (make-vector length 0))
1192 (natural-widths (make-vector length 0))) 1194 (natural-widths (make-vector length 0)))
1193 (dolist (row table) 1195 (dolist (row table)
1194 (let ((i 0)) 1196 (let ((i 0))
1195 (dolist (column row) 1197 (dolist (column row)
1196 (aset widths i (max (aref widths i) 1198 (aset widths i (max (aref widths i) column))
1197 (car column))) 1199 (setq i (1+ i)))))
1198 (aset natural-widths i (max (aref natural-widths i) 1200 (dolist (row natural-table)
1199 (cadr column))) 1201 (let ((i 0))
1202 (dolist (column row)
1203 (aset natural-widths i (max (aref natural-widths i) column))
1200 (setq i (1+ i))))) 1204 (setq i (1+ i)))))
1201 (let ((extra (- (apply '+ (append suggested-widths nil)) 1205 (let ((extra (- (apply '+ (append suggested-widths nil))
1202 (apply '+ (append widths nil)))) 1206 (apply '+ (append widths nil))))
1203 (expanded-columns 0)) 1207 (expanded-columns 0))
1208 ;; We have extra, unused space, so divide this space amongst the
1209 ;; columns.
1204 (when (> extra 0) 1210 (when (> extra 0)
1211 ;; If the natural width is wider than the rendered width, we
1212 ;; want to allow the column to expand.
1205 (dotimes (i length) 1213 (dotimes (i length)
1206 ;; If the natural width is wider than the rendered width, we
1207 ;; want to allow the column to expand.
1208 (when (> (aref natural-widths i) (aref widths i)) 1214 (when (> (aref natural-widths i) (aref widths i))
1209 (setq expanded-columns (1+ expanded-columns)))) 1215 (setq expanded-columns (1+ expanded-columns))))
1210 (dotimes (i length) 1216 (dotimes (i length)
1211 (when (> (aref natural-widths i) (aref widths i)) 1217 (when (> (aref natural-widths i) (aref widths i))
1212 (aset widths i (min 1218 (aset widths i (min
1213 (1+ (aref natural-widths i)) 1219 (aref natural-widths i)
1214 (+ (/ extra expanded-columns) 1220 (+ (/ extra expanded-columns)
1215 (aref widths i)))))))) 1221 (aref widths i))))))))
1216 widths)) 1222 widths))
@@ -1265,10 +1271,13 @@ ones, in case fg and bg are nil."
1265 (let ((shr-width width) 1271 (let ((shr-width width)
1266 (shr-indentation 0)) 1272 (shr-indentation 0))
1267 (shr-descend (cons 'td cont))) 1273 (shr-descend (cons 'td cont)))
1274 ;; Delete padding at the bottom of the TDs.
1268 (delete-region 1275 (delete-region
1269 (point) 1276 (point)
1270 (+ (point) 1277 (progn
1271 (skip-chars-backward " \t\n"))) 1278 (skip-chars-backward " \t\n")
1279 (end-of-line)
1280 (point)))
1272 (push (list (cons width cont) (buffer-string) 1281 (push (list (cons width cont) (buffer-string)
1273 (shr-overlays-in-region (point-min) (point-max))) 1282 (shr-overlays-in-region (point-min) (point-max)))
1274 shr-content-cache))) 1283 shr-content-cache)))
@@ -1302,19 +1311,14 @@ ones, in case fg and bg are nil."
1302 (split-string (buffer-string) "\n") 1311 (split-string (buffer-string) "\n")
1303 (shr-collect-overlays) 1312 (shr-collect-overlays)
1304 (car actual-colors)) 1313 (car actual-colors))
1305 (list max 1314 max)))))
1306 (shr-natural-width)))))))
1307 1315
1308(defun shr-natural-width () 1316(defun shr-buffer-width ()
1309 (goto-char (point-min)) 1317 (goto-char (point-min))
1310 (let ((current 0) 1318 (let ((max 0))
1311 (max 0))
1312 (while (not (eobp)) 1319 (while (not (eobp))
1313 (end-of-line) 1320 (end-of-line)
1314 (setq current (+ current (current-column))) 1321 (setq max (max max (current-column)))
1315 (unless (get-text-property (point) 'shr-break)
1316 (setq max (max max current)
1317 current 0))
1318 (forward-line 1)) 1322 (forward-line 1))
1319 max)) 1323 max))
1320 1324