Commit graph

257 commits

Author SHA1 Message Date
Basil L. Contovounesios
4a754df885 ; * lisp/net/shr.el (shr-selected-link): Doc fix. 2019-07-04 19:22:59 +01:00
Nick Drozd
c4bfb5dfab Handle 'code' tag in shr.el
* etc/NEWS: Announce change in shr behavior (bug#36247).
* lisp/net/shr.el: Add 'code' tag handling.
2019-06-23 19:07:43 +02:00
Lars Ingebrigtsen
2d71e68428 Restore image scaling support when there's no native image scaling
* lisp/net/shr.el (shr--image-type): New function.
(shr-rescale-image): Use it to allow image scaling on Emacsen with
ImageMagick support that does not have native image scaling support.
2019-06-12 19:00:43 +02:00
Lars Ingebrigtsen
bc0adf112d Make shr-rescale-image respect get-buffer-window again
* lisp/net/shr.el (shr-rescale-image): Partially revert previous
change -- ressurrect the check for `get-buffer-window'.
2019-05-16 13:38:11 +02:00
Lars Ingebrigtsen
e3fbe04cbc Make image scaling work without imagemagick support in eww
* lisp/net/shr.el (shr-rescale-image): Emacs has native image
scaling now, so images can be rescaled without imagemagick
support.
2019-05-15 02:53:56 +02:00
Lars Ingebrigtsen
3de3452014 Add a comment about the previous shr change 2019-05-13 15:10:33 -04:00
Lars Ingebrigtsen
648a52ae69 Fix problems in shr when indenting tables
* lisp/net/shr.el (shr-mark-fill, shr-insert-table): Fix problems
when block-quoting/<li>-ing a table -- the indentation/prefix was
inserted twice (bug#32277).
2019-05-13 15:04:46 -04:00
Nicholas Drozd
8282c34f0f Handle HTML 'ol' start attribute in shr.el
* lisp/net/shr.el (shr-tag-ol): Don't automatically assume
1-indexing for all ordered lists, use <ol> if given.

* etc/NEWS: Announce change in shr behavior.

* test/data/shr/ol.html:
* test/data/shr/ol.txt: New test data files.
2019-02-22 09:52:57 +02:00
Paul Eggert
ba809612c0 Merge from origin/emacs-26
2fcf2df Fix copyright years by hand
26bed8b Update copyright year to 2019
2814292 Fix value of default frame height.  (Bug#33921)
2018-12-31 17:57:29 -08:00
Paul Eggert
26bed8ba10 Update copyright year to 2019
Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
2019-01-01 01:01:13 +00:00
Glenn Morris
6aa93b45af Merge from origin/emacs-26
1908173 (origin/emacs-26) Fix Bug#32828
7f5086d * lisp/net/shr.el (shr-copy-url): Fix docstring.
d309994 Fix typos in documentation
25cdd65 ; Spellcheck two more documentation strings
c8bda05 ; * lisp/simple.el (save-interprogram-paste-before-kill): Fix...
dc7fdee * doc/emacs/kmacro.texi (Basic Keyboard Macro): Mention old b...
17766a1 Improve docs of functions/variables related to 'display-buffer'
a363931 * lisp/mouse.el (tear-off-window): Fix non-mouse use (bug#32799)
8b8a4c0 Improve documentation of directory-local variables
c9c9756 Don't use obsolete variable 'save-place' in documentation
ca208e8 Use save-place-mode instead of save-place
2018-09-28 07:54:24 -07:00
Noam Postavsky
7f5086da05 * lisp/net/shr.el (shr-copy-url): Fix docstring. 2018-09-27 19:37:25 -04:00
Noam Postavsky
0250d22eeb shr: Allow skipping tags with aria-hidden (Bug#32348)
* lisp/net/shr.el (shr-discard-aria-hidden): New option.
(shr-descend): Suppress aria-hidden=true tags if it's set.
* doc/misc/eww.texi (Advanced): Document shr-discard-aria-hidden.
* etc/NEWS: Announce it.
2018-08-27 19:16:47 -04:00
Lars Ingebrigtsen
94d60f59fc Don't have shr bug out on degenerate <img> tags
* lisp/net/shr.el (shr-tag-img): Protect against contructs like
<img src=" ">.
2018-06-11 20:38:53 +02:00
Basil L. Contovounesios
f10fa789ca Set :version of shr faces
* lisp/net/shr.el (shr-strike-through, shr-link, shr-selected-link):
Set :version tag (bug#31200).
2018-04-17 21:46:26 +02:00
Lars Ingebrigtsen
d742d4ca2e shr doc string fix
* lisp/net/shr.el (shr-strike-through, shr-link)
(shr-selected-link): Doc string fix.
2018-04-17 21:43:34 +02:00
Basil L. Contovounesios
3dfec182d2 Modernise face specs and set version tags in eww/shr
* lisp/net/shr.el (shr-strike-through, shr-link, shr-selected-link):
Set :version tag (bug#31200).

* lisp/net/eww.el (eww-form-text, eww-form-textarea):
* lisp/net/shr.el (shr-strike-through, shr-link, shr-selected-link):
Use (DISPLAY . PLIST) face spec syntax as recommended in
'(elisp) Defining Faces'.
2018-04-17 21:42:04 +02:00
Lars Ingebrigtsen
d12800303f Tweak shr window width computation
* lisp/net/shr.el (shr-insert-document): The computation of the
window width is apparently one pixel too wide for the shr line
folding algorithm (bug#31196).
2018-04-17 20:34:12 +02:00
Lars Ingebrigtsen
950d6cc744 Reimplement shr-next-link' and shr-previous-link'
* lisp/net/shr.el (shr-next-link): Use
`text-property-search-forward'.
(shr-previous-link): Use `text-property-search-backward'.
2018-04-17 18:53:23 +02:00
Lars Ingebrigtsen
60ec0c7960 Query the user whether to increase stack depth in shr
* lisp/net/shr.el (shr-insert-document): Bind `max-specpdl-size'
here... (bug#30675).
(shr-descend): So that we can increase it temporarily here if the
user wants to.
2018-04-15 19:01:32 +02:00
Lars Ingebrigtsen
a5f2403cc2 Avoid an infloop in shr filling when not using fonts
* lisp/net/shr.el (shr-fill-line): If we have an indentation
that's wider than the width of what we're trying to fill, just
give up.  This avoids an infloop when `shr-use-fonts' in nil.
2018-04-15 15:17:15 +02:00
Lars Ingebrigtsen
196dc887d8 Further shr line folding/link continuation tweaks
* lisp/net/shr.el (shr-fill-line): Tweak the link continuations
further when folding lines.
2018-04-14 22:38:53 +02:00
Lars Ingebrigtsen
7e012d0384 Tweak shr link text property adjustments when folding
* lisp/net/shr.el (shr-fill-line): If a link starts at the first
word on a new folded line, then don't copy the link properties to
the newline inserted.
2018-04-14 21:11:05 +02:00
Lars Ingebrigtsen
bdc2453fe8 Tweak the fonts applied to shr indentation
* lisp/net/shr.el (shr-fill-line): Don't use fonts (especially
link fonts) over indentation, because that's ugly..
2018-04-13 22:27:21 +02:00
Lars Ingebrigtsen
712607b05a Fix bug in shr-urlify introduced in previous patch
* lisp/net/shr.el (shr-urlify): Not all URLs have domains, so
check for that before doing IDNA.
2018-04-13 18:35:07 +02:00
Lars Ingebrigtsen
b1943e84bc Make shr support inline <div>s
* lisp/net/shr.el (shr-tag-div): Support display: inline; for
<div>, since that's a very common thing (bug#25588).
2018-04-13 17:30:59 +02:00
Lars Ingebrigtsen
c194be368c Notify the user a bit more before clicking IDNA links
* lisp/net/shr.el (shr-urlify): Show the puny-encoded domain name
in the mouseover string (bug#25600).
2018-04-13 17:11:07 +02:00
Lars Ingebrigtsen
4f4c7b8083 When opening external links in eww, blink the link
* lisp/net/eww.el (eww-follow-link): Ditto.

* lisp/net/shr.el (shr-selected-link): New face (bug#25096).
(shr--blink-link): New function to blink links.
(shr--current-link-region): New utility function.
(shr-browse-url): Use it to blink external links.

Blinking the link allows the user to get immediate feedback that the
action has been performed.  Opening the external browser may take a
while, and may not be obvious that is going on.
2018-04-13 14:17:51 +02:00
Lars Ingebrigtsen
dd0d2e0fdd <label> shouldn't introduce a line break
* lisp/net/shr.el (shr-tag-label): Remove so that labels don't
break lines (because they shouldn't: They're usually part of a
selection interface) (bug#30557).
2018-04-13 01:51:56 +02:00
Glenn Morris
d46811eeb5 Merge from origin/emacs-26
af1624f * lisp/net/shr.el (shr-browse-url): Doc fix.  (Bug#30957)
3a451bd ; * doc/emacs/msdos.texi: Fix wording of last change.
3bc1e2f Mention `key-description' as inverse of `kbd' (Bug#30942)
e50196e Document return value of pcase (Bug#30425)
8a2466f * doc/emacs/macos.texi: Tweak grammar and capitalization.
9db62bf Distinguish free from non-free OSes
ff49d86 * doc/emacs/misc.texi (Amusements): Avoid non-printing charac...
5bab671 Fix xrefs in pdf Emacs manual
2018-04-01 07:50:39 -07:00
Eli Zaretskii
af1624f29b * lisp/net/shr.el (shr-browse-url): Doc fix. (Bug#30957) 2018-04-01 12:09:54 +03:00
Glenn Morris
dfea6d5a4a Quieten cl-lib related compiler warnings
* lisp/completion.el (cl-set-difference):
* lisp/files.el (map-merge-with, map-merge):
* lisp/emacs-lisp/radix-tree.el (map-apply): Declare.
* lisp/emacs-lisp/thunk.el: Load cl-lib at run-time, not
cl-macs at compile.
* lisp/gnus/gnus-group.el: Load cl-lib at run-time, not cl at compile.
* lisp/emacs-lisp/checkdoc.el, lisp/emacs-lisp/package.el
* lisp/gnus/gnus-sum.el, lisp/gnus/message.el, lisp/net/shr.el:
Load cl-lib at run-time.
* lisp/gnus/mml-sec.el (mml-signencrypt-style)
(mml-secure-cust-record-keys): Replace cl with cl-lib,
and load it at run-time.
* lisp/cedet/ede/linux.el, lisp/vc/vc-hg.el: Reorder requires.
2018-03-22 21:40:24 -07:00
Paul Eggert
5c7dd8a783 Update copyright year to 2018
Run admin/update-copyright.
2018-01-01 00:57:59 -08:00
Katsumi Yamaoka
a5b0a4e292 * lisp/net/shr.el (shr-string-pixel-width): Return pixel-width,
not position (bug#29734).
2017-12-18 02:53:26 +00:00
Eli Zaretskii
f274cbd185 Avoid reordering of output in 'shr-insert-document'
* lisp/net/shr.el (shr-string-pixel-width): Preserve point across
shr-pixel-column invocations.  (Bug#29734)
2017-12-16 16:09:41 +02:00
Glenn Morris
f5d0360234 Escape column-zero doc parens
* lisp/htmlfontify.el (hfy-display-class):
* lisp/calendar/icalendar.el (icalendar--do-create-ical-alarm):
* lisp/net/shr.el (shr-external-rendering-functions):
* lisp/progmodes/cc-vars.el (c-asymmetry-fontification-flag):
* lisp/textmodes/tildify.el (tildify-tildify):
Escape column-zero doc parens.  A shame bug#21871 remains unfixed.
2017-12-12 23:18:35 -08:00
Lars Ingebrigtsen
4b06af0643 Allow shr to use data: URLs without encoding
* lisp/net/shr.el (shr-image-from-data): Don't bug out on
image data: URLs that have no base64 encoding like
(shr-image-from-data
"text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E").
2017-12-03 23:49:56 +01:00
Eli Zaretskii
3198a1646e Avoid jumbled order in HTML rendered by shr.el
* lisp/net/shr.el (shr-render-td): Preserve point, as
shr-render-td-1 might move it as a side effect of
save-window-excursion.  (Bug#29348)
2017-11-25 13:31:51 +02:00
Katsumi Yamaoka
7d32176acc Fix the bug#24034 change (revno 9eb028f) causing infloop (bug#29047)
* lisp/net/shr.el (shr-fill-line): Copy only face and image-displayer
properties to gaps (bug#29047).
2017-10-30 23:30:19 +00:00
Glenn Morris
5b59841791 Fix doc typos
* lisp/simple.el (line-move-ignore-invisible):
* lisp/sort.el (sort-regexp-fields):
* lisp/cedet/ede.el (project-add-file):
* lisp/gnus/message.el (message-bogus-recipient-p):
* lisp/international/mule.el (define-coding-system):
* lisp/progmodes/ebrowse.el (ebrowse-member-buffer-object-menu):
* lisp/progmodes/xscheme.el (xscheme-allow-output-p)
(scheme-interaction-mode, scheme-debugger-mode)
(xscheme-yank-pop, xscheme-yank-push): Doc fixes.
2017-10-28 17:10:25 -07:00
Eli Zaretskii
e5bff696bc Revert last change in 'shr-descend'
* lisp/net/shr.el (shr-descend): Revert the part of the last
change which introduced calls to shr-indirect-call into this
function.  Add a comment explaining the rationale for that.
(Bug#28402)
2017-10-06 15:42:22 +03:00
Vasilij Schneidermann
e3f4b71c9d Support indirection for all shr-tag-* calls
The 'shr-external-rendering-functions' variable was previously only
honored in the shr-descend function, now all direct calls to the
shr-tag-* functions have been replaced by a call to
'shr-indirect-call' which tries using an alternative rendering
function first.

* lisp/net/shr.el (shr-indirect-call): New helper function.
(shr-descend, shr-tag-object, shr-tag-video):
(shr-collect-extra-strings-in-table): Fix callers to call via
shr-indirect-call.  (Bug#28402)
2017-10-05 13:00:13 +03:00
Paul Eggert
bc511a64f6 Prefer HTTPS to FTP and HTTP in documentation
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November.  Change these FTP URLs to https://ftp.gnu.org
instead.  Make similar changes for URLs to other organizations moving
away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
2017-09-13 15:54:37 -07:00
Mark Oteiza
370d0e7aa7 Update uses of if-let and when-let
* lisp/dom.el (dom-previous-sibling):
* lisp/emacs-lisp/package.el (package--with-work-buffer):
(package--sort-deps-in-alist, package--sort-by-dependence):
(package-install-from-archive, package-install):
(package-menu-execute, package-menu--populate-new-package-list):
* lisp/filenotify.el (file-notify--rm-descriptor):
(file-notify--event-watched-file, file-notify--event-file-name):
(file-notify--event-file1-name, file-notify-rm-watch):
(file-notify-valid-p):
* lisp/gnus/message.el (message-toggle-image-thumbnails):
* lisp/gnus/nnimap.el (nnimap-request-move-article):
* lisp/ibuf-ext.el (ibuffer-repair-saved-filters):
* lisp/mpc.el (mpc-format):
* lisp/net/eww.el (eww-tag-meta, eww-process-text-input):
(eww-save-history):
* lisp/net/shr.el (shr-tag-base, shr-tag-object, shr-make-table-1):
* lisp/progmodes/prog-mode.el (prettify-symbols--post-command-hook):
* lisp/svg.el (svg-remove):
* lisp/textmodes/css-mode.el (css--named-color):
(css--colon-inside-funcall):
* lisp/textmodes/sgml-mode.el (html-current-buffer-classes):
(html-current-buffer-ids): Use if-let* and when-let* instead.
2017-09-12 13:18:10 -04:00
Grégoire Jadi
fe25d0ce8e Ensure that we parse images right in shr.el
* lisp/net/shr.el (shr-image-fetched): Go back to the
beginning of the buffer before trying to parse the image
fetched.
2017-07-24 17:29:28 +02:00
Lars Ingebrigtsen
e33ddda3bf Fix image/svg+xml display in shr
* lisp/net/shr.el (shr-put-image): Display svg images as svg
(bug#27799).  I suspect the previous change was checked in by
accident in conjuction with some other svg changes.
2017-07-23 15:23:14 +02:00
Noam Postavsky
1b4f0a92ff Split shr-copy-url dwim behavior into separate functions (Bug#26826)
* lisp/net/shr.el (shr-url-at-point, shr-probe-url)
(shr-probe-and-copy-url, shr-maybe-probe-and-copy-url): New functions,
split out from `shr-copy-url'.
(shr-copy-url): Only copy the url, don't fetch it.
(shr-map): Bind 'w' and 'u' to `shr-maybe-probe-and-copy-url', which
has the same behavior as the old `shr-copy-url'.
* etc/NEWS: Announce changes.
2017-07-02 16:19:58 -04:00
Glenn Morris
18896f7913 * lisp/net/shr.el (shr-fill-text): Actually fill the text. (Bug#27399) 2017-06-22 14:11:29 -04:00
Stefan Monnier
a8d0a91841 * lisp/net/shr.el: Use cl-lib instead of cl. 2017-05-23 09:09:28 -04:00
Glenn Morris
0f83433946 Avoid unnecessary loading of subr-x at run-time
* lisp/doc-view.el, lisp/filenotify.el, lisp/info-look.el:
* lisp/svg.el, lisp/emacs-lisp/byte-opt.el, lisp/net/shr.el:
* lisp/textmodes/sgml-mode.el, test/lisp/dom-tests.el:
No need to load subr-x at run-time.
* lisp/gnus/nnheader.el: No need to load subr-x.
; * lisp/emacs-lisp/subr-x.el, lisp/gnus/message.el, lisp/net/nsm.el:
; Comments.
2017-04-18 19:07:28 -04:00