Commit graph

178 commits

Author SHA1 Message Date
Lars Ingebrigtsen
90f82ffa5d Decode hex-encoded URLs before using them as file names
* eww.el (eww-decode-url-file-name): New function.
(eww-download-callback): Use it to decode file names before
saving them.

Backport:

(cherry picked from commit af22a010d8)
2015-12-25 17:02:31 +01:00
Eli Zaretskii
9b0f1824d7 Fix decoding of text in URLs retrieved by EWW
* lisp/net/eww.el (eww-render): Pass 'charset' to
'eww-display-raw'.  Use the value of 'last-coding-system-used', if
non-nil, to set 'buffer-file-coding-system' of the buffer where we
show the URL.
(eww-display-html, eww-display-raw): Decode the text correctly,
using the charset found in the headers, and defaulting to UTF-8.
If the user told us to use a specific encoding, override the
charset from the headers.  (Bug#22222)
2015-12-22 18:57:51 +02:00
Paul Eggert
bb4303c536 Quote symbols in docstrings using `'
Be more systematic about quoting symbols `like-this' rather than
`like-this or 'like-this' in docstrings.  This follows up Artur
Malabarba's email in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01647.html
2015-11-18 09:17:55 -08:00
Paul Eggert
ac16149ba4 Fix docstring quoting problems with ‘ '’
Problem reported by Artur Malabarba in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01513.html
Most of these fixes are to documentation; many involve fixing
longstanding quoting glitches that are independent of the
recent substitute-command-keys changes.  The changes to code are:
* lisp/cedet/mode-local.el (mode-local-augment-function-help)
(describe-mode-local-overload):
Substitute docstrings before displaying them.
* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda):
Quote the generated docstring for later substitution.
2015-11-17 15:29:35 -08:00
Mark Oteiza
3f828dc76b * lisp/net/eww.el (eww-bookmark-prepare): Use truncate-string-to-width.
`substring' does not account for full width characters.
2015-10-26 12:15:50 -04:00
Eli Zaretskii
0f7334147d Decode the HTML source when displaying it in EWW
* lisp/net/eww.el (eww-view-source): Decode the HTML source
according to its headers.
2015-10-23 12:23:23 +03:00
Mark Oteiza
882c3f3651 Use special-mode in eww list modes
* lisp/net/eww.el (eww-bookmark-mode, eww-history-mode)
(eww-buffers-mode): Derive from special-mode and remove redundant
setting of buffer-read-only.
(eww-mode-map): Remove redundant keymap parent setting.
(eww-bookmark-mode-map, eww-history-mode-map, eww-buffers-mode-map):
Remove redundant keymap suppressions and mappings.
2015-10-13 08:12:53 -04:00
Paul Eggert
284c470ef7 Backslash cleanup in Elisp source files
This patch should not change behavior.  It typically omits backslashes
where they are redundant (e.g., in the string literal "^\$").
In a few places, insert backslashes where they make regular
expressions clearer: e.g., replace "^\*" (equivalent to "^*") with
"^\\*", which has the same effect as a regular expression.
Also, use ‘\ %’ instead of ‘\%’ when avoiding confusion with SCCS IDs,
and similarly use ‘\ $’ instead of ‘\$’ when avoiding confusion with
RCS IDs, as that makes it clearer that the backslash is intended.
2015-09-17 16:09:39 -07:00
Glenn Morris
ce7ff436ff Function declaration updates prompted by 'make check-declare'
* lisp/emacs-lisp/package.el (lm-homepage):
* lisp/gnus/gnus-util.el (iswitchb-read-buffer):
* lisp/gnus/mm-decode.el (libxml-parse-html-region):
* lisp/gnus/mml.el (libxml-parse-html-region):
* lisp/gnus/nnrss.el (libxml-parse-html-region):
* lisp/net/eww.el (libxml-parse-html-region):
* lisp/net/shr.el (libxml-parse-html-region):
* lisp/vc/vc-bzr.el (vc-annotate-convert-time):
* lisp/vc/vc-cvs.el (vc-annotate-convert-time):
* lisp/vc/vc-git.el (vc-annotate-convert-time):
* lisp/vc/vc-hg.el (vc-annotate-convert-time):
* lisp/vc/vc-mtn.el (vc-annotate-convert-time):
* lisp/vc/vc-rcs.el (vc-annotate-convert-time):
Update declaration.
2015-04-30 20:06:15 -04:00
Ivan Shmakov
b08f8bb06a Render application/xhtml+xml as HTML
Fixes: debbugs:20009

* lisp/net/eww.el (eww-html-p): New function.
(eww-render): Use it.
2015-03-05 23:26:34 +01:00
Rüdiger Sonderfeld
6c0a602fb8 eww: Fix some docstrings/error message.
* net/eww.el (eww-search-prefix, eww-open-file, eww-search-words)
(eww-same-page-p,eww-set-character-encoding): Fix docstring.
(eww): Do not end error messages with a period.
2015-03-04 12:38:22 +01:00
Ivan Shmakov
8b36bfafee Add autoload cookie for the eww-suggest-uris variable.
* lisp/net/eww.el (eww-suggest-uris): Add autoload cookie, so that
add-hook works correctly even if the file is not yet loaded.
2015-02-16 19:01:50 +00:00
Ivan Shmakov
2ea5364ca8 Fix eww.el desktop support.
* lisp/net/eww.el (eww-mode): Add autoload cookie.
(eww-restore-desktop): Use inhibit-read-only.

Fixes: debbugs:19226
2015-02-16 18:55:02 +00:00
Lars Magne Ingebrigtsen
656caef350 Allow using variable-width fonts in eww
* lisp/gnus/mm-decode.el (mm-shr): Only pass the fill column when not using
fonts, because limiting the width to what's appropriate for followups
doesn't really help when not using proportional fonts.

* lisp/net/shr.el (shr-use-fonts): New variable.
(shr-fill-text): Rename from "fold".
(shr-pixel-column, shr-pixel-region, shr-string-pixel-width): New
functions.
(shr-insert): Just insert, don't fill the text.  Filling is now
done afterwards per display unit.
(shr-fill-lines, shr-fill-line): New functions to fill text on a
per-unit base.
(shr-find-fill-point): Take a "beginning" parameter.
(shr-indent): Indent using the :width display parameter when using
fonts.
(shr-parse-style): Ignore "inherit" values, since we already do that.
(shr-tag-img): Remove the insertion states.
(shr-tag-blockquote): New-style filling.
(shr-tag-dd): Ditto.
(shr-tag-li): Ditto.
(shr-mark-fill): New function to mark lines that need filling.
(shr-tag-h1): Use a larger font.
(shr-tag-table-1): Get the natural and suggested widths in one
rendering.
(shr-tag-table): Create the "fixed" version of the table only once
so that we can cache data in the table.
(shr-insert-table): Get colspan calculations right by having
zero-width columns after colspan ones.
(shr-expand-alignments): New function to make :align-to specs work
right when rendered in one buffer and displayed in another one.
(shr-insert-table-ruler): Use :align-to to get the widths right.
(shr-make-table): Cache more.
(shr-make-table-1): Use the new <td> data layout.
(shr-pixel-buffer-width): New function.
(shr-render-td): Add a caching layer.
(shr-dom-max-natural-width): New function.
2015-02-10 16:29:05 +11:00
Lars Ingebrigtsen
c3d4505b5a * lisp/net/eww.el (eww-add-bookmark): Fix prompt
And clean up the code slightly.
2015-01-26 12:50:01 +11:00
Stefan Monnier
81882be711 * lisp/net/eww.el: Use lexical-binding.
(eww-links-at-point): Remove unused arg.
(eww-mode-map): Inherit from special-mode-map.
(eww-mode): Derive from special-mode.  Don't use `setq' on a hook.
2015-01-14 08:35:07 -05:00
Lars Magne Ingebrigtsen
4113ac2534 Further eww URL DWIM tweaks
* net/eww.el (eww): Interpret anything that looks like a protocol
designator as a full URL.
2015-01-11 15:58:10 +01:00
Lars Magne Ingebrigtsen
afaa7c183b eww title cleanup when loading
(eww): Clear the title when loading so that we don't display
misleading information.
2015-01-10 17:26:37 +01:00
Lars Magne Ingebrigtsen
1fd0073864 (eww): Don't interpret "org/foo" as an URL. 2015-01-10 16:41:49 +01:00
Lars Magne Ingebrigtsen
790ca72b3e Further eww DWIM URL interpretation fixups
(eww): Also interpret things like "en.wikipedia.org/wiki/Free
software" as an URL.
2015-01-10 16:20:44 +01:00
Lars Magne Ingebrigtsen
0046f2c158 Tweak eww DWIM URL recognition
Fixes: debbugs:19556

* net/eww.el (eww): Always interpret URLs that start with https?:
as plain URLs, even if they have spaces in them.
2015-01-10 16:01:43 +01:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Juri Linkov
5480b8ef25 Multi-page isearch support in eww
* lisp/net/eww.el (eww-isearch-next-buffer): New function.
(eww-mode): Set multi-isearch-next-buffer-function to it.
http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg02300.html
2014-12-31 01:50:06 +02:00
Lars Ingebrigtsen
c5a81fdb6f Make eww rendering default to `window-width' again
* lisp/gnus/mm-decode.el (mm-shr): Bind `shr-width' to `fill-column'
so that lines don't get overlong when responding.

* lisp/net/eww.el (eww-mode): Truncate overlong lines for prettier
display when resizing.

* lisp/net/shr.el (shr-width): Default to using the window width when
rendering.
2014-12-29 13:48:43 +01:00
Ivan Shmakov
28a584d0e9 Fix eww typo in "up" handling
Fixes: debbugs:19445

* lisp/net/eww.el (eww-handle-link): Fix typo in "up" rel handling.
2014-12-28 14:54:46 +01:00
Lars Magne Ingebrigtsen
a005f61018 Make eww mark valid/invalid https pages
* lisp/net/eww.el (eww-update-header-line-format): Mark valid/invalid
certificates in the header line.
(eww-invalid-certificate, eww-valid-certificate): New faces.
2014-12-09 04:21:57 +01:00
Andrey Kotlarski
e40e63033b Commands and mode for managing multiple eww buffers
Fixes: debbugs:19131

* doc/misc/eww.texi (Basics): Document managing multiple eww buffers.

* lisp/net/eww.el (eww-buffers-mode): New major mode.
(eww-list-buffers, eww-buffer-select, eww-buffer-show-next)
(eww-buffer-show-previous, eww-buffer-kill, eww-buffer-show): New
commands/functions.
2014-12-08 19:29:06 +01:00
Lars Magne Ingebrigtsen
eb5b08bef5 (eww-copy-page-url): Add doc string. 2014-12-07 22:18:09 +01:00
Lars Magne Ingebrigtsen
a3ca30c8b5 Revert prefix behavior in RET to previous behavior
* net/eww.el (eww-follow-link): Revert prefix behaviour to
previous behavior.
2014-12-07 21:44:19 +01:00
Ivan Shmakov
06b5cfe498 Make `G' in eww record history
Fixes: debbugs:19253

* net/eww.el (eww-browse-url): Use generate-new-buffer (was:
iterating over possible buffer names.)

* net/eww.el (eww): Moved history recording here...
(eww-browse-url): ... from here.
2014-12-07 21:14:07 +01:00
Lars Magne Ingebrigtsen
c08883ccb4 (eww-current-buffer): Compilation fix for bug#18550 patch. 2014-12-07 20:50:23 +01:00
Lars Magne Ingebrigtsen
007d4c29c2 Make a prefix to `eww-reload' work locally
Fixes: debbugs:19086

* net/eww.el (eww-reload): Take a prefix to work locally (bug#19086).
2014-12-07 20:49:16 +01:00
Ivan Shmakov
b9ad615e65 eww history restoration fix
Fixes: debbugs:18550

* net/eww.el (eww-list-histories): Restore the history in the
correct buffer.
2014-12-07 20:38:38 +01:00
Lars Magne Ingebrigtsen
2c3d111392 eww bookmark display fixup
Fixes: debbugs:16398

* net/eww.el (eww-bookmark-prepare): Display URLs in first by
displaying shortened titles first.
2014-12-07 20:32:07 +01:00
Lars Magne Ingebrigtsen
bee76e566c Make eww use mailcap when displaying PDF files
Fixes: debbugs:19270

* net/eww.el (eww-display-pdf): Let mailcap determine how to
display PDF files.
2014-12-05 16:51:59 +01:00
Ivan Shmakov
52fab40c16 Call `eww-after-render-hook' in the correct buffer
Fixes: debbugs:19225

* net/eww.el (eww-render): Call `eww-after-render-hook' in the
correct buffer.
2014-12-01 18:56:02 +01:00
Lars Magne Ingebrigtsen
31410dcb09 Minor eww point placement fixup
* net/eww.el (eww): Leave point in a place that doesn't cause
scrolling when displaying "Loading...".
2014-12-01 17:09:01 +01:00
Lars Magne Ingebrigtsen
d931478266 Fix typo in last checkin
* eww.el (eww-restore-history): Bind
`inhibit-modification-hooks' instead of `after-change-functions'.
2014-11-27 21:26:49 +01:00
Lars Magne Ingebrigtsen
a5fde629ff * net/eww.el (eww-restore-history): Bind `inhibit-modification-hooks'
instead of `after-change-functions'.
2014-11-27 20:28:34 +01:00
Lars Magne Ingebrigtsen
370258f761 (eww-process-text-input): Try to keep track of the size more reliably. 2014-11-27 20:26:31 +01:00
Lars Magne Ingebrigtsen
9ec7bd97fa (eww-mode): Revert mistanken removal of `buffer-disable-undo'. 2014-11-27 17:52:08 +01:00
Lars Magne Ingebrigtsen
7c449b8f0d Add more sanity checks to the last eww after-change-function patch 2014-11-27 17:50:05 +01:00
Lars Magne Ingebrigtsen
604ce9124e (eww-process-text-input): Fix deletion at the start of the field, too. 2014-11-27 17:42:28 +01:00
Lars Magne Ingebrigtsen
5519c34ef8 (eww-restore-history): Inhibit change functions while restoring the history. 2014-11-27 17:23:32 +01:00
Lars Magne Ingebrigtsen
a5b07aa6b5 eww input field fixup
Fixes: debbugs:19085

(eww-process-text-input): Don't shorten the input field if
deleting at the last character.
2014-11-27 17:19:52 +01:00
Lars Magne Ingebrigtsen
4c555e9afa Record the right URL in eww
* net/eww.el (eww): Record the new URL immediately, so that if the
HTTP fetch fails, we have the right URL in the buffer.
2014-11-27 17:06:26 +01:00
Lars Magne Ingebrigtsen
7520f8919a Further eww dom.el cleanups
* net/eww.el (eww-tag-title): Use `dom-text'.

* dom.el (dom-by-tag): Use `equal' for comparisons so that tags
can be strings.
(dom-elements): Protect against non-text nodes.
(dom-non-text-children): New function.
2014-11-26 22:08:52 +01:00
Lars Magne Ingebrigtsen
28653a727e * net/eww.el (eww-highest-readability): More dom.el fixes. 2014-11-26 20:30:59 +01:00
Lars Magne Ingebrigtsen
d9ba097fe4 Use the new dom.el accessors in shr and eww
* net/shr.el: Ditto.

* net/eww.el: Use the new dom.el accessors throughout.
2014-11-26 19:42:29 +01:00
Lars Magne Ingebrigtsen
87ac437437 eww input field fixup
(eww-process-text-input): Inhibit read only so that input fields
don't get shortened (bug#19085).
2014-11-24 18:19:05 +01:00