Commit graph

205 commits

Author SHA1 Message Date
Lars Magne Ingebrigtsen
488df60acc * lisp/net/shr.el (shr-copy-url): Also copy the image URL.
* lisp/net/shr.el (shr-copy-url): Also copy the image URL.
2014-08-05 20:15:03 +02:00
João Távora
f596f897c6 Fix relative links to parent directories in shr
* lisp/net/shr.el (shr-expand-url): Use `expand-file-name' for relative
links. .

Fixes: debbugs:17217
2014-04-14 23:01:54 +01:00
Lars Ingebrigtsen
6952100dc3 (eww-textarea-map): [tab] doesn't work on tty.
Reported by Mario Lang.

* net/shr.el (shr-map): Ditto.
2014-03-05 19:44:58 +01:00
Glenn Morris
b70257b07e Tweak earlier shr.el change 2014-02-28 15:00:12 -05:00
Ivan Kanis
8a73034ea9 * net/shr.el (shr-put-image): add custom variable
`shr-image-animate' to turn off image animation. It is so slow it
  will render emacs unusable.
2014-02-28 09:49:59 +01:00
Lars Ingebrigtsen
cc477daa01 Make shr respect privacy when viewing documents with SVG images
(shr-tag-svg): Respect `shr-inhibit-images'.
(shr-dom-to-xml): Respect `shr-blocked-images'.

Fixes: debbugs:15882
2014-01-31 13:44:11 -08:00
Lars Ingebrigtsen
dba6e3ec42 Make shr-generic into a defsusbt to make the stack shallower
* net/shr.el (shr-generic): Make into a defsubst to make the stack
depth shallower.
2014-01-31 13:08:13 -08:00
Adam Sjøgren
35408b1a6c * net/shr.el (shr-tag-img): Prefer the title over the alt text.
Fixes: debbugs:16537
2014-01-24 17:52:16 -07:00
Stefan Monnier
6137cb82db * lisp/net/shr.el (shr-render-region): Autoload. 2014-01-12 18:34:33 -05:00
Lars Magne Ingebrigtsen
3d95a0f45a Make shr do line filling better when encountering very long words
(shr-insert): If we have a word that's longer than `shr-width',
break after it anyway.  Otherwise we'll do no breaking once we get
such a long word.
2014-01-05 11:23:35 +01:00
Lars Magne Ingebrigtsen
1a29adc257 * net/shr.el (shr-descend): Don't bug out if the anchor is empty.
Fixes: debbugs:16285
2014-01-05 10:45:45 +01:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Glenn Morris
bb0980751e Add missing custom :versions, plus small fixes
* emacs-lisp/smie.el (smie-config): Add type, version, initialize.

* bookmark.el (bookmark-bmenu-use-header-line):
* doc-view.el (doc-view-scale-internally):
* pcmpl-x.el (pcmpl-x-tlmgr-program, pcmpl-x-ack-program):
* register.el (register-preview-delay):
* net/shr.el (shr-bullet):
* progmodes/cfengine.el (cfengine-cf-promises)
(cfengine-parameters-indent):
* progmodes/octave.el (inferior-octave-error-regexp-alist):
* textmodes/reftex-vars.el (reftex-label-regexps):
* vc/log-edit.el (log-edit-setup-add-author): Add version.

* cedet/ede/linux.el (project-linux-build-directory-default)
(project-linux-architecture-default): Fix custom types.  Add version.

* gnus/gnus-icalendar.el (gnus-icalendar-org, gnus-icalendar):
* gnus/gnus-sum.el (gnus-subthread-sort-functions): Add version.
* gnus/gnus-sync.el (gnus-sync-file-encrypt-to): Add type and version.
2013-12-27 18:16:05 -08:00
Lars Ingebrigtsen
e572a7d800 * net/shr.el (shr-insert): Don't infloop if the width is zero. 2013-12-27 16:43:54 +01:00
Lars Ingebrigtsen
24a6b65e90 Fix another shr infloop in the filling code
(shr-find-fill-point): Off by one error in comparison with the
indentation.
2013-12-27 03:58:16 +01:00
Lars Ingebrigtsen
ac5758d162 shr didn't fill Japanese text correctly any more
* net/shr.el (shr-find-fill-point): Don't try to fill if the
indentation level is larger than the width, because that will
infloop.
(shr-insert): Fill repeatedly long texts, so that Japanese is
formatted correctly.

Fixes: debbugs:16263
2013-12-27 03:21:42 +01:00
Lars Ingebrigtsen
f7f071dcf4 Don't infloop when we can't find a good place to break lines in shr
(shr-insert): Don't infloop if we can't find a good place to break
the line.

Fixes: debbugs:16256
2013-12-25 23:52:15 +01:00
Lars Ingebrigtsen
3c856c1415 * net/shr.el (shr-visit-file): Removed debugging function. 2013-12-25 20:37:41 +01:00
Lars Ingebrigtsen
c6c2058404 Further shr quotation mark fill fixes
(shr-char-kinsoku-bol-p): The quotation mark isn't a kinsoky BOL char.
(shr-find-fill-point): Remove the special checks for the quotation
mark, since `shr-char-kinsoku-bol-p' should now return the right
thing.
2013-12-25 19:14:49 +01:00
Lars Ingebrigtsen
99e4926fcb Fold shr text with single quotation marks better
* net/shr.el (shr-find-fill-point): Don't break lines before a
quotation mark.
2013-12-25 18:31:39 +01:00
Lars Magne Ingebrigtsen
073d5cfd9e * net/shr.el (shr--extract-best-source): Don't bug out on audio elements
That have text inside.  Also remove debugging.
2013-12-21 18:54:16 +01:00
Lars Magne Ingebrigtsen
cf91cee781 * net/shr.el (shr-insert): Protect against infloops in degenerate tables. 2013-12-20 05:29:08 +01:00
Stefan Monnier
e914544431 * lisp/net/shr.el (shr-insert-document): Remove unused var
`shr-preliminary-table-render'.
(shr-rescale-image): Remove unused arg `force'.
(shr-put-image): Update calls accordingly.
(shr-tag-a): Use `cont' rather than dyn-bound `dom'.
2013-12-16 21:48:06 -05:00
Lars Magne Ingebrigtsen
1c4b1e6107 * net/shr.el (shr-tag-a): Support zero-length <a name="foo"> elements. 2013-12-17 00:40:17 +01:00
Lars Magne Ingebrigtsen
e330b64699 * net/shr.el (shr-tag-img): Don't bug out on <img src=""> data. 2013-12-07 02:44:15 +01:00
Paul Eggert
f224e50022 Spelling and punctuation fixes. 2013-12-01 14:33:13 -08:00
Rüdiger Sonderfeld
ad9a773c50 Allow preferring some media types over others
* net/shr.el (shr-prefer-media-type-alist): : New customizable
variable.
(shr--get-media-pref): New function.
(shr--extract-best-source): New function.
(shr-tag-video, shr-tag-audio):  Use `shr--extract-best-source' when
no :src tag was specified.
2013-12-01 16:49:18 +01:00
Rüdiger Sonderfeld
eb2dd24d5b (shr-tag-audio): Add support for <audio> tag. 2013-12-01 16:41:10 +01:00
Rüdiger Sonderfeld
177948a5b2 Display content for video if no poster is available.
* net/shr.el (shr-tag-video): Display content for video if no
poster is available.
2013-12-01 16:40:12 +01:00
Rüdiger Sonderfeld
8feacce0ea Fix comment typo
* net/shr.el (shr-tag-table): Fix comment typo.
2013-12-01 16:35:59 +01:00
Lars Magne Ingebrigtsen
513562a1df Don't reload eww pages when browsing to different #targets
* net/eww.el (eww-follow-link): New command to avoid reloading
pages when we follow #target links.

Fixes: debbugs:15243
2013-12-01 15:12:44 +01:00
Glenn Morris
986ed13557 * net/shr.el (image-size, image-animate): Declare. 2013-09-17 21:53:05 -07:00
Lars Magne Ingebrigtsen
4b5fe4ee09 * net/shr.el (shr-rescale-image): Use ImageMagick even for GIFs
Now that Emacs supports ImageMagick animations.
2013-08-16 17:17:21 +02:00
Lars Magne Ingebrigtsen
c6b7ccaaf6 Rename :content-type to :format in `create-image' 2013-08-13 22:13:02 +02:00
Lars Magne Ingebrigtsen
21c58ae2a8 Make shr feed Content-Type to the image-creating libraries
This finally makes it possible to display icons.

* net/eww.el (eww-display-image): Ditto.

* net/shr.el (shr-parse-image-data): New function to grab both the
data itself and the Content-Type.
(shr-put-image): Use it.
2013-08-13 20:09:50 +02:00
Glenn Morris
af1c6c8493 Fix some custom types
* gnus/gnus.el (gnus-valid-select-methods): Fix type.

* gnus/nnimap.el (nnimap-request-articles-find-limit): Fix type, version.

* net/shr.el (shr-table-horizontal-line): Fix custom type.
2013-08-13 00:18:50 -07:00
Lars Magne Ingebrigtsen
2122cb6dd2 Further shr width computation fixes
(shr-make-table-1): Redo last change to fix the real problem in
colspan handling.
2013-08-07 00:05:33 +02:00
Lars Magne Ingebrigtsen
ec6a2d7a5a shr table rendering touch-ups
* net/shr.el (shr-render-td): Remove debugging.
(shr-render-td): Make width computation consistent by defaulting
all zero-width columns to 10 characters.  This may not be optimal,
but it's at least consistent.
2013-08-06 23:28:38 +02:00
Lars Magne Ingebrigtsen
1211de5030 * net/shr.el (shr-mouse-browse-url): Remove and use `shr-browse-url'. 2013-07-30 16:58:37 +02:00
Lars Magne Ingebrigtsen
5a2a77359a (shr-urlify): Highlight under mouse. 2013-07-30 16:27:04 +02:00
Lars Magne Ingebrigtsen
d50fceab31 * net/shr.el (shr-urlify): Put `follow-link' on URLs.
Fixes: debbugs:14815
2013-07-30 16:25:11 +02:00
Lars Magne Ingebrigtsen
8ba8eec59b * net/shr.el (shr-mouse-browse-url): New command and keystroke.
Fixes: debbugs:14815
2013-07-19 16:57:28 +02:00
Lars Magne Ingebrigtsen
48494e063a (shr-make-table-1): Ensure that we don't infloop on degenerate widths. 2013-07-19 16:07:43 +02:00
Lars Magne Ingebrigtsen
2d756ae0d8 * net/shr.el (shr-map): Reinstate the `u' key binding
It's been used a while.
2013-07-08 13:19:51 +02:00
Lars Magne Ingebrigtsen
2fae38e5f9 Fix shr table rendering infloop
* net/shr.el (shr-make-table-1): Add a sanity check that allows
progression on degenerate tables.
(shr-rescale-image): ImageMagick animated images currently doesn't
work.
2013-06-30 15:11:41 +02:00
Ivan Kanis
eadb606887 * net/shr.el (shr-render-region): New function. 2013-06-28 09:57:49 +02:00
Lars Magne Ingebrigtsen
7f13406b7a * net/shr.el (add-face-text-property): Removed compat definition. 2013-06-27 11:01:08 +02:00
Lars Magne Ingebrigtsen
16f74f10ba Use `w' for copying URLs in shr and eww
* net/eww.el (eww-mode-map): Ditto.

* net/eww.el (eww-copy-page-url): Changed name of command.

* net/shr.el (shr-map): Change `shr-copy-url' from `u' to `w' to
be more consistent with Info and dired.
2013-06-25 21:25:14 +02:00
Ivan Kanis
5196f88a95 * net/shr.el (shr-browse-url): Fix interactive spec. 2013-06-24 19:41:26 +02:00
Lars Magne Ingebrigtsen
bdaa086b77 * net/shr.el (shr-browse-url): Use an external browser if given a prefix. 2013-06-24 16:03:26 +02:00