emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rename `eww' to `web'


From: Jambunathan K
Subject: Re: Rename `eww' to `web'
Date: Sat, 06 Jul 2013 10:58:02 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Jambunathan K <address@hidden> writes:

> Are there any intervening operation between `insert-file-contents' and
> `find-file-hook'.
>

The answer seems to be `format-decode'r.

How about...

1. Pass the Content Type from HTTP headers to `buffer-file-format'

2. Augment `format-alist' with "text/html" format and make `eww' (or
   shr or whatever) a decoder for it.

The advantage would be that HTML rendering is isolated from URL
retrieval operations.

,----
| (defun format-decode (format length &optional visit-flag)
|   ;; This function is called by insert-file-contents whenever a file is read.
|   "Decode text from any known FORMAT.
| FORMAT is a symbol appearing in `format-alist' or a list of such symbols,
| or nil, in which case this function tries to guess the format of the data by
| matching against the regular expressions in `format-alist'.  After a match is
| found and the region decoded, the alist is searched again from the beginning
| for another match.
| 
| Second arg LENGTH is the number of characters following point to operate on.
| If optional third arg VISIT-FLAG is true, set `buffer-file-format'
| to the reverted list of formats used, and call any mode functions defined
| for those formats.
| 
| Return the new length of the decoded region.
| 
| For most purposes, consider using `format-decode-region' instead."
`----




>    (add-hook 'find-file-hook 'url-handlers-set-buffer-mode)
>
>
> Is `find-file-hook' the right place for a `renderer'? For "multipart"
> buffers are there renderers on a per-part/region basis.  









reply via email to

[Prev in Thread] Current Thread [Next in Thread]