From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.bugs Subject: bug#19226: eww.el desktop support fixes: autoload eww-mode, use inhibit-read-only Date: Sun, 07 Dec 2014 18:56:52 +0000 Message-ID: <87sigrjnkb.fsf@violet.siamics.net> References: <87bnst4fmc.fsf@violet.siamics.net> <87d28j7ajp.fsf@violet.siamics.net> <87bnnpne57.fsf_-_@violet.siamics.net> <87mw78molm.fsf@violet.siamics.net> <87iohvnc51.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1417978701 11507 80.91.229.3 (7 Dec 2014 18:58:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Dec 2014 18:58:21 +0000 (UTC) To: 19226@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 07 19:58:15 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Xxh27-0003HI-68 for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Dec 2014 19:58:15 +0100 Original-Received: from localhost ([::1]:58892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxh26-0008F9-Mw for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Dec 2014 13:58:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxh1z-0008Ew-ES for bug-gnu-emacs@gnu.org; Sun, 07 Dec 2014 13:58:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xxh1v-0004np-3b for bug-gnu-emacs@gnu.org; Sun, 07 Dec 2014 13:58:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxh1u-0004nl-MW for bug-gnu-emacs@gnu.org; Sun, 07 Dec 2014 13:58:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xxh1u-0006wa-Go for bug-gnu-emacs@gnu.org; Sun, 07 Dec 2014 13:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Dec 2014 18:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19226 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 19226-submit@debbugs.gnu.org id=B19226.141797862526627 (code B ref 19226); Sun, 07 Dec 2014 18:58:02 +0000 Original-Received: (at 19226) by debbugs.gnu.org; 7 Dec 2014 18:57:05 +0000 Original-Received: from localhost ([127.0.0.1]:56499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xxh0y-0006vO-QA for submit@debbugs.gnu.org; Sun, 07 Dec 2014 13:57:05 -0500 Original-Received: from fely.am-1.org ([78.47.74.50]:43817) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xxh0w-0006vG-TK for 19226@debbugs.gnu.org; Sun, 07 Dec 2014 13:57:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:Sender:References:Subject:To:From; bh=VJtBWl+WJZ7vrkFwKZbUUsO/gGLeAk0ZLe3Qz6LlUYk=; b=L9gWG/7usmqZ8/P6Oaaz281sdAysH4mr+JY3uV+EjGD358DImX3OLFQr9A5oeDnYL5hit+I8FgNcMH7MQsz3LiYAAaWHbKfFU8XnibG3VDPan12XM+gdbddIoJySaJqwyNjkrfYksuDOi5ByD2cwomKxDDFSMDQKiUngIs6ILfM=; Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Xxh0u-0000AW-OZ for 19226@debbugs.gnu.org; Sun, 07 Dec 2014 18:57:01 +0000 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Xxh0m-0005hw-Mq for 19226@debbugs.gnu.org; Mon, 08 Dec 2014 01:56:52 +0700 Mail-Followup-To: 19226@debbugs.gnu.org In-Reply-To: (Stefan Monnier's message of "Mon, 01 Dec 2014 08:52:01 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96955 Archived-At: >>>>> Stefan Monnier writes: [=E2=80=A6] >> Moreover, =E2=80=9Cgeneral purpose=E2=80=9D modes are ought to be autol= oaded anyway. >> I see no reason to second-guess this case at the least. > I tend to agree. If the major-mode is not autoloaded (as in the eww > case), it's quite likely to be a special major mode that is better > entered via some other function The problem here is that desktop.el should explicitly be pointed to the function to do all the special handling for the mode, which is (conventionally) done like: (add-to-list 'desktop-buffer-mode-handlers '(eww-mode . eww-restore-desktop)) The problem is: to get /that/ evaluated, desktop.el needs to first load eww.el, leading to a chicken and egg problem. The current implementation suggests it to be solved as follows: =E2=80=A2 the major mode is marked as autoloaded; =E2=80=A2 when desktop-read encounters a major mode which is not currently loaded, it loads the respective library (using desktop-load-file, which in turn calls autoload-do-load); =E2=80=A2 that library modifies desktop-buffer-mode-handlers as appropriate (see above.) The following =E2=80=9Cspecial=E2=80=9D modes explicitly document the use = of autoloads to satisfy this desktop.el requirement: $ grep -rF --include=3D\*.el -- needed\ by\ desktop.el lisp/=20 lisp/dired.el:;; Autoload cookie needed by desktop.el lisp/info.el:;; Autoload cookie needed by desktop.el lisp/mh-e/mh-folder.el:;; Autoload cookie needed by desktop.el $=20 The others (doc-view-mode?) do that quietly. And I guess there may be a few (vc-dir-mode?) that fail there. > (e. g. store the URL and recreate the buffer via `eww' which will > take care calling eww-mode (and loading any file that this may > require)). =E2=80=A6 Yet that=E2=80=99s by no means necessary, =E2=80=93 it=E2=80=99s= perfectly possible to invoke M-x eww-mode from just any (empty) buffer, and then use =E2=80=98G=E2=80=99 to point EWW to the Web page of interest. Hence, the trick mentioned in etc/NEWS isn=E2=80=99t necessary, either. *** You can now use several eww buffers in parallel by renaming eww buffers you want to keep separate. --=20 FSF associate member #7257 http://boycottsystemd.org/ =E2=80=A6 3013 B6A0= 230E 334A