all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Pierre Neidhardt <ambrevar@gmail.com>
Cc: "Charles A. Roelli" <charles@aurox.ch>, emacs-devel@gnu.org
Subject: RE: EWW improvements: open in new buffer, tags, quickmarks, search engines, ...
Date: Thu, 3 May 2018 08:12:08 -0700 (PDT)	[thread overview]
Message-ID: <5f2060ee-a87e-4e35-b977-af52e00e60b9@default> (raw)
In-Reply-To: <87r2mtqle4.fsf@gmail.com>

> >> As far as I understand, Emacs native bookmarks won't work with EWW.
> >> `M-x bookmark-set' complains the the EWW buffer does not point to a
> >> real file.
> >
> > No, normal Emacs bookmarks do not need a file as
> > target.  Even vanilla Emacs can bookmark Dired and
> > Info nodes (albeit not so well).  A bookmark handler
> > can do anything you want it to do.
> 
> Can you explain how you bookmark an EWW buffer with Emacs
> vanilla bookmarks?

A new type of bookmark needs to be defined, with a handler
that "jumps" to the URL.  Code from Bookmark+ or similar
could be used.

My point was that just to add EWW support for (real)
Emacs bookmarks it's not required to add all of Bookmark+
to Emacs.  All that's needed are to define a format for
the bookmarks and define a hander function to jump to
such a bookmark.

In Bookmark+, the handler function is `bmkp-jump-eww',
and a bookmark with EWW format is made by function
`bmkp-make-eww-record'.

(defun bmkp-make-eww-record ()
  "Make a record for an EWW buffer."
  `(,(bmkp-eww-title)
    (buffer-name . ,(bmkp-eww-new-buffer-name))
    ,@(bookmark-make-record-default 'NO-FILE)
    (location . ,(bmkp-eww-url))
    (handler . bmkp-jump-eww)))

The logic behind jumping to an EWW bookmark, and how
that is hooked into EWW is more complicated - see the
Bookmark+ code for how Bookmark+ does it.

> Besides it does not seem to effectively work with many other modes.  For
> instance, bookmarking a *Help* buffer works at first glance, but Emacs
> fails to look read the bookmarks file upon restart.

Dunno what that means.  But yes, vanilla Emacs needs
to have some support for bookmarking arbitrary buffers,
as does Bookmark+, or else it needs to at least have
support for bookmarking some specific kinds of
bookmarks (*Info*, *Help* or whatever).

But I believe that vanilla Emacs already does have
support for bookmarking some kinds of buffers, such
as Info and Dired.  I don't recall really, but I was
thinking it does when I wrote that.  Emacs added
bookmark field `location', for example, and its value
need not be a file name.

In any case, the infrastructure is there in vanilla
Emacs to do any of this.

My point was: 

1. Bookmark+ is freely available.  It can be
   integrated into Emacs; and it already provides
   EWW support.

2. It's not _necessary_ to integrate Bookmark+ to add
   EWW support to Emacs.  That could be done either
   by just copying the Bookmark+ EWW-support code to
   Emacs or by Emacs rolling its own support.

3. In reply to your statement that vanilla Emacs
   requires that a bookmark target a file I replied
   that I don't think that's true.

   Grepping the Emacs source code for "'location"
   shows only one use of that property, in
   `gnus-summary-bookmark-jump', and I might be
   reading that wrong, so I could be wrong about this.

   There are other ways than property `location' to do
   this, so grepping `location" (no preceding quote')
   might tell more.

   And I see that an Info bookmark records both the
   Info file and the node (so it does record a file
   name).

   Grepping for `bookmark-default-handler' can also
   tell us whether some bookmark types do not record
   a file name.  Maybe `Man-bookmark-jump'?
   `doc-view-bookmark-jump'?



  reply	other threads:[~2018-05-03 15:12 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16 10:26 EWW improvements: open in new buffer, tags, quickmarks, search engines, Pierre Neidhardt
2018-04-16 10:54 ` Lars Ingebrigtsen
2018-04-16 11:18   ` Pierre Neidhardt
2018-04-16 12:08     ` Lars Ingebrigtsen
2018-04-16 12:22       ` Pierre Neidhardt
2018-04-16 12:27         ` Lars Ingebrigtsen
2018-04-16 12:32         ` Lars Ingebrigtsen
2018-04-16 17:55           ` Eli Zaretskii
2018-04-17 11:18 ` Charles A. Roelli
2018-04-17 19:18   ` Pierre Neidhardt
2018-04-24  5:56     ` Pierre Neidhardt
2018-04-24 14:50       ` Lars Ingebrigtsen
2018-04-24 17:57         ` The importance of secrecy (was: EWW improvements: open in new buffer, tags, quickmarks, search engines, ...) Stefan Monnier
2018-04-24 19:45           ` The importance of secrecy John Wiegley
2018-04-24 20:16           ` The importance of secrecy (was: EWW improvements: open in new buffer, tags, quickmarks, search engines, ...) Joost Kremers
2018-04-24 20:53             ` The importance of secrecy Stefan Monnier
2018-04-24 22:40             ` Lars Ingebrigtsen
2018-04-24 22:44               ` Stefan Monnier
2018-04-24 15:58       ` EWW improvements: open in new buffer, tags, quickmarks, search engines, T.V Raman
2018-04-25  6:48         ` Pierre Neidhardt
2018-04-25 15:25           ` T.V Raman
2018-04-25 16:25             ` Pierre Neidhardt
2018-04-25 23:36               ` T.V Raman
2018-04-26 12:46                 ` Stefan Monnier
2018-04-24 16:24       ` Drew Adams
2018-04-25  7:00         ` Pierre Neidhardt
2018-04-25 12:30           ` Lars Ingebrigtsen
2018-04-25 15:29           ` Drew Adams
2018-05-03  6:52             ` Pierre Neidhardt
2018-05-03  6:54             ` Pierre Neidhardt
2018-05-03 15:12               ` Drew Adams [this message]
2018-04-24 16:49       ` Eli Zaretskii
2018-04-25  6:32         ` Pierre Neidhardt
2018-04-25 15:55           ` Eli Zaretskii
2018-04-25 16:13             ` Pierre Neidhardt
2018-04-25 16:19               ` Eli Zaretskii
2018-04-17 19:01 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f2060ee-a87e-4e35-b977-af52e00e60b9@default \
    --to=drew.adams@oracle.com \
    --cc=ambrevar@gmail.com \
    --cc=charles@aurox.ch \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.