Andreas Schwab
ecccdc07a0
shr: allow moving between adjacent anchors
...
* lisp/net/shr.el (shr-urlify): Put shr-tab-stop only over first
position.
2023-05-22 13:13:29 +02:00
Andreas Schwab
b7023da662
Make image-map bindings available on image links
...
* lisp/net/shr.el (shr-map): Move shr-browse-image to "M-i".
* lisp/net/eww.el (eww-image-link-keymap): Use shr-image-map.
2023-04-15 13:17:50 +02:00
Eli Zaretskii
cae528457c
; Add 2023 to copyright years.
2023-01-01 05:31:12 -05:00
Lars Ingebrigtsen
fde23c6e74
Fix (thing-at-point 'url) in eww forms
...
* lisp/net/eww.el (eww-tag-input): Don't claim to have an URL here
(bug#58091).
* lisp/net/shr.el (shr-next-link, shr-previous-link): Search for
shr-tab-stop instead of shr-url so that we can be more general.
(shr-urlify): Mark all links as tabbable-to.
2022-09-26 15:16:16 +02:00
Mattias Engdegård
60102016e4
Abolish max-specpdl-size (bug#57911)
...
The max-lisp-eval-depth limit is sufficient to prevent unbounded stack
growth including the specbind stack; simplify matters for the user by
not having them to worry about two different limits. This change
turns max-specpdl-size into a harmless variable with no effects,
to keep existing code happy.
* lisp/subr.el (max-specpdl-size):
Define as an ordinary (but obsolete) dynamic variable.
* admin/grammars/Makefile.in:
* doc/lispintro/emacs-lisp-intro.texi (Loops & Recursion):
* doc/lispref/control.texi (Cleanups):
* doc/lispref/edebug.texi (Checking Whether to Stop):
* doc/lispref/eval.texi (Eval):
* doc/lispref/variables.texi (Local Variables):
* doc/misc/calc.texi (Recursion Depth):
Update documentation.
* etc/NEWS: Announce.
* src/eval.c
(FletX): Use safe iteration to guard against circular bindings list.
(syms_of_eval): Remove old max-specpdl-size definition.
(init_eval_once, restore_stack_limits, call_debugger)
(signal_or_quit, grow_specpdl_allocation):
* leim/Makefile.in:
* lisp/Makefile.in:
* lisp/calc/calc-stuff.el (calc-more-recursion-depth)
(calc-less-recursion-depth):
* lisp/calc/calc.el (calc-do):
* lisp/cedet/semantic/ede-grammar.el (ede-proj-makefile-insert-rules):
* lisp/cedet/semantic/grammar.el (semantic-grammar-batch-build-one-package):
* lisp/cus-start.el (standard):
* lisp/emacs-lisp/comp.el (comp--native-compile):
* lisp/emacs-lisp/edebug.el (edebug-max-depth):
(edebug-read-and-maybe-wrap-form, edebug-default-enter):
* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
* lisp/eshell/esh-mode.el (eshell-mode):
* lisp/loadup.el (max-specpdl-size):
* lisp/mh-e/mh-e.el (mh-invisible-headers):
* lisp/net/shr.el (shr-insert-document, shr-descend):
* lisp/play/hanoi.el (hanoi-internal):
* lisp/progmodes/cperl-mode.el:
* src/fileio.c (Fdo_auto_save):
Remove references to and modifications of max-specpdl-size.
2022-09-19 19:30:03 +02:00
Lars Ingebrigtsen
c2c4c89dbc
Also use eww URL transformers in the actual links
...
* lisp/net/eww.el (eww-mode): Use it to transform URLs
(bug#57796).
* lisp/net/shr.el (shr-url-transformer): New variable.
(shr-tag-a): Use it.
2022-09-14 15:17:58 +02:00
Lars Ingebrigtsen
280b40cd8a
Enable undo in eww buffers
...
* lisp/net/eww.el (eww-render): Enable undo after rendering. This
allows using `undo' in text input boxes.
(eww-setup-buffer): Disable undo before rendering (bug#57750).
* lisp/net/shr.el (shr-image-fetched): Inhibit undo tracking.
2022-09-13 14:33:20 +02:00
Lars Ingebrigtsen
e00f882905
Don't bug out in src when there's no srcset
...
* lisp/net/shr.el (shr--preferred-image): Don't bug out when
there's no srcset.
2022-07-23 07:46:52 +02:00
Lars Ingebrigtsen
2ebede7d75
Fix srcset parsing in shr
...
* lisp/net/shr.el (shr--preferred-image): Factor out srcset
parsing for easier testing.
(shr--parse-srcset): Don't misparse URLs with commas in them.
2022-07-23 07:43:45 +02:00
Stefan Kangas
4e79f77635
Merge from origin/emacs-28
...
5e47ec9511
; * lisp/url/url-http.el (url-http-parse-headers): Fix typo.
ba0871bef1
; Fix typos: prefer American spelling
e3e7f31faa
Adapt Tramp doc
# Conflicts:
# etc/NEWS
# etc/themes/modus-themes.el
# lisp/emacs-lisp/byte-opt.el
# test/lisp/so-long-tests/spelling-tests.el
2022-07-14 11:37:42 +02:00
Stefan Kangas
ba0871bef1
; Fix typos: prefer American spelling
2022-07-13 13:04:22 +02:00
Stefan Kangas
cbfd959e26
Prefer keymap inheritance in shr-image-map
...
* lisp/net/shr.el (shr-image-map): Replace copy-keymap with
inheritance.
2022-07-07 23:21:39 +02:00
Lars Ingebrigtsen
474f5b21b4
Add support for <mark> in shr
...
* lisp/net/shr.el (shr-mark): New face (bug#48211).
(shr-tag-mark): New function
2022-07-01 13:45:52 +02:00
Lars Ingebrigtsen
3833ce16af
Fix shr--set-target-ids test for empty buffer
...
* lisp/net/shr.el (shr--set-target-ids): Fix the check for an
empty buffer (which may be narrowed).
2022-06-21 20:51:46 +02:00
Lars Ingebrigtsen
c0c538b392
Speed up shr-string-pixel-width
...
* lisp/net/eww.el (eww-update-header-line-format): Use
string-pixel-width (since we don't care about shr-use-fonts here).
* lisp/net/shr.el (shr-string-pixel-width): Use
`string-pixel-width', which should be faster.
2022-06-17 13:49:10 +02:00
Eli Zaretskii
5eb9383ccc
Fix disruption of windows' display by shr.el
...
* src/window.c (struct saved_window): New member 'vscroll'.
(Fset_window_configuration, save_window_save): Save and restore
the window's vscroll value.
* lisp/net/shr.el (shr-insert-document): Restore the original
window's hscroll, in case we are rendering in a window other than
where the document will be eventually displayed. This avoids
resetting hscroll of windows we use temporarily for shr's
rendering job. (Bug#56008)
2022-06-16 19:53:45 +03:00
Valenoern
f65536015b
Support html template tag in shr
...
* lisp/net/shr.el: Add shr-tag-template as a dummy tag.
Copyright-paperwork-exempt: yes
2022-05-28 12:43:20 +02:00
Lars Ingebrigtsen
9c248f4cd9
Fix retrieving images that contain ) characters in shr
...
* lisp/net/shr.el (shr-save-contents, shr-get-image-data): Don't call.
(shr-encode-url): Make obsolete. (This function makes no sense.)
(shr-tag-img): Don't call.
2022-05-12 14:07:45 +02:00
Lars Ingebrigtsen
bd5d136777
Add a new face shr-code
...
* lisp/net/shr.el (shr-code): New face (bug#54480).
(shr-tag-code): Use it.
2022-03-21 16:01:33 +01:00
Lars Ingebrigtsen
5649b45323
Fix compilation warning introduced by previous shr.el change
...
* lisp/net/shr.el (url-file): Fix compilation warning.
2022-02-20 16:14:49 +01:00
Lars Ingebrigtsen
3a6129e723
Make eww work better on Tramp HTML
...
* lisp/net/eww.el (eww-open-file): Use it.
(eww-browse-url): Ditto.
* lisp/net/shr.el (shr-expand-url): Allow loading relative Tramp
files if we're reading from a file:// document.
* lisp/url/url-file.el (url-allow-non-local-files): New user option
(bug#40425).
2022-02-20 16:14:05 +01:00
Lars Ingebrigtsen
a0e6e67ac1
Fix HTML target marking in shr
...
* lisp/net/shr.el (shr-descend): Use a marker (because we may be
altering the text later for indentation), and mark the start, not
the end of the tag (bug#53409).
(shr-tag-a): Ditto.
2022-01-22 13:14:43 +01:00
Lars Ingebrigtsen
55c1670bc5
Rename the textsec-check function to textsec-suspicious-p
...
* lisp/net/shr.el (shr-tag-a):
* lisp/international/textsec-check.el (textsec-suspicious-p):
* lisp/gnus/message.el (message-send-mail):
* lisp/gnus/gnus-art.el (article--check-suspicious-addresses):
* etc/NEWS (like):
* doc/lispref/text.texi (Suspicious Text):
(Suspicious Text): Rename the textsec-check function to
textsec-suspicious-p.
2022-01-20 14:33:36 +01:00
Lars Ingebrigtsen
e58b4b24cf
Add text for suspicious links
...
* lisp/international/textsec-check.el (textsec-check): Note `link'.
(textsec-propertize): Fix typo.
* lisp/international/textsec.el (textsec-link-suspicious-p): New
function.
* lisp/net/shr.el (shr-tag-a): Check for sus links.
2022-01-19 17:50:21 +01:00
Lars Ingebrigtsen
9e9d83482c
Don't overwrite the link text in shr-tag-a for suspicious URLs
...
* lisp/net/shr.el (shr-tag-a): Tweak how the suspiciousness
warning is handled.
2022-01-19 17:17:49 +01:00
Lars Ingebrigtsen
1bfc086391
Make shr mark links with suspicious URLs
...
* lisp/international/textsec-check.el (textsec-propertize): New
function.
(textsec-check): Only check, don't alter STRING.
* lisp/international/textsec.el (textsec-url-suspicious-p): New
function.
* lisp/net/shr.el (shr-tag-a): Mark suspicious links.
2022-01-19 16:37:05 +01:00
Eli Zaretskii
dcd76bd48d
Merge from origin/emacs-28
...
836be7a112
; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a
* lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65
; Minor fixes related to copyright years
23c1ee6989
; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89
* src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5
; Add 2022 to copyright years.
# Conflicts:
# etc/NEWS
# etc/refcards/ru-refcard.tex
# lib/cdefs.h
# lisp/erc/erc-dcc.el
# lisp/erc/erc-imenu.el
# lisp/erc/erc-replace.el
# lisp/image-dired.el
# lisp/progmodes/xref.el
# m4/alloca.m4
# m4/byteswap.m4
# m4/errno_h.m4
# m4/getopt.m4
# m4/gnulib-common.m4
# m4/inttypes.m4
# m4/stddef_h.m4
# m4/stdint.m4
# m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5
; Add 2022 to copyright years.
2022-01-01 02:45:51 -05:00
Lars Ingebrigtsen
b9015606d1
Simplify whitespace stripping in shr-expand-url
...
* lisp/net/shr.el (shr-expand-url): Simplify whitespace stripping.
2021-12-24 10:23:35 +01:00
Stefan Kangas
6a17bb4879
Merge from origin/emacs-28
...
04be23f19f
Improve Xref documentation
edb1d491d9
* lisp/net/shr.el (shr-expand-url): Also strip trailing wh...
2021-12-24 06:30:41 +01:00
Andreas Schwab
edb1d491d9
* lisp/net/shr.el (shr-expand-url): Also strip trailing
...
whitespace.
2021-12-23 19:07:49 +01:00
Lars Ingebrigtsen
7904cae492
Rework how shr sets <span id='foo'> targets to make it more reliable
...
* lisp/net/eww.el (eww-display-html): The target is now a list.
* lisp/net/shr.el (shr--link-targets): New variable.
(shr-insert-document): Set the targets.
(shr-descend): Save targets and apply them later.
(shr-ensure-paragraph): Remove hack to avoid filling from removing
targets.
(shr-tag-a): Save targets for later.
(shr-render-td-1): Bind and set targets (bug#52512).
2021-12-19 13:44:21 +01:00
LdBeth
276fd48176
Add a shr-allowed-images user option
...
* lisp/net/shr.el (shr-allowed-images): New variable (bug#52594).
(shr-image-is-blocked): New function to use it.
(shr-tag-img): Use it.
* doc/misc/eww.texi (Advanced): Document it.
Copyright-paperwork-exempt: yes
2021-12-19 12:26:15 +01:00
Stefan Kangas
b331819302
Merge from origin/emacs-28
...
5708da48d1
Revert "Make `M-x run-python' select the window again"
aa2872a127
Make `M-x run-python' select the window again
c8e19b3a84
Don't bug out on certain empty elements with ids
2021-12-11 06:56:31 +01:00
Lars Ingebrigtsen
c8e19b3a84
Don't bug out on certain empty elements with ids
...
* lisp/net/shr.el (shr-descend): Fix empty-element #id targetting
(bug#52391).
2021-12-10 12:47:10 +01:00
Lars Ingebrigtsen
5a9965f0c7
Fix previous shr-parse-style change
...
* lisp/net/shr.el (shr-parse-style): Fix previous clean-up here
(which wasn't well thought through).
2021-12-06 21:43:43 +01:00
Lars Ingebrigtsen
77de40aed3
Audit `string-match' usage in shr.el
...
* lisp/net/shr.el (shr-descend):
(shr-insert):
(shr-expand-url):
(shr-image-from-data):
(shr-dom-print):
(shr-parse-style):
(shr-tag-object):
(shr-tag-img):
(shr-render-td-1): Prefer string-match-p and string-search over
string-match where possible.
2021-12-06 01:16:23 +01:00
Lars Ingebrigtsen
93824a760e
Add new face `variable-pitch-text'
...
* doc/emacs/display.texi (Standard Faces): Mention in.
* lisp/faces.el (variable-pitch-text): New face.
* lisp/gnus/gnus-art.el (gnus-header): Use it.
* lisp/net/shr.el (shr-text): Use it.
2021-12-01 17:20:16 +01:00
Lars Ingebrigtsen
a2d98c54f7
Use pixel-fill-width in shr.el
...
* lisp/net/shr.el (shr--window-width): Factor out into own function.
(shr-insert-document): Use it.
(shr-fill-text): Ditto.
2021-11-30 16:54:34 +01:00
Lars Ingebrigtsen
72b7fccc15
Add new package pixel-fill.el
...
* lisp/net/shr.el (shr-char-breakable-p, shr-char-nospace-p)
(shr-char-kinsoku-bol-p, shr-char-kinsoku-eol-p)
(shr-find-fill-point): Moved to pixel-fill.el and renamed.
(shr-pixel-region): Made obsolete.
(shr-fill-line): Use pixel-fill-region.
* lisp/textmodes/pixel-fill.el: New package.
2021-11-30 02:07:22 +01:00
Lars Ingebrigtsen
7fea9c8415
Define a face for shr text
...
* lisp/net/shr.el (shr-text): New face.
(shr-insert): Use it instead of hard-coding `variable-pitch'.
2021-11-25 11:17:00 +01:00
Lars Ingebrigtsen
4351722477
Make shr render text with superscripts prettier
...
* lisp/net/shr.el (shr-sup): New face.
(shr-tag-sup, shr-tag-sub): Use it to make the super/subscripts
slightly smaller so that we don't get uneven line heights with
text that uses these.
2021-11-20 11:42:44 +01:00
Mattias Engdegård
09a5dd8628
String backslash corrections
...
* lisp/net/shr.el (shr-tag-video): Remove ineffective backslash.
* test/lisp/emacs-lisp/package-tests.el
(package-test-macro-compilation-gz): Make dot literal as intended.
2021-11-18 20:54:32 +01:00
Lars Ingebrigtsen
2daffe3550
Adjust defvar-keymap' and
define-keymap' to the new syntax
...
* lisp/vc/smerge-mode.el (smerge-basic-map):
* lisp/vc/pcvs.el (cvs-mode-map):
(cvs-minor-mode-prefix):
* lisp/vc/log-view.el (log-view-mode-map):
* lisp/vc/log-edit.el (log-edit-mode-map):
* lisp/vc/diff-mode.el (diff-mode-shared-map):
(diff-minor-mode-prefix):
* lisp/vc/cvs-status.el (cvs-status-mode-map):
* lisp/simple.el (special-mode-map):
* lisp/outline.el (outline--insert-open-button):
(outline--insert-close-button):
* lisp/net/shr.el (shr-map):
* lisp/net/eww.el (eww-link-keymap):
(eww-mode-map):
(eww-submit-map):
(eww-bookmark-mode-map):
(eww-history-mode-map):
(eww-buffers-mode-map):
* lisp/mh-e/mh-speed.el (:keymap):
* lisp/mh-e/mh-show.el (:keymap):
* lisp/mh-e/mh-search.el (:keymap):
* lisp/mh-e/mh-letter.el (:keymap):
* lisp/mh-e/mh-folder.el (:keymap):
* lisp/international/emoji.el (emoji-list-mode-map):
* lisp/gnus/spam.el (:keymap):
* lisp/gnus/mml.el (mml-mode-map):
* lisp/gnus/message.el (message-mode-map):
* lisp/gnus/gnus-undo.el (gnus-undo-mode-map):
* lisp/gnus/gnus-topic.el (gnus-topic-mode-map):
* lisp/gnus/gnus-sum.el (:keymap):
* lisp/gnus/gnus-srvr.el (gnus-server-mode-map):
(gnus-browse-mode-map):
* lisp/gnus/gnus-salt.el (gnus-pick-mode-map):
(gnus-tree-mode-map):
* lisp/gnus/gnus-msg.el (:prefix):
* lisp/gnus/gnus-ml.el (gnus-mailing-list-mode-map):
* lisp/gnus/gnus-kill.el (gnus-kill-file-mode-map):
* lisp/gnus/gnus-html.el (gnus-html-displayed-image-map):
* lisp/gnus/gnus-group.el (:keymap):
* lisp/gnus/gnus-eform.el (gnus-edit-form-mode-map):
* lisp/gnus/gnus-draft.el (gnus-draft-mode-map):
* lisp/gnus/gnus-dired.el (gnus-dired-mode-map):
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-mode-map):
* lisp/gnus/gnus-art.el (:keymap):
(gnus-article-edit-mode-map):
* lisp/gnus/gnus-agent.el (gnus-agent-group-mode-map):
(gnus-agent-summary-mode-map):
(gnus-agent-server-mode-map):
(gnus-category-mode-map): Adjust `defvar-keymap' and
`define-keymap' to the new syntax.
2021-11-16 08:26:24 +01:00
Lars Ingebrigtsen
71bf21f58b
Fix image-animate declaration
...
* lisp/net/shr.el (image-animate): Fix declaration.
2021-11-12 03:31:53 +01:00
Lars Ingebrigtsen
a204b29d5b
Allow stopping animations automatically when the image disappears
...
* lisp/image.el (image-animate): Allow the animation to be stopped
automatically when the image is removed from the buffer.
(image-animate-timeout): Stop the animation if the image is
removed (and that has been requested).
* lisp/net/shr.el (shr-put-image): Stop animations if the image is
removed.
2021-11-12 03:31:53 +01:00
Lars Ingebrigtsen
18ebe6c4da
Fix the look of the <video> elements in shr
...
* lisp/net/shr.el (shr-tag-video): Tweak the look of the video element.
2021-11-10 02:31:54 +01:00
Po Lu
2ccaa95355
Fix compiler warning building net/shr.el without xwidget support
...
* lisp/net/shr.el (xwidget-webkit-execute-script): New function
declaration (bug#51705).
2021-11-09 08:27:23 +01:00
Lars Ingebrigtsen
430d12e3c0
Don't create temporary files for <video>
...
* lisp/net/shr.el (shr-tag-audio): Don't create a temporary file;
just update the DOM directly.
2021-11-09 07:47:17 +01:00
Lars Ingebrigtsen
3e2c024c41
Fix typo in last shr change
...
* lisp/net/shr.el (shr-tag-video): Require xwidgets, because it's
used from callbacks.
2021-11-09 06:44:58 +01:00