unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10714: SHR leaves too much trailing whitespace
@ 2012-02-03 18:34 Stefan Monnier
  2012-02-05 18:39 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2012-02-03 18:34 UTC (permalink / raw)
  To: 10714

Package: Emacs
Version: 24.0.92

SHR usually does a pretty good job of showing me the useful content of
those obnoxious HTML email, but occasionally the result is hard to read.
One fairly common case is that every text line is much longer than my
window's with (like twice as long, for instance), although most of it is
whitespace (I suspect it's due to some horrendous HTML markup using
something like tables to force a particular layout that only works for
1280x800 screens).  So I think we should trim all trailing whitespace
after rendering, which will solve at least some of those problems.


        Stefan




In GNU Emacs 24.0.92.1 (i686-pc-linux-gnu, GTK+ Version 2.24.8)
 of 2012-01-17 on pastel
Windowing system distributor `The X.Org Foundation', version 11.0.11103901
Configured using:
 `configure
 'CFLAGS=-Wall -Wno-pointer-sign -DUSE_LISP_UNION_TYPE -DSYNC_INPUT -DENABLE_CHECKING -DXASSERTS -DFONTSET_DEBUG -g -O0'
 '--with-tiff=no''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fr_CH.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: InactiveMinibuffer

Minor modes in effect:
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  electric-pair-mode: t
  electric-indent-mode: t
  url-handler-mode: t
  global-reveal-mode: t
  reveal-mode: t
  auto-insert-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<right> <down> <left> <left> <left> <left> <down> <left> 
<return> C-e C-x C-s <select-window> <help-echo> <select-window> 
<select-window> <switch-frame> <switch-frame> <select-window> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<select-window> <select-window> <select-window> <select-window> 
<switch-frame> <switch-frame> <select-window> <select-window> 
<select-window> <select-window> <select-window> <select-window> 
<select-window> <select-window> <select-window> <select-window> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<select-window> <select-window> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <select-window> <select-window> 
<select-window> <select-window> <select-window> <select-window> 
<select-window> <select-window> <switch-frame> <switch-frame> 
<select-window> <select-window> <select-window> <select-window> 
<switch-frame> <help-echo> <switch-frame> <switch-frame> 
<switch-frame> <select-window> <select-window> <select-window> 
<help-echo> <select-window> C-a <up> <up> <up> <up> 
<up> <up> C-SPC <down> <down> <down> <down> <down> 
<down> <down> <down> <down> M-; C-x C-s C-c C-c <return> 
<tab> - > SPC <tab> C-a C-x C-s C-c C-c <return> <select-window> 
<select-window> <select-window> <help-echo> <select-window> 
<select-window> <select-window> <select-window> <help-echo> 
<select-window> <select-window> <select-window> <select-window> 
<help-echo> <switch-frame> <switch-frame> <select-window> 
<select-window> <select-window> <select-window> <select-window> 
<select-window> <help-echo> <select-window> <select-window> 
<switch-frame> <switch-frame> <select-window> <select-window> 
<help-echo> <select-window> <select-window> <select-window> 
<select-window> <select-window> <select-window> <help-echo> 
<switch-frame> <switch-frame> <select-window> <select-window> 
<select-window> <select-window> <select-window> <select-window> 
<switch-frame> <switch-frame> <select-window> <select-window> 
<select-window> <select-window> <select-window> <select-window> 
<select-window> <select-window> <switch-frame> <switch-frame> 
<select-window> <select-window> <select-window> <select-window> 
<select-window> <select-window> <select-window> <select-window> 
<help-echo> <select-window> <select-window> <switch-frame> 
<switch-frame> <select-window> <select-window> <select-window> 
<select-window> <help-echo> <select-window> <select-window> 
<help-echo> <select-window> <select-window> <help-echo> 
<select-window> <select-window> <select-window> <select-window> 
<switch-frame> <switch-frame> <select-window> <select-window> 
<select-window> <select-window> <select-window> <switch-frame> 
<switch-frame> <select-window> <select-window> <select-window> 
<help-echo> <select-window> <select-window> <help-echo> 
<select-window> <select-window> <select-window> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> f ~ / 
s / m / r e c <tab> <return> C-s s a u c i s s e C-s 
C-s C-s C-s C-a C-s p o i r e C-s C-s C-s C-s C-s C-s 
C-s C-s C-s C-s C-s C-a <up> <left> <right> <down> 
<down> <left> <right> <help-echo> <switch-frame> <switch-frame> 
<help-echo> <switch-frame> M-x r e p o - e m - b u 
<tab> <return>

Recent messages:
Warning: isearch-message-state is obsolete!
Mark saved where search started
Warning: isearch-success-state is obsolete! [2 times]
Warning: isearch-error-state is obsolete!
Warning: isearch-message-state is obsolete!
Warning: isearch-success-state is obsolete! [2 times]
Warning: isearch-error-state is obsolete!
Warning: isearch-message-state is obsolete!
Mark saved where search started
Warning: interactive-p is obsolete! [2 times]

Load-path shadows:
None found.

Features:
(typer-mode epa-file epa epg epg-config vc-dir descr-text informat
texinfo vc-sccs vc-svn vc-cvs vc-rcs cal-china lunar solar cal-dst
cal-bahai cal-islam cal-hebrew holidays hol-loaddefs cal-french
diary-lib diary-loaddefs cal-move cal-menu calendar cal-loaddefs sort
mail-extr message sendmail rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mail-utils
mailheader emacsbug sh-script conf-mode hideif cpp cmacexp cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs sgml-mode format-spec reftex-vcr reftex-dcr reftex reftex-vars
tex-mode latexenc bbdb-com mailabbrev bbdb timezone whitespace
autorevert doc-view jka-compr image-mode dired cl-specs xscheme trace
testcover scheme unsafep re-builder shadow inf-lisp ielm pp gmm-utils
ert find-func ewoc elp edebug cust-print repeat debug quail rect
multi-isearch dabbrev shell pcomplete vc ediff-merg ediff-diff
ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff
vc-dispatcher executable copyright cus-edit cus-start cus-load wid-edit
smerge-mode newcomment diff-mode vc-bzr filecache mule-util caml tuareg
speedbar sb-image ezimage dframe skeleton compile comint ring derived
smie caml-help caml-types caml-emacs server noutline outline easy-mmode
flyspell ispell eldoc checkdoc regexp-opt thingatpt help-mode view
prog-mode load-dir electric url-handlers url-parse auth-source warnings
eieio byte-opt bytecomp byte-compile cconv macroexp assoc gnus-util
password-cache url-vars mm-util mail-prsvr reveal autoinsert uniquify
advice help-fns advice-preload time-date savehist minibuf-eldef
disp-table cl cl-loaddefs all-autoloads company-autoloads
debbugs-autoloads epoch-view-autoloads jgraph-mode-autoloads
js2-mode-autoloads lmc-autoloads load-dir-autoloads markchars-autoloads
minimap-autoloads muse-autoloads info easymenu oauth2-autoloads
quarter-plane-autoloads rainbow-mode-autoloads register-list-autoloads
sisu-mode-autoloads svg-clock-autoloads undo-tree-autoloads
uni-confusables-autoloads windresize-autoloads package tabulated-list
proof-site proof-autoloads pg-vars bbdb-autoloads agda2 tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer loaddefs button faces cus-face files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#10714: SHR leaves too much trailing whitespace
  2012-02-03 18:34 Stefan Monnier
@ 2012-02-05 18:39 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2012-02-05 18:39 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10714

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> So I think we should trim all trailing whitespace after rendering,
> which will solve at least some of those problems.

I think that's a very good idea.  The final stage in the rendering
process would be just to delete all trailing whitespace.

It seems intuitive to me that this would create a better result than the
current rendering, but right now I'm now able to find any HTML emails
here that renders badly in this manner.  (And I'd like to test it to see
if there are any unforeseen negative effects.)

Do you happen to have such an email handy that you could forward to me?
If not, I can search around my spam mailbox some more...

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Rome





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#10714: SHR leaves too much trailing whitespace
       [not found] <jwvehu8c5x2.fsf-monnier+diro@gnu.org>
@ 2012-02-07  0:17 ` Lars Ingebrigtsen
  2012-02-07 20:07 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2012-02-07  0:17 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10714

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Here's a similar email with lots of trailing whitespace,

Thanks.  And I found a few spam messages that looked pretty much
unreadable with all the trailing white space, and just removing it makes
it a lot more readable.  (Unfortunately.  :-)

I've now fixed this in No Gnus, so it should show up in Emacs 24
soonish...

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Rome





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#10714: SHR leaves too much trailing whitespace
       [not found] <jwvehu8c5x2.fsf-monnier+diro@gnu.org>
  2012-02-07  0:17 ` bug#10714: SHR leaves too much trailing whitespace Lars Ingebrigtsen
@ 2012-02-07 20:07 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2012-02-07 20:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10714

One thing just occurred to me.  If you have something like

<table bgcolor=red><tr><td>bla bla bla</table>

that goes over several lines, that should be presented as a block with a
red background.  By just stripping all the white space, we instead get a 
ragged right, which is kinda ugly (and makes some tables less readable,
if there are nested blocks).

So I think the whitespace-stripping thing will have to be adjusted
slightly, and only remove the whitespace if it actually makes the lines
wider than the window is.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Rome





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-07 20:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <jwvehu8c5x2.fsf-monnier+diro@gnu.org>
2012-02-07  0:17 ` bug#10714: SHR leaves too much trailing whitespace Lars Ingebrigtsen
2012-02-07 20:07 ` Lars Ingebrigtsen
2012-02-03 18:34 Stefan Monnier
2012-02-05 18:39 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).