Subject: bug#18010: eww: desktop support

From: Ivan Shmakov <[email-masked]>
Date: Sun, 23 Nov 2014 15:10:26 +0000

>>>>> Lars Magne Ingebrigtsen <[email-masked]> writes:

[…]

 > Could you also write a NEWS entry and possibly write documentation
 > for this?  Either in the eww manual or somewhere in the desktop
 > manual, I guess.

	Please consider the patch MIMEd.

	I was unsure where to put the details of the EWW desktop support
	in eww.texi, so I’ve added them to the end of the “Advanced”
	section, as they’re somewhat obscure and unlikely to require
	much of the user’s attention.

	What may require such attention is, however, the possible use of
	(setq desktop-save-buffer nil) to disable this new feature.

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A
--- a/doc/misc/eww.texi	2014-11-23 10:57:19 +0000
+++ b/doc/misc/eww.texi	2014-11-23 14:57:43 +0000
@@ -219,6 +219,40 @@
 variables @code{shr-color-visible-distance-min} and
 @code{shr-color-visible-luminance-min} to get a better contrast.
 
+@cindex Desktop Support
+@cindex Saving Sessions
+  In addition to maintaining the history at run-time, EWW will also
+save the partial state of its buffers (the URIs and the titles of the
+pages visited) in the desktop file if one is used.  @xref{Saving Emacs
+Sessions, , emacs, The GNU Emacs Manual}
+
+@vindex eww-desktop-remove-duplicates
+  EWW history may sensibly contain multiple entries for the same page
+URI.  At run-time, these entries may still have different associated
+point positions or the actual Web page contents.
+The latter, however, tend to be overly large to preserve in the
+desktop file, so they get omitted, thus rendering the respective
+entries entirely equivalent.  By default, such duplicate entries are
+not saved.  Setting @code{eww-desktop-remove-duplicates} to nil will
+force EWW to save them anyway.
+
+@vindex eww-restore-desktop
+  Restoring EWW buffers' contents may prove to take too long to
+finish.  When the @code{eww-restore-desktop} variable is set to
+@code{nil} (the default), EWW will not try to reload the last visited
+Web page when the buffer is restored from the desktop file, thus
+allowing for faster Emacs start-up times.  When set to @code{t},
+restoring the buffers will also initiate the reloading of such pages.
+
+@vindex eww-restore-reload-prompt
+  The EWW buffer restored from the desktop file but not yet reloaded
+will contain a prompt, as specified by the
+@code{eww-restore-reload-prompt} variable.  The value of this variable
+will be passed through @code{substitute-command-keys} upon each use,
+thus allowing for the use of the usual substitutions, such as
+@code{\[eww-reload]} for the current key binding of the
+@code{eww-reload} command.
+
 @node History and Acknowledgments
 @appendix History and Acknowledgments
 
--- a/etc/NEWS	2014-11-23 10:57:19 +0000
+++ b/etc/NEWS	2014-11-22 19:35:16 +0000
@@ -177,6 +177,9 @@
 *** You can now use several eww buffers in parallel by renaming eww
 buffers you want to keep separate.
 
+*** Partial state of the eww buffers (the URIs and the titles of the
+pages visited) is now preserved in the desktop file.
+
 *** `eww-after-render-hook' is now called after eww has rendered
 the data in the buffer.