From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Rename `eww' to `web' Date: Sat, 06 Jul 2013 05:31:22 -0400 Message-ID: References: <8738s087wj.fsf@gmail.com> <87bo6mjv4s.fsf@lifelogs.com> <871u7gavwx.fsf@catnip.gol.com> <87obaj39sc.fsf@lifelogs.com> <874ncbhsnv.fsf@gmail.com> <87ip0q1i49.fsf@lifelogs.com> <87r4fczxxd.fsf@lifelogs.com> <87sizsb9bq.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1373103093 11413 80.91.229.3 (6 Jul 2013 09:31:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Jul 2013 09:31:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Jambunathan K Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 06 11:31:33 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UvOq4-00087M-CN for ged-emacs-devel@m.gmane.org; Sat, 06 Jul 2013 11:31:32 +0200 Original-Received: from localhost ([::1]:34104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvOq3-0003AU-Uz for ged-emacs-devel@m.gmane.org; Sat, 06 Jul 2013 05:31:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvOq1-0003AP-N1 for emacs-devel@gnu.org; Sat, 06 Jul 2013 05:31:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UvOpz-00061T-Al for emacs-devel@gnu.org; Sat, 06 Jul 2013 05:31:29 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:54519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvOpz-00061H-6T for emacs-devel@gnu.org; Sat, 06 Jul 2013 05:31:27 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r669VM8u031607; Sat, 6 Jul 2013 05:31:23 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 327A7AE0C1; Sat, 6 Jul 2013 05:31:22 -0400 (EDT) In-Reply-To: <87sizsb9bq.fsf@gmail.com> (Jambunathan K.'s message of "Sat, 06 Jul 2013 09:58:57 +0530") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4630=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4630> : streams <995000> : uri <1468587> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161639 Archived-At: > The magic seems to happen so. > (get operation 'url-file-handlers) > (put 'insert-file-contents 'url-file-handlers 'url-insert-file-contents) > So `url-file-handlers' (actually `url-insert') need to check for > `(mm-handle-media-type handle)' and call one of the handlers (See > `eww-render'). > (cond > ((equal (car content-type) "text/html") > (eww-display-html charset url)) > ((string-match "^image/" (car content-type)) > (eww-display-image)) > (t > (eww-display-raw charset))) The problem is indeed that find-file's code separates the "fetch data" from "setup major mode", so the way it works is fairly different from the way eww works. > Are there any intervening operation between `insert-file-contents' and > `find-file-hook'. > (add-hook 'find-file-hook 'url-handlers-set-buffer-mode) That doesn't sound very reliable. > Btw, url-handler-mode seems to be doing synchronous fetch while eww > seems to do an aynch fetch. Should C-x C-f be "blocking" or can it be > an "asynchronous" C-x C-f? Indeed, that's another important difference. Maybe if we want to invoke eww from C-x C-f we need to do it at a higher level than in insert-file-contents and/or find-file-hook, e.g. something more like find-directory-functions (tho not for directories), and only if find-file is called interactively. Stefan