Have shr switch buffer truncation on if there are big tables.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 14 Oct 2010 21:13:23 +0000 (23:13 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 14 Oct 2010 21:13:23 +0000 (23:13 +0200)
lisp/ChangeLog
lisp/gnus-art.el
lisp/shr.el

index 58c2c58..8fa0ec1 100644 (file)
@@ -1,3 +1,12 @@
+2010-10-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-art.el (gnus-article-setup-buffer): Set article mode truncation
+       on every setup buffer call to allow this to change from article to
+       article.
+
+       * shr.el (shr-tag-table): Experimental feature: Truncate lines in
+       buffers where we have a wide table.
+
 2010-10-14  Andrew Cohen  <cohen@andy.bu.edu>
 
        * gnus-sum.el (gnus-summary-refer-thread): Implement a version that
index f84b134..3241106 100644 (file)
@@ -4474,7 +4474,6 @@ commands:
   ;; face.
   (set (make-local-variable 'nobreak-char-display) nil)
   (setq cursor-in-non-selected-windows nil)
-  (setq truncate-lines gnus-article-truncate-lines)
   (gnus-set-default-directory)
   (buffer-disable-undo)
   (setq buffer-read-only t
@@ -4534,9 +4533,11 @@ Internal variable.")
          (setq gnus-button-marker-list nil)
          (unless (eq major-mode 'gnus-article-mode)
            (gnus-article-mode))
+         (setq truncate-lines gnus-article-truncate-lines)
          (current-buffer))
       (with-current-buffer (gnus-get-buffer-create name)
        (gnus-article-mode)
+       (setq truncate-lines gnus-article-truncate-lines)
        (make-local-variable 'gnus-summary-buffer)
        (setq gnus-summary-buffer
              (gnus-summary-buffer-name gnus-newsgroup-name))
index e5bd5b0..4d70a62 100644 (file)
@@ -540,6 +540,11 @@ Return a string with image data."
         ;; unbreakable text).
         (sketch (shr-make-table cont suggested-widths))
         (sketch-widths (shr-table-widths sketch suggested-widths)))
+    ;; This probably won't work very well.
+    (when (> (1+ (loop for width across sketch-widths
+                      summing (1+ width)))
+            (frame-width))
+      (setq truncate-lines t))
     ;; Then render the table again with these new "hard" widths.
     (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths))
   ;; Finally, insert all the images after the table.  The Emacs buffer