Commit graph

302 commits

Author SHA1 Message Date
Lars Ingebrigtsen
37567393a0 Allow passing in max-width/height
* lisp/net/shr.el (shr-rescale-image): Allow passing in
max-width/height (bug#25287).
2017-01-24 21:17:45 +01:00
Paul Eggert
bcf244ef9b Merge from origin/emacs-25
2e2a806 Fix copyright years by hand
5badc81 Update copyright year to 2017
2017-01-01 01:10:47 -08:00
Paul Eggert
5badc81c1c Update copyright year to 2017
Run admin/update-copyright.
2016-12-31 19:42:26 -08:00
Paul Eggert
c26605861e Merge from origin/emacs-25
3d63b48 Update ChangeLog files and authors.el
9d30264 Fix menu bindings of Dired 'A' and 'Q' commands
a725592 Avoid errors in shr-pixel-column due to dedicated windows
3138598 Update format-time-string documentation
2016-12-07 12:36:38 -08:00
Katsumi Yamaoka
e42b964c12 shr.el: Don't render a normal table twice
* lisp/net/shr.el (shr-collect-extra-strings-in-table):
Don't render a table if it is called for the first time,
IOW, recognize it to never be invalid (bug#25051).
2016-11-29 10:20:51 +00:00
Katsumi Yamaoka
b13d6f2c39 Don't collect strings existing out of <tr>...</tr>
* lisp/net/shr.el (shr-collect-extra-strings-in-table):
Don't collect strings existing out of <tr>...</tr> to avoid
duplication with what `shr-tag-table' renders.
2016-11-21 08:21:27 +00:00
Eli Zaretskii
a725592db8 Avoid errors in shr-pixel-column due to dedicated windows
* lisp/net/shr.el (shr-pixel-column): If we are switching to
another buffer in the selected window, make that window
temporarily non-dedicated.  (Bug#24950)
2016-11-20 21:08:47 +02:00
Tino Calancha
5ffdbe0a5e Update parameter :version to 26.1 in several defcustom
Following defcustom where added or modified for 25.2 release.
In fact all these changes belong to 26.1 release.
* lisp/battery.el (battery-linux-sysfs-regexp)
* lisp/comint.el (comint-password-prompt-regexp)
* lisp/dired.el (dired-always-read-filesystem)
* lisp/image.el (image-scaling-factor)
* lisp/ibuf-ext.el (ibuffer-never-search-content-name)
(ibuffer-never-search-content-mode)
* lisp/mouse.el (mouse-select-region-move-to-beginning)
* lisp/net/net-utils.el (iwconfig-program, iwconfig-program-options)
(netstat-program, route-program, route-program-options)
* lisp/net/sieve-manage.el (sieve-manage-default-stream)
* lisp/progmodes/grep.el (grep-save-buffers)
* lisp/vc/add-log.el (change-log-directory-files)
* lisp/url/url-vars.el (url-user-agent)
* lisp/vc/vc-hg.el (vc-hg-symbolic-revision-styles)
(vc-hg-use-file-version-for-mode-line-version)
(vc-hg-parse-hg-data-structures)
* lisp/wdired.el (wdired-create-parent-directories)
* lisp/faces.el (homoglyph, nobreak-hyphen, read-multiple-choice-face)
* lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol)
(gnus-button-url-regexp)
* lisp/window.el (switch-to-buffer-preserve-window-point)
* lisp/ibuffer.el (ibuffer-formats, ibuffer-locked-char)
(ibuffer-locked-buffer)
* lisp/textmodes/flyspell.el (flyspell-sort-corrections-function)
* lisp/emacs-lisp/edebug.el (edebug-sit-on-break)
* lisp/gnus/message.el (message-user-fqdn)
* lisp/simple.el (shell-command-dont-erase-buffer)
(extended-command-suggest-shorter)
* lisp/net/shr.el (shr-use-fonts)
* lisp/files.el (mounted-file-systems, kill-emacs-query-functions)
2016-11-17 00:39:43 +09:00
Katsumi Yamaoka
0bf888422d * lisp/net/shr.el (shr-collect-extra-strings-in-table): Fix indentation. 2016-11-14 06:56:01 +00:00
Katsumi Yamaoka
99e7b99e43 * lisp/net/shr.el (shr-tag-table): Avoid duplication of images.
(shr-collect-extra-strings-in-table): Render images as well.
2016-11-14 06:48:06 +00:00
Katsumi Yamaoka
06b7e73b3e * lisp/net/shr.el (shr--preferred-image): Add CR to whitespace regexps.
(shr-collect-extra-strings-in-table):
Render extra tables in an invalid html as well.
2016-11-11 08:17:41 +00:00
Katsumi Yamaoka
dd91362565 * lisp/net/shr.el (shr--preferred-image): Ignore whitespace (bug#24893). 2016-11-11 00:27:48 +00:00
Katsumi Yamaoka
6ccb5f19f6 * lisp/net/shr.el (shr-collect-extra-strings-in-table) New function
that gathers extra strings in an invalid html.  (bug#24831)
(shr-tag-table): Use it.
2016-11-04 10:33:26 +00:00
Mark Oteiza
d3c2d3ca45 Turn on lexical-binding in some net libs
* lisp/net/dbus.el: Turn on lexical-binding.
(dbus-list-hash-table, dbus-list-known-names):
(dbus-introspect-get-node-names, dbus-introspect-get-interface-names):
(dbus-introspect-get-method-names, dbus-introspect-get-signal-names):
(dbus-introspect-get-property-names):
(dbus-introspect-get-argument-names, dbus-get-all-properties):
(dbus-property-handler, dbus-get-all-managed-objects):
(dbus-managed-object-handler): Replace add-to-list with push. Add
nreverse in some places where the APPEND argument of add-to-list was
used.
* lisp/net/network-stream.el: Turn on lexical-binding.
* lisp/net/newsticker.el: Turn on lexical-binding.
* lisp/net/shr.el: Turn on lexical-binding.
(shr-make-placeholder-image): Remove unused variable binding.
(shr-inspect-table): Replace ignored bindings with underscore.
2016-10-31 20:19:21 -04:00
Lars Ingebrigtsen
9345e638f1 Don't bug out on all-whitespace URLs
* lisp/net/shr.el (shr-expand-url): Don't bug out on
degenerate all-whitespace URLs.
2016-09-14 11:11:34 +02:00
Katsumi Yamaoka
9eb028f886 * lisp/net/shr.el (shr-fill-line):
Preserve text properties in folded lines (bug#24034).
2016-07-21 08:36:17 +00:00
Katsumi Yamaoka
eb9d461a8e * lisp/net/shr.el (shr-fill-line): Withdraw the last commit (4157159). 2016-07-21 08:33:41 +00:00
Katsumi Yamaoka
4157159a37 * lisp/net/shr.el (shr-fill-line):
Preserve text properties in folded lines (bug#24034).
2016-07-20 22:56:42 +00:00
Lars Ingebrigtsen
90fb0b2d13 Fix shr.el/image build problem
Fixes: bug#24035

* lisp/net/shr.el: Require image, since some builds seem to
break without it (bug#24035).
2016-07-20 16:47:47 +02:00
Lars Magne Ingebrigtsen
1bd7455497 Fix the prefix action of shr-copy-url
* lisp/net/shr.el (shr-copy-url): Make the command really copy
the image url if given a prefix.
2016-06-27 22:26:02 +02:00
Lars Ingebrigtsen
f2b16e4472 :max-width/height fixes for shr after the scaling changes
* lisp/net/shr.el (shr-rescale-image): Ensure that we respect
max-width and max-height even after the scaling changes done
earlier this year.
2016-05-14 22:57:53 +02:00
Lars Ingebrigtsen
73071b4cdb Support srcset in <img>
* lisp/net/shr.el (shr--preferred-image): Allow <img> tags
with srcset specifiers (bug#23459).
2016-05-12 17:45:27 +02:00
Lars Ingebrigtsen
43bb4305c5 (shr-rescale-image): Clarify logic slightly
* lisp/net/shr.el (shr-rescale-image): Clarify logic slightly.
2016-05-03 17:27:04 +02:00
Lars Magne Ingebrigtsen
2a28ba3db9 Use Unicode literals instead of hex values
* lisp/net/shr.el (shr-tag-bdo): Use Unicode literals instead
of hex values for greater readability.
(shr-tag-bdi): Ditto.
2016-04-24 14:13:22 +02:00
Lars Magne Ingebrigtsen
7570b35740 (shr-insert): Respect non-breaking space in non-<pre> text
* lisp/net/shr.el (shr-insert): Respect non-breaking space in
non-<pre> text.
2016-03-25 16:57:35 +01:00
Lars Magne Ingebrigtsen
78bcd42857 Further empty <li> tweaks
* lisp/net/shr.el (shr-tag-li): When showing several empty
<li> elements, ensure that they really get inserted on a new line.
2016-03-20 15:15:32 +01:00
Lars Magne Ingebrigtsen
61b2e837d8 Don't remove too much white space at the end of documents
* lisp/net/shr.el (shr--remove-blank-lines-at-the-end): Don't
remove too much white space -- leave it on the last line (in
case there's a background color).
2016-03-20 14:47:30 +01:00
Lars Magne Ingebrigtsen
8a35f83c6c Render empty <ul><li><ul> correctly
* lisp/net/shr.el (shr-tag-ul): Render empty <ul><li><ul>
correctly (bug#22964).
(cherry picked from commit 4f6ea3988b)

Backport:
2016-03-20 13:58:26 +01:00
Lars Magne Ingebrigtsen
d8b2ce5f8a Ignore invalid base64 encoded embedded images
* lisp/net/shr.el (shr-image-from-data): Ignore invalid base64
encoded embedded images (bug#22928).
(cherry picked from commit f2da80d0e1)

Backport:
2016-03-20 13:58:04 +01:00
Lars Magne Ingebrigtsen
f2da80d0e1 Ignore invalid base64 encoded embedded images
* lisp/net/shr.el (shr-image-from-data): Ignore invalid base64
encoded embedded images (bug#22928).
2016-03-20 13:57:11 +01:00
Lars Magne Ingebrigtsen
4f6ea3988b Render empty <ul><li><ul> correctly
* lisp/net/shr.el (shr-tag-ul): Render empty <ul><li><ul>
correctly (bug#22964).
2016-03-20 13:52:36 +01:00
Lars Magne Ingebrigtsen
52ba24bdd9 Fix <p> and <div> newlines with or without <li> in shr
* lisp/net/shr.el (shr-ensure-newline): Respect that we're in
a <li>, if we are, and don't insert newlines there.
(shr-ensure-paragraph): When mixing newlines and paragraph
ensurements, don't insert too many blank lines.
(shr-tag-div): A <div> shouldn't introduce a paragraph, but a
new line.
(cherry picked from commit 292921faca)

Backport:
2016-03-20 13:45:09 +01:00
Lars Magne Ingebrigtsen
292921faca Fix <p> and <div> newlines with or without <li> in shr
* lisp/net/shr.el (shr-ensure-newline): Respect that we're in
a <li>, if we are, and don't insert newlines there.
(shr-ensure-paragraph): When mixing newlines and paragraph
ensurements, don't insert too many blank lines.
(shr-tag-div): A <div> shouldn't introduce a paragraph, but a
new line.
2016-03-20 13:43:42 +01:00
Lars Magne Ingebrigtsen
c688c44ddf Remove code left over from when overlays were used for padding
* lisp/net/shr.el (shr-previous-newline-padding-width): Remove.
(shr-remove-trailing-whitespace): Ditto.
(shr-insert-document): Don't call them.
2016-03-20 12:54:24 +01:00
Lars Magne Ingebrigtsen
35d58020b6 Remove trailing blank lines in shr
* lisp/net/shr.el (shr--remove-blank-lines-at-the-end): New function.
(shr-insert-document): Use it to remove trailing blank lines
at the end of documents, since these never seem to be very useful.
2016-03-20 12:52:28 +01:00
Eli Zaretskii
32a4d2ee2c Update handling of <bdo> per Unicode 9.0
* lisp/net/shr.el (shr-tag-bdo): Wrap in FSI..PDI as well, per
Unicode 9.0 changes in UAX#9, paragraph 2.7.
2016-03-12 18:35:26 +02:00
Alain Schneble
887f6126c5 Fix issue of inserting images on some systems
* lisp/net/shr.el (shr-tag-img): Construct a non-empty range
to pass to shr-image-fetched, to indicate where to insert the
image.  Fixes the issue introduced with commit
80852f843e
(bug#22789).
2016-03-03 05:31:11 +00:00
Lars Ingebrigtsen
3dd82d7501 Support <bdo> and <bdi>
* lisp/net/shr.el (shr-tag-bdo): New function.
(shr-tag-bdi): Ditto.
2016-03-01 11:19:52 +11:00
Lars Ingebrigtsen
fc819ea94e Respect <html dir=auto>
* lisp/net/shr.el (shr-tag-html): Respect the "auto"
directional HTML setting.
2016-03-01 10:48:36 +11:00
Lars Ingebrigtsen
dc42d0ca0b Use the correct background color when filling nested <divs>
* lisp/net/shr.el (shr-face-background): Return the first
background, because that's the one that's visible (bug#22680).

Backport:

(cherry picked from commit cad0bc7055)
2016-02-29 22:21:30 +11:00
Lars Ingebrigtsen
cad0bc7055 Use the correct background color when filling nested <divs>
* lisp/net/shr.el (shr-face-background): Return the first
background, because that's the one that's visible (bug#22680).
2016-02-29 22:21:11 +11:00
Lars Ingebrigtsen
9781dc4da3 Make <div> in <li> not insert extra newlines
* lisp/net/shr.el (shr-tag-div): Make <div> in <li> not insert
extra newlines (bug#19587).

Backport:

(cherry picked from commit 379a846b85)
2016-02-29 18:06:59 +11:00
Lars Ingebrigtsen
379a846b85 Make <div> in <li> not insert extra newlines
* lisp/net/shr.el (shr-tag-div): Make <div> in <li> not insert
extra newlines (bug#19587).
2016-02-29 18:06:36 +11:00
Lars Ingebrigtsen
bb2ab2fbcc Move o' to O' in shr-map
* lisp/net/shr.el (shr-map): `shr-save-contents' has moved
from `o' to `O' to avoid collisions with `image-map'.
2016-02-24 18:07:49 +11:00
Lars Ingebrigtsen
3007b422b6 Rework the image property getter/setters
* doc/lispref/display.texi (Defining Images): Document the
renamed `image-get/set-property' functions.

* lisp/image.el (image--set-property): Rename from
image-set-property.
(image-property): Declare a setf form.
(image-property): Rename from `image-get-property'.
2016-02-22 12:50:40 +11:00
Lars Ingebrigtsen
1ba50a0d8c Add a frame around the placeholder image in shr
* lisp/net/shr.el (shr-make-placeholder-image): Add a frame
around the image.
2016-02-20 18:48:40 +11:00
Lars Ingebrigtsen
80852f843e Use placeholder images in shr to avoid text moving around
* lisp/net/shr.el (shr-rescale-image): Pass in width/height
from the HTML.
(shr-tag-img): Ditto.
(shr-string-number): New function.
(shr-make-placeholder-image): Make placeholder images.
(shr-tag-img): Insert them if we have SVG support.
2016-02-20 18:03:37 +11:00
Lars Ingebrigtsen
395f2ad689 Don't use image-map if it isn't defined
* lisp/net/shr.el (shr-image-map): Only use image-map as a
parent if it's defined (bug#22614).
2016-02-11 14:51:49 +11:00
Wolfgang Jenkner
e0775d7f7f * lisp/net/shr.el (image-map): Defvar it. (Bug#22614) 2016-02-10 16:34:12 +01:00
Lars Ingebrigtsen
211cdd3ff2 Allow accessing the image commands via shr
* lisp/gnus/mm-decode.el (mm-convert-shr-links): Allow
accessing the image commands.

* lisp/net/shr.el (shr-image-map): New map used for images.
(shr-urlify): Don't overwrite image maps when applying URL maps.
2016-02-10 12:56:21 +11:00