1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-24 10:38:38 +00:00
Commit Graph

244 Commits

Author SHA1 Message Date
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
Katsumi Yamaoka
8ce827426e shr-image-fetched: Work for narrowed Gnus article
See <8737e3msun.fsf@gmail.com> of bug#26231 in the bug-gnu-emacs list.

* lisp/net/shr.el (shr-image-fetched): Work for narrowed article.
2017-03-27 09:05:41 +00:00
David Bremner
43e792cd7f Fix issues with dedicated windows in shr.el
* lisp/net/shr.el (shr-pixel-buffer-width, shr-render-td-1): Make
the window not dedicated, to avoid errors if it was, before
setting its buffer temporarily.  (Bug#25828)

Copyright-paperwork-exempt: yes
2017-03-04 12:19:32 +02:00
Lars Ingebrigtsen
267c98ae48 Fix rendering of some complex SVG images
* lisp/net/shr.el (shr-parse-image-data): Don't transform
SVG->DOM->XML unless we're blocking images, as this is apt to
destroy the SVG (bug#24111).
2017-01-24 22:21:45 +01:00
Lars Ingebrigtsen
3180deacf5 Clarify the last clarification
* lisp/net/shr.el (shr-width): Clarify the interaction with
`shr-use-fonts' (bug#24928).
2017-01-24 21:33:51 +01:00
Lars Ingebrigtsen
253fdf799b shr-width doc clarification
* lisp/net/shr.el (shr-width): Clarify the interaction with
`shr-use-fonts' (bug#24928).
2017-01-24 21:31:17 +01:00
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