summaryrefslogtreecommitdiff
path: root/lisp/net/shr.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Fix (thing-at-point 'url) in eww formsLars Ingebrigtsen2022-09-261-2/+3
| | | | | | | | | * 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.
* Abolish max-specpdl-size (bug#57911)Mattias EngdegÄrd2022-09-191-35/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Also use eww URL transformers in the actual linksLars Ingebrigtsen2022-09-141-1/+8
| | | | | | | | * 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.
* Enable undo in eww buffersLars Ingebrigtsen2022-09-131-0/+2
| | | | | | | | * 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.
* Don't bug out in src when there's no srcsetLars Ingebrigtsen2022-07-231-5/+6
| | | | | * lisp/net/shr.el (shr--preferred-image): Don't bug out when there's no srcset.
* Fix srcset parsing in shrLars Ingebrigtsen2022-07-231-29/+43
| | | | | | * 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.
* Merge from origin/emacs-28Stefan Kangas2022-07-141-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * ; Fix typos: prefer American spellingStefan Kangas2022-07-131-1/+1
| |
* | Prefer keymap inheritance in shr-image-mapStefan Kangas2022-07-071-5/+4
| | | | | | | | | | * lisp/net/shr.el (shr-image-map): Replace copy-keymap with inheritance.
* | Add support for <mark> in shrLars Ingebrigtsen2022-07-011-0/+13
| | | | | | | | | | * lisp/net/shr.el (shr-mark): New face (bug#48211). (shr-tag-mark): New function
* | Fix shr--set-target-ids test for empty bufferLars Ingebrigtsen2022-06-211-1/+1
| | | | | | | | | | * lisp/net/shr.el (shr--set-target-ids): Fix the check for an empty buffer (which may be narrowed).
* | Speed up shr-string-pixel-widthLars Ingebrigtsen2022-06-171-13/+5
| | | | | | | | | | | | | | * 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.
* | Fix disruption of windows' display by shr.elEli Zaretskii2022-06-161-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | * 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)
* | Support html template tag in shrValenoern2022-05-281-0/+5
| | | | | | | | | | * lisp/net/shr.el: Add shr-tag-template as a dummy tag. Copyright-paperwork-exempt: yes
* | Fix retrieving images that contain ) characters in shrLars Ingebrigtsen2022-05-121-7/+7
| | | | | | | | | | | | * 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.
* | Add a new face shr-codeLars Ingebrigtsen2022-03-211-1/+5
| | | | | | | | | | * lisp/net/shr.el (shr-code): New face (bug#54480). (shr-tag-code): Use it.
* | Fix compilation warning introduced by previous shr.el changeLars Ingebrigtsen2022-02-201-0/+1
| | | | | | | | * lisp/net/shr.el (url-file): Fix compilation warning.
* | Make eww work better on Tramp HTMLLars Ingebrigtsen2022-02-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | * 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).
* | Fix HTML target marking in shrLars Ingebrigtsen2022-01-221-2/+2
| | | | | | | | | | | | | | * 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.
* | Rename the textsec-check function to textsec-suspicious-pLars Ingebrigtsen2022-01-201-6/+7
| | | | | | | | | | | | | | | | | | | | | | * 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.
* | Add text for suspicious linksLars Ingebrigtsen2022-01-191-1/+6
| | | | | | | | | | | | | | | | | | | | * 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.
* | Don't overwrite the link text in shr-tag-a for suspicious URLsLars Ingebrigtsen2022-01-191-3/+3
| | | | | | | | | | * lisp/net/shr.el (shr-tag-a): Tweak how the suspiciousness warning is handled.
* | Make shr mark links with suspicious URLsLars Ingebrigtsen2022-01-191-1/+6
| | | | | | | | | | | | | | | | | | | | | | * 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.
* | Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Simplify whitespace stripping in shr-expand-urlLars Ingebrigtsen2021-12-241-5/+3
| | | | | | | | * lisp/net/shr.el (shr-expand-url): Simplify whitespace stripping.
* | Merge from origin/emacs-28Stefan Kangas2021-12-241-1/+3
|\| | | | | | | | | 04be23f19f Improve Xref documentation edb1d491d9 * lisp/net/shr.el (shr-expand-url): Also strip trailing wh...
| * * lisp/net/shr.el (shr-expand-url): Also strip trailingAndreas Schwab2021-12-231-1/+3
| | | | | | | | whitespace.
* | Rework how shr sets <span id='foo'> targets to make it more reliableLars Ingebrigtsen2021-12-191-33/+22
| | | | | | | | | | | | | | | | | | | | | | * 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).
* | Add a shr-allowed-images user optionLdBeth2021-12-191-6/+17
| | | | | | | | | | | | | | | | | | * 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
* | Merge from origin/emacs-28Stefan Kangas2021-12-111-1/+1
|\| | | | | | | | | | | 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
| * Don't bug out on certain empty elements with idsLars Ingebrigtsen2021-12-101-1/+1
| | | | | | | | | | * lisp/net/shr.el (shr-descend): Fix empty-element #id targetting (bug#52391).
* | Fix previous shr-parse-style changeLars Ingebrigtsen2021-12-061-3/+1
| | | | | | | | | | * lisp/net/shr.el (shr-parse-style): Fix previous clean-up here (which wasn't well thought through).
* | Audit `string-match' usage in shr.elLars Ingebrigtsen2021-12-061-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Add new face `variable-pitch-text'Lars Ingebrigtsen2021-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | * 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.
* | Use pixel-fill-width in shr.elLars Ingebrigtsen2021-11-301-26/+14
| | | | | | | | | | | | * lisp/net/shr.el (shr--window-width): Factor out into own function. (shr-insert-document): Use it. (shr-fill-text): Ditto.
* | Add new package pixel-fill.elLars Ingebrigtsen2021-11-301-103/+5
| | | | | | | | | | | | | | | | | | | | * 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.
* | Define a face for shr textLars Ingebrigtsen2021-11-251-1/+5
| | | | | | | | | | * lisp/net/shr.el (shr-text): New face. (shr-insert): Use it instead of hard-coding `variable-pitch'.
* | Make shr render text with superscripts prettierLars Ingebrigtsen2021-11-201-2/+9
| | | | | | | | | | | | | | * 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.
* | String backslash correctionsMattias EngdegÄrd2021-11-181-1/+1
| | | | | | | | | | | | * 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.
* | Adjust `defvar-keymap' and `define-keymap' to the new syntaxLars Ingebrigtsen2021-11-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Fix image-animate declarationLars Ingebrigtsen2021-11-121-1/+1
| | | | | | | | * lisp/net/shr.el (image-animate): Fix declaration.
* | Allow stopping animations automatically when the image disappearsLars Ingebrigtsen2021-11-121-7/+8
| | | | | | | | | | | | | | | | | | | | * 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.
* | Fix the look of the <video> elements in shrLars Ingebrigtsen2021-11-101-1/+1
| | | | | | | | * lisp/net/shr.el (shr-tag-video): Tweak the look of the video element.
* | Fix compiler warning building net/shr.el without xwidget supportPo Lu2021-11-091-0/+3
| | | | | | | | | | * lisp/net/shr.el (xwidget-webkit-execute-script): New function declaration (bug#51705).
* | Don't create temporary files for <video>Lars Ingebrigtsen2021-11-091-13/+6
| | | | | | | | | | * lisp/net/shr.el (shr-tag-audio): Don't create a temporary file; just update the DOM directly.
* | Fix typo in last shr changeLars Ingebrigtsen2021-11-091-1/+1
| | | | | | | | | | * lisp/net/shr.el (shr-tag-video): Require xwidgets, because it's used from callbacks.
* | Fix shr-tag-video startup issueLars Ingebrigtsen2021-11-091-0/+1
| | | | | | | | | | * lisp/net/shr.el (shr-tag-video): Require xwidgets, because it's used from callbacks.
* | Optionally use use xwidgets to display <video> elements in shrLars Ingebrigtsen2021-11-091-4/+38
| | | | | | | | | | | | * doc/misc/eww.texi (Advanced): Document it. * lisp/net/shr.el (shr-use-xwidgets-for-media): New user option. (shr-tag-video): Use xwidgets to display <video> elements.