1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-13 01:20:28 -08:00
Commit graph

326 commits

Author SHA1 Message Date
Lars Ingebrigtsen
5b2401d38f Stop rendering HTML before specdlr exhaustion
Fixes: 22117

* shr.el (shr-descend): Stop rendering before we run out of
specpdl room (bug#22117).

Backport:

(cherry picked from commit 248da292fe)
2015-12-25 17:03:34 +01:00
Lars Ingebrigtsen
ec2a509cfb Use cl-reduce, not reduce.
Backport:

(cherry picked from commit fe4606f93b)
2015-12-25 17:03:18 +01:00
Lars Ingebrigtsen
96ac31425d Allow several <tbody> tags in shr
* shr.el (shr-table-body): New function to find the real body
of a table.
(shr-tag-table): Use it to render several <tbody> tags in a
table (bug#22170).

Backport:

(cherry picked from commit cdaf33029d)
2015-12-25 17:03:06 +01:00
Lars Ingebrigtsen
6ef896cc78 Ignore invalid SVG images
* shr.el (shr-tag-svg): Ignore SVG images that have no width
or height, because these can't be displayed by ImageMagick,
anyway.

Backport:

(cherry picked from commit 821107d53c)
2015-12-25 17:01:27 +01:00
Lars Ingebrigtsen
cc3de97ad3 shr table rendering fix
* shr.el (shr-tag-table): Allow rendering body-less tables
that have headers.

Backport:

(cherry picked from commit b05471e42c)
2015-12-25 16:59:49 +01:00
Lars Ingebrigtsen
9e089ec8a3 Default web pages to right-to-left
* eww.el (eww-mode): Most web pages are left-to-right, so make
that the default (bug#19801).

* shr.el (shr-tag-html): Respect "dir" attributes
(left-to-right, right-to-left).
2015-12-25 07:45:27 +01:00
Lars Ingebrigtsen
248da292fe Stop rendering HTML before specdlr exhaustion
Fixes: 22117

* shr.el (shr-descend): Stop rendering before we run out of
specpdl room (bug#22117).
2015-12-25 06:19:34 +01:00
Lars Ingebrigtsen
fe4606f93b Use cl-reduce, not reduce. 2015-12-25 06:04:01 +01:00
Lars Ingebrigtsen
cdaf33029d Allow several <tbody> tags in shr
* shr.el (shr-table-body): New function to find the real body
of a table.
(shr-tag-table): Use it to render several <tbody> tags in a
table (bug#22170).
2015-12-25 06:01:19 +01:00
Lars Ingebrigtsen
45ebbc0301 Allow overriding shr functions from eww
* eww.el (eww-display-html): Allow overriding elements in
`shr-external-rendering-functions'.
2015-12-24 17:34:31 +01:00
Lars Ingebrigtsen
821107d53c Ignore invalid SVG images
* shr.el (shr-tag-svg): Ignore SVG images that have no width
or height, because these can't be displayed by ImageMagick,
anyway.
2015-12-24 14:40:16 +01:00
Lars Ingebrigtsen
b05471e42c shr table rendering fix
* shr.el (shr-tag-table): Allow rendering body-less tables
that have headers.
2015-12-24 14:00:38 +01:00
Eli Zaretskii
e0d2dc5fd7 Fix last change in shr.el
* lisp/net/shr.el (shr--have-one-fringe-p): Rename from
have-fringes-p.  All callers changed.  Doc fix.  (Bug#21895)

Backport.
2015-11-13 21:58:24 +02:00
Eli Zaretskii
35f5afbca1 Fix last change in shr.el
* lisp/net/shr.el (shr--have-one-fringe-p): Rename from
have-fringes-p.  All callers changed.  Doc fix.  (Bug#21895)
2015-11-13 11:23:35 +02:00
Eric Hanchrow
9463abf4cc shr: don't invoke unbound function (Bug#21895)
* lisp/net/shr.el (have-fringes-p): New function.
  (shr-insert-document, shr-fill-text): Use it.
2015-11-12 17:38:06 -08:00
Paul Eggert
943f7f902e Spelling fixes
* configure.ac (bitmapdir): Fix misspelling of bmd_acc.
* test/automated/coding-tests.el (ert-test-coding-bogus-coding-systems):
Fix misspelling of nonexistent file name.
2015-10-14 14:46:50 -07:00
Eli Zaretskii
45d0b3dd11 shr: fix too long lines in rendered buffers (Bug#21012)
Co-authored-by: Michael Heerdegen <michael_heerdegen@web.de>
* lisp/net/shr.el (shr-insert-document, shr-fill-text):
Correct calculation of available width.
(shr-find-fill-point): Don't overflow window edge if shr-kinsoku-shorten
is nil.
2015-10-04 09:35:25 +02:00
Katsumi Yamaoka
8b95ee49bc * net/shr.el (shr-colorize-region): Allow 88-color tty to use colors.
Suggested by Eli Zaretskii.
2015-09-29 06:30:48 +00:00
Katsumi Yamaoka
888d644f0b * net/shr.el (shr-colorize-region):
Don't do it on a system not supporting 256 above colors (bug#21557).
2015-09-29 02:01:50 +00:00
Dmitry Gutov
166a6556d0 ; Remove extraneous "coding: utf-8" specifications in Elisp files 2015-09-29 01:39:46 +03:00
Glenn Morris
5b0af214c8 Quieten compilation, eg in --without-x builds.
* lisp/dired-aux.el (lpr-printer-switch):
* lisp/frame.el (tool-bar-height):
* lisp/linum.el (font-info):
* lisp/window.el (font-info, overflow-newline-into-fringe)
(tool-bar-height):
* lisp/emacs-lisp/package-x.el (tar-data-buffer):
* lisp/gnus/gnus-util.el (iswitchb-mode):
* lisp/mail/rmailmm.el (libxml-parse-html-region):
* lisp/net/nsm.el (gnutls-peer-status)
(gnutls-peer-status-warning-describe):
* lisp/net/shr.el (libxml-parse-xml-region):
* lisp/url/url-http.el (gnutls-peer-status): Declare.
2015-05-08 20:13:47 -04:00
Lars Magne Ingebrigtsen
26d87ff86c Start using proportional fonts in eww by default
* lisp/net/shr.el (shr-use-fonts): Switch the default to t, since
it seems to work well.
2015-05-01 15:28:08 +02:00
Lars Magne Ingebrigtsen
dc332c12ff Fix links in tables in shr
* lisp/net/shr.el: Remove `shr-inhibit-decoration', because that
makes (some) links in tables not work.
2015-05-01 15:24:16 +02:00
Glenn Morris
ce7ff436ff Function declaration updates prompted by 'make check-declare'
* lisp/emacs-lisp/package.el (lm-homepage):
* lisp/gnus/gnus-util.el (iswitchb-read-buffer):
* lisp/gnus/mm-decode.el (libxml-parse-html-region):
* lisp/gnus/mml.el (libxml-parse-html-region):
* lisp/gnus/nnrss.el (libxml-parse-html-region):
* lisp/net/eww.el (libxml-parse-html-region):
* lisp/net/shr.el (libxml-parse-html-region):
* lisp/vc/vc-bzr.el (vc-annotate-convert-time):
* lisp/vc/vc-cvs.el (vc-annotate-convert-time):
* lisp/vc/vc-git.el (vc-annotate-convert-time):
* lisp/vc/vc-hg.el (vc-annotate-convert-time):
* lisp/vc/vc-mtn.el (vc-annotate-convert-time):
* lisp/vc/vc-rcs.el (vc-annotate-convert-time):
Update declaration.
2015-04-30 20:06:15 -04:00
Andreas Schwab
2f3011a466 shr: strip leading whitespace when expanding URLs
* lisp/net/shr.el (shr-expand-url): Strip leading whitespace from URL.
2015-04-24 17:19:31 +02:00
Lars Magne Ingebrigtsen
bb13183c1b (shr-insert): Also remove soft hypens from non-folded text. 2015-03-01 12:21:43 +01:00
Lars Magne Ingebrigtsen
2294380798 * lisp/net/shr.el (shr-insert): Remove soft hyphens. 2015-03-01 12:17:52 +01:00
Lars Magne Ingebrigtsen
10a5a054ac * lisp/net/shr.el (shr-tag-li): Speed up rendering pages with lots of <ul> 2015-02-13 15:51:23 +11:00
Lars Magne Ingebrigtsen
6ebbeafc94 Fix <li><p> indentation in shr
(shr-ensure-paragraph): Don't insert a new paragraph as the first
item in a <li>.
2015-02-11 17:25:10 +11:00
Lars Magne Ingebrigtsen
e6929b0b8a (shr-fill-line): Preserve background colours when indenting/folding. 2015-02-11 15:34:07 +11:00
Lars Magne Ingebrigtsen
cbb6f138e6 shr space widths fixup
* lisp/net/shr.el (shr-insert): Make sure the space inserted has the
right font (for width).
2015-02-11 14:34:21 +11:00
Lars Magne Ingebrigtsen
f6d781c294 Fix up :align-to background colours
(shr-insert-table): Only copy the background, not underline and
the like.
(shr-face-background): New function.
2015-02-10 18:52:57 +11:00
Lars Magne Ingebrigtsen
d5111d525f shr cleanup and background color fix
(shr-table-widths): Off-by-one error in width computation.
(shr-expand-newlines): Remove dead code.
(shr-insert-table): Extend background colors to the end of the column.
2015-02-10 18:09:56 +11:00
Lars Magne Ingebrigtsen
50f64a3653 (shr-tag-hr): Compute the right length when using fonts. 2015-02-10 16:54:13 +11:00
Lars Magne Ingebrigtsen
6a319400cc Fix <h1> and <tt> rendering
(shr-tag-h1): Don't use variable-pitch fonts on fontless rendering.
(shr-tag-tt): New function.
2015-02-10 16:48:04 +11:00
Lars Magne Ingebrigtsen
656caef350 Allow using variable-width fonts in eww
* lisp/gnus/mm-decode.el (mm-shr): Only pass the fill column when not using
fonts, because limiting the width to what's appropriate for followups
doesn't really help when not using proportional fonts.

* lisp/net/shr.el (shr-use-fonts): New variable.
(shr-fill-text): Rename from "fold".
(shr-pixel-column, shr-pixel-region, shr-string-pixel-width): New
functions.
(shr-insert): Just insert, don't fill the text.  Filling is now
done afterwards per display unit.
(shr-fill-lines, shr-fill-line): New functions to fill text on a
per-unit base.
(shr-find-fill-point): Take a "beginning" parameter.
(shr-indent): Indent using the :width display parameter when using
fonts.
(shr-parse-style): Ignore "inherit" values, since we already do that.
(shr-tag-img): Remove the insertion states.
(shr-tag-blockquote): New-style filling.
(shr-tag-dd): Ditto.
(shr-tag-li): Ditto.
(shr-mark-fill): New function to mark lines that need filling.
(shr-tag-h1): Use a larger font.
(shr-tag-table-1): Get the natural and suggested widths in one
rendering.
(shr-tag-table): Create the "fixed" version of the table only once
so that we can cache data in the table.
(shr-insert-table): Get colspan calculations right by having
zero-width columns after colspan ones.
(shr-expand-alignments): New function to make :align-to specs work
right when rendered in one buffer and displayed in another one.
(shr-insert-table-ruler): Use :align-to to get the widths right.
(shr-make-table): Cache more.
(shr-make-table-1): Use the new <td> data layout.
(shr-pixel-buffer-width): New function.
(shr-render-td): Add a caching layer.
(shr-dom-max-natural-width): New function.
2015-02-10 16:29:05 +11:00
Lars Magne Ingebrigtsen
1a369fc7f1 (shr-make-table-1): Make colspan display more sensibly.
This makes display of stuff like

 ---------- ---- ---- ----
|R1C1      |R1C2|R1C2|R1C2|
 ---------- ---- ---- ----
|R2C1 and R2C2  |RC4      |
|in one         |         |
 ---------- ---- ---- ----

work
2015-01-26 17:04:55 +11:00
Lars Magne Ingebrigtsen
776705f49c (shr-make-table-1): Add comments. 2015-01-26 16:35:51 +11:00
Lars Magne Ingebrigtsen
dafb0ef852 * lisp/net/shr.el (shr-make-table-1): Fix colspan typo. 2015-01-26 16:14:17 +11:00
Lars Magne Ingebrigtsen
ec7605b4b1 (shr-urlify): Don't bother the user about invalidly-encoded display strings 2015-01-10 17:54:24 +01:00
Ivan Shmakov
fd6b7e5807 (shr-urlify): Decode URLs before using them as titles
Fixes: debbugs:19555

* lisp/net/shr.el (shr-urlify): Decode URLs before using them as titles.
2015-01-10 17:48:38 +01:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Lars Ingebrigtsen
c5a81fdb6f Make eww rendering default to `window-width' again
* lisp/gnus/mm-decode.el (mm-shr): Bind `shr-width' to `fill-column'
so that lines don't get overlong when responding.

* lisp/net/eww.el (eww-mode): Truncate overlong lines for prettier
display when resizing.

* lisp/net/shr.el (shr-width): Default to using the window width when
rendering.
2014-12-29 13:48:43 +01:00
Ivan Shmakov
53822badf4 shr table header/footer fixes
Fixes: debbugs:19444

* lisp/net/shr.el (shr-tag-table): Fix handling of tbody/header/footer
elements in tables.
2014-12-28 15:06:05 +01:00
Lars Magne Ingebrigtsen
872617ad73 * net/shr.el (shr-fold-text): Don't bug out on zero-length text. 2014-12-15 06:05:05 +01:00
Andreas Schwab
4ea175894a * net/shr.el (shr-next-link): Don't error out at eob. 2014-12-13 19:04:00 +01:00
Lars Magne Ingebrigtsen
05beff88de (shr-fold-text): Inhibit state from being altered. 2014-12-13 16:32:17 +01:00
Lars Magne Ingebrigtsen
76f9994d67 Make shr fold long title texts
* net/shr.el (shr-fold-text): New function.
(shr-show-alt-text, shr-urlify, shr-tag-img): Use it to fold long
alt/title texts.
2014-12-13 16:23:40 +01:00
Lars Magne Ingebrigtsen
ef8892db3c (shr-tag-object): Don't bug out on text elements in <object> 2014-12-10 05:00:32 +01:00
Lars Magne Ingebrigtsen
c3ea511964 Make inline SVGs work in shr again
* net/shr.el (shr-dom-print): Don't print comments.
(shr-tag-svg): Give inline SVG images the right type.
2014-12-09 05:18:12 +01:00