summaryrefslogtreecommitdiff
path: root/lisp/net/shr.el
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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.
* | Merge from origin/emacs-28Eli Zaretskii2021-10-311-7/+6
|\| | | | | | | | | | | | | f1c9286 ; * doc/misc/org.org: fix capture context example af67ce6 Merge branch 'emacs-28' of git.savannah.gnu.org:/srv/git/emac... 610680a Fix rendering of title-less <abbr> tags in shr 2ba4ccf ; * lisp/files.el (make-nearby-temp-file): Doc fix.
| * Fix rendering of title-less <abbr> tags in shrLars Ingebrigtsen2021-10-311-7/+6
| | | | | | | | | | * lisp/net/shr.el (shr-tag-abbr): Render <abbr> tags that have no title (bug#51525).
* | Change the call convention for `defvar-keymap'Lars Ingebrigtsen2021-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/keymaps.texi (Changing Key Bindings): Adjust documentation. * lisp/simple.el (special-mode-map): * lisp/net/shr.el (shr-map): * lisp/net/eww.el (eww-link-keymap): (eww-mode-map): (eww-submit-map): (eww-textarea-map): (eww-bookmark-mode-map): (eww-history-mode-map): (eww-buffers-mode-map): * lisp/gnus/message.el (message-mode-map): * lisp/gnus/gnus-html.el (gnus-html-image-map): * lisp/gnus/gnus-eform.el (gnus-edit-form-mode-map): * lisp/gnus/gnus-dired.el (gnus-dired-mode-map): * lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-mode-map): Adjust usage of `defvar-keymap'. * lisp/subr.el (define-keymap, define-keymap--define): Change how these functions call each other. (defvar-keymap): Change interface to be more like `define-keymap'. * lisp/emacs-lisp/lisp-mode.el (lisp-indent--defvar-keymap): Remove. (lisp-indent-function): Don't use it.
* | Convert some keymaps to defvar-keymapLars Ingebrigtsen2021-10-041-17/+15
|/ | | | | | | | | | | | | | | | | | | | | | | * lisp/simple.el (special-mode-map): * 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/gnus/message.el (message-mode-map): Use defvar-keymap. * lisp/gnus/gnus-eform.el (gnus-edit-form-mode-map): * lisp/gnus/gnus-dired.el (gnus-dired-mode-map): * lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-mode-map): Use defvar-keymap. * lisp/gnus/gnus-group.el (gnus-group-mode-map): Use define-keymap. * lisp/gnus/gnus-html.el (gnus-html-image-map): Use defvar-keymap. * lisp/gnus/gnus.el: Autoload gnus-score-edit-all-score.
* ; Minor stylistic fixes found by checkdocStefan Kangas2021-09-161-1/+1
|
* Add faces for shr heading elements (bug#49433)Protesilaos Stavrou2021-07-061-8/+33
| | | | | | | | | | * etc/NEWS: Document new faces. * lisp/net/shr.el (shr-h1, shr-h2, shr-h3, shr-h4, shr-h5, shr-h6): Define new faces. (shr-tag-h1): Remove inclusion of 'variable-pitch' face. Fix bug#49433 by applying a new face directly. (shr-tag-h2, shr-tag-h3, shr-tag-h4, shr-tag-h5, shr-tag-h6): Apply new faces.
* * lisp/net/shr.el (shr-image-displayer): Use proper closuresStefan Monnier2021-05-181-14/+14
|
* Add command in eww to toggle imagesRalph Schleicher2021-04-121-2/+4
| | | | | | | | | | * lisp/net/eww.el (eww-toggle-images): New function. (eww-mode-map): Add key binding and menu entry. * lisp/net/shr.el (shr-inhibit-images): Make it customizable. * doc/misc/eww.texi (Basics): Document eww-toggle-images. Fix index entries for shr-use-fonts and shr-use-colors. (Advanced): Document shr-inhibit-images (bug#47705).
* ; * lisp/net/shr.el (shr-insert-document): Fix last change.Eli Zaretskii2021-04-111-2/+3
|
* * lisp/net/shr.el (shr-insert-document): Explain why bidi-display-reorderingStefan Monnier2021-04-101-0/+5
|
* * lisp/net/*.el: Use lexical-bindingStefan Monnier2021-03-081-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also remove some redundant `:group` arguments. * lisp/net/eudc-export.el: Use lexical-binding. (eudc-create-bbdb-record): Use `cl-progv` and `apply` to avoid `eval`. * lisp/net/eudc-hotlist.el: Use lexical-binding. * lisp/net/eudc.el (eudc-print-attribute-value): Use `funcall` to avoid `eval`. * lisp/net/eudcb-bbdb.el: Use lexical-binding. (eudc-bbdb-filter-non-matching-record): Use `funcall` to avoid `eval`. Move `bbdb-val` binding to avoid `setq`. Use `seq-some` instead of `eval+or`. (eudc-bbdb-format-record-as-result): Use `dolist` and `pcase`. Use `funcall` to avoid `eval`. (eudc-bbdb-query-internal): Simplify a bit. * lisp/net/eudcb-ldap.el: Use lexical-binding. (eudc-ldap-get-host-parameter): Use `defalias` to avoid `eval-and-compile`. * lisp/net/telnet.el: Use lexical-binding. * lisp/net/quickurl.el: Use lexical-binding. * lisp/net/newst-ticker.el: Use lexical-binding. * lisp/net/newst-reader.el: Use lexical-binding. * lisp/net/goto-addr.el: Use lexical-binding. * lisp/net/gnutls.el: Use lexical-binding. * lisp/net/eudcb-macos-contacts.el: Use lexical-binding. * lisp/net/eudcb-mab.el: Use lexical-binding. * lisp/net/net-utils.el: Use lexical-binding. (finger): Remove unused var `found`. * lisp/net/network-stream.el (open-protocol-stream): Remove redundant `defalias`. * lisp/net/newst-plainview.el: Use lexical-binding. (newsticker-hide-entry, newsticker-show-entry): Remove unused var `is-invisible`. (w3m-fill-column, w3-maximum-line-length): Declare vars. * lisp/net/tramp.el (tramp-compute-multi-hops): * lisp/net/tramp-compat.el (tramp-compat-temporary-file-directory): * lisp/net/tramp-cmds.el (tramp-default-rename-file): * lisp/net/webjump.el (webjump): Don't forget lexical-binding for `eval`.
* ; Finish recent rename of completion-* predicates.Basil L. Contovounesios2021-02-171-1/+1
|
* Make the button completion predicate be more usefulLars Ingebrigtsen2021-02-151-1/+1
| | | | | | | | * lisp/simple.el (completion-button-p): Rework from `completion-at-point-p'. * lisp/net/shr.el (shr-show-alt-text): It should be possible to complete to commands that aren't bound to a key.
* Add a possible completion predicate for buttonsLars Ingebrigtsen2021-02-141-0/+1
| | | | | | * lisp/simple.el (completion-at-point-p): New predicate. * lisp/net/shr.el (shr-show-alt-text): Mark up as a button.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Handle gracefully href="" in base tags in shrŁukasz Stelmach2020-12-231-2/+3
| | | | | | * net/shr.el (shr-tag-base): shr-parse-base can't handle empty strings gracefully. Don't call it unless href is a non-empty string (bug#45355).
* Add way to prevent asking "increase specpdl size?"Richard M Stallman2020-10-151-1/+10
| | | | | | * net/shr.el (shr-offer-extend-specpdl): New option, default t. (shr-descend): If shr-offer-extend-specpdl is nil, don't even ask whether to extend the specpdl, just signal error.
* Speed up shr-insert slightlyLars Ingebrigtsen2020-09-221-1/+4
| | | | | | * lisp/net/shr.el (shr-insert): Speed up regularising spaces -- the vast majority of the spaces are already OK, so transforming " " to " " just takes time.
* Fix filling problem in shr due to zero-width id taggingLars Ingebrigtsen2020-09-221-1/+4
| | | | | * lisp/net/shr.el (shr-descend): Fix problem with filling lines that have a zero-width ID tag at the start.
* Fix bug out when indenting inserted images in shrLars Ingebrigtsen2020-09-201-1/+2
| | | | | | * lisp/net/shr.el (shr-fill-line): We may not have a shr-indentation text property here. In that case, default to the dynamically bound value.
* Fix problem with spurious extra paragraphs in shrLars Ingebrigtsen2020-09-191-1/+17
| | | | | * lisp/net/shr.el (shr-ensure-paragraph): Don't regard <div id=foo></div> (empty placeholders) as occupying any space (bug#43510).
* Tweak background colours in shr when there's indentationLars Ingebrigtsen2020-08-301-2/+2
| | | | | * lisp/net/shr.el (shr-fill-line): Get the background colour right for the indentation, too.
* Extend background colours in shrLars Ingebrigtsen2020-08-251-2/+2
| | | | | | | * lisp/net/shr.el (shr-colorize-region): Extend backgrounds to the end (bug#43031). This avoid ragged edges to the right when, for instance, the <body> has a bgcolor. (shr-face-background): Ditto.
* Set basic SVG attributes (bug#40845)Alan Third2020-08-231-17/+0
| | | | | | | | | | | | | | | | | * test/manual/image-transforms-tests.el: Replace hard-coded colors with defaults. * src/dispextern.h (struct image): * src/image.c (search_image_cache): (xbm_load_image): (xbm_load): (pbm_load): Rename from frame to face where relevant. (svg_load_image): Parse the image to find out the size, then wrap it in another SVG to set a new size and colors, etc. (lookup_image): Use the face colors instead of the frame colors. (search_image_cache): Add ability to ignore the face colors. (uncache_image): Uncache all copies of the image that share the spec, even if the face colors don't match. * etc/NEWS: Describe the changes.
* Fix documentation of a recent change in shr.elEli Zaretskii2020-07-181-13/+12
| | | | | | | | * lisp/net/shr.el (shr-max-width, shr-width): Fix typo and wording of the doc strings. * etc/NEWS: Fix the wording of the 'shr-max-width's entry, and move it to the SHR section.
* Add support for a shr-max-width variableLars Ingebrigtsen2020-07-171-1/+26
| | | | | | | * doc/misc/eww.texi (Advanced): Document it. * lisp/net/shr.el (shr-max-width): Add new variable (bug#40909). (shr-insert-document): Use it.
* Clarify shr width computationLars Ingebrigtsen2020-07-171-22/+21
| | | | | | * lisp/net/shr.el (shr-insert-document): Clarify width computation: shr-width was checked again in the `else' part where we already knew it was nil.
* ; Simplify last change in shr.elBasil L. Contovounesios2020-07-171-3/+2
| | | | * lisp/net/shr.el (shr-max-columns): Simplify some function calls.
* Fix problems with not rendering shr tables with rowspanLars Ingebrigtsen2020-07-171-3/+20
| | | | | * lisp/net/shr.el (shr-max-columns): When rowspans were in effect, columns would go missing from subsequent lines (bug#42194).
* Propertize all shr fragment IDs as shr-target-idBasil L. Contovounesios2020-06-181-12/+13
| | | | | | | | | | | | * lisp/net/shr.el (shr-target-id): Add docstring. (shr-descend, shr-tag-a): Display dummy anchor characters as the empty string. Give all relevant 'id' or 'name' fragment identifier attributes the shr-target-id text property. This ensures that cached content, such as tables, retains the property across renders. (Bug#40532) * lisp/net/eww.el: (eww-display-html): Adapt shr-target-id property search accordingly.
* Improve shr/eww handling of mailto URLsBasil L. Contovounesios2020-05-221-48/+36
| | | | | | | | | | | | | | | * lisp/net/eww.el (eww): Use function-put in place of put, as recommended in "(elisp) Symbol Plists". (eww-follow-link): * lisp/net/shr.el (shr-browse-url): Rather than call browse-url-mail directly, call browse-url which respects the user options browse-url-handlers and browse-url-mailto-function. (Bug#41133) (shr--current-link-region): Return nil if there is no link at point. (shr--blink-link): Adapt accordingly. (shr-fill-line, shr-indent, shr-table-body): Refactor to avoid some unnecessary allocations. * etc/NEWS: Announce that eww-follow-link and shr-browse-url support custom URL handlers.
* shr comment typo fixLars Ingebrigtsen2020-02-201-1/+1
| | | | * lisp/net/shr.el (shr-parse-base): Comment typo fix.
* Introduce face for <code> elements in shrKévin Le Gouguec2020-02-201-1/+1
| | | | | | * lisp/net/shr.el (shr-tag-code): Don't use the `default' font, because it has properties that will override surrounding elements (like <a...>) (bug#39504).
* Make links in shr use separate mouse highlight regionsLars Ingebrigtsen2020-01-241-1/+3
| | | | | * lisp/net/shr.el (shr-urlify): Make adjacent links have separate mouse hightlights (bug#39115).
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Fix problem with emacs -nw / eww / svgRobert Pluim2019-12-241-1/+2
| | | | | * lisp/net/shr.el (shr-parse-image-data): Don't bug out on non-visual Emacs versions on SVG images (bug#38507).
* Make shr scale images on all framesLars Ingebrigtsen2019-10-291-1/+1
| | | | | * lisp/net/shr.el (shr-rescale-image): Rescale images even if the window isn't on the current frame.
* Don't have shr bug out if svg support isn't availableLars Ingebrigtsen2019-10-191-1/+2
| | | | | * lisp/net/shr.el (shr-put-image): Don't bug out if SVG support isn't available.
* Use tabs in EWW (bug#37592)Juri Linkov2019-10-071-2/+11
| | | | | | | | | | | | | | * lisp/net/eww.el (eww-open-in-new-buffer): Call tab-new when tab-bar-mode is enabled. (eww-browse-url): Add docstring. Call tab-new when tab-bar-mode is enabled. * lisp/net/shr.el (shr-map): Bind [C-down-mouse-1] to shr-mouse-browse-url-new-window. (shr-mouse-browse-url-new-window): New command. (shr-browse-url): Add optional arg new-window. * doc/misc/eww.texi (Basics): Mention opening tabs on M-RET.
* Touch up previous shr-dom-to-xml encoding changeLars Ingebrigtsen2019-10-031-2/+7
| | | | | | * lisp/net/shr.el (shr-dom-to-xml): Include an XML declaration if we're encoding the data. (shr-parse-image-data): Add comment about why encoding is necessary.
* Fix up previous SVG-multibyte fixLars Ingebrigtsen2019-10-031-8/+8
| | | | | | | | * lisp/net/shr.el (shr-dom-to-xml): For SVG images, take an optional charset parameter to return unibyte data. (shr-parse-image-data): Use it. (shr-tag-svg): Ditto. (svg--wrap-svg): Revert previous kludge.
* Avoid bugging out on multibyte SVG data in shrLars Ingebrigtsen2019-10-011-1/+3
| | | | | * lisp/net/shr.el (svg--wrap-svg): Ensure that the SVG data is unibyte.
* Fix rendering of degenerate tables some more in shr.elLars Ingebrigtsen2019-09-301-1/+9
| | | | | | * lisp/net/shr.el (shr--fix-tbody): New function (bug#31665). (shr--fix-table): Use it to fix the <table><tbody>foo</tbody></table> case.
* shr table fix refactoringLars Ingebrigtsen2019-09-301-84/+86
| | | | | | * lisp/net/shr.el (shr--fix-table): Refactor out into own function from... (shr-tag-table): ... this function.
* Slight shr-put-image clean upLars Ingebrigtsen2019-09-241-7/+1
| | | | | | * lisp/net/shr.el (shr-put-image): Use image-multi-frame-p directly, and remove outdated comments (image-multi-frame-p returns the delay).
* Allow controlling when to send cookies when retrieving images in shrLars Ingebrigtsen2019-09-241-5/+40
| | | | | | | | | * lisp/net/shr.el (shr--use-cookies-p): New function. (shr-tag-img): Use it. (shr-cookie-policy): New variable. (shr-save-contents): Use cookies. * doc/misc/eww.texi (Advanced): Document it.
* Tweak how much <sup>/<sub> raises/lowers text in shrLars Ingebrigtsen2019-09-231-2/+2
| | | | | * lisp/net/shr.el (shr-tag-sup, shr-tag-sub): Raising by 0.5 gives very ugly displays. 0.2 seems sufficient for legibility.