Subject: bug#20032: eww: access bookmarks right from the URI prompt

From: Ivan Shmakov <[email-masked]>
Date: Sat, 26 Dec 2015 08:57:41 +0000

>>>>> Lars Ingebrigtsen <[email-masked]> writes:
>>>>> Ivan Shmakov <[email-masked]> writes:

 >> Please consider the revised patch MIMEd.

 >> * lisp/net/eww.el (eww-suggest-uris): Add eww-suggest-bookmarks to
 >> the default value and :options.  (Bug#20032)
 >> (eww-suggested-bookmarks-annotation): New customizable variable.
 >> (eww-suggest-bookmarks, eww-remove-annotation)
 >> (eww-substring-nil-property): New functions.
 >> (eww-suggested-uris, eww): Use eww-remove-annotation.

 > I get a compilation warning after applying the patch...  (The defvar
 > for eww-bookmarks should be moved.)

	Yes.

 > But conceptually I'm not sure this is a good idea.  If you have a
 > bookmarks file, then if you say `M-x eww', you will apparently
 > default to the first entry in the bookmarks file?

	Indeed; unless the point is on a URI, where you’d get that URI
	as the default.

	Speaking of the bookmarks file, eww-suggested-bookmarks is
	missing a eww-read-bookmarks call in that patch.

 > That doesn't seem very helpful.

	Actually, it is: I’ve set the eww-bookmarks variable so that the
	resources I visit the most often are at the top of the list, and
	now I can access them with just a few M-ns, or, for the topmost,
	just RET.

 > It would be OK to have that as the first entry in the `M-n' history,
 > but not as the default.  If I read the code correctly.

	I guess that could be fixed by using a modified version of
	read-string and flagging the values returned by
	eww-suggest-bookmarks in such a way as to never be considered as
	the default by that function.  I doubt that that’s worth the
	effort, however.  (Unless such a function already exists.)

	What bothers me more is that the sheer corpus of contemporary
	software will generally filter the list of bookmarks per the
	search terms typed in by the user first, and only then present
	the result for their respective equivalents of M-n.  Which gets
	handy if your bookmarks (or history, or pretty much anything of
	that kind) number in the hundreds (or more.)  I know of no
	similar facility in the current Emacs, however.

-- 
FSF associate member #7257  http://am-1.org/~ivan/      … 3013 B6A0 230E 334A