From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: EWW improvements: open in new buffer, tags, quickmarks, search engines, ... Date: Thu, 3 May 2018 08:12:08 -0700 (PDT) Message-ID: <5f2060ee-a87e-4e35-b977-af52e00e60b9@default> References: <87zi23bg67.fsf@gmail.com> <87efjd3alj.fsf@gmail.com> <878t9dw3it.fsf@gmail.com> <92db8445-5829-4c34-8c47-9eb6e9c6cbcb@default> <87a7trydmp.fsf@gmail.com> <9d0ffd44-c4ee-4c56-b29a-fb61674588ec@default> <87r2mtqle4.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1525360234 31070 195.159.176.226 (3 May 2018 15:10:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 3 May 2018 15:10:34 +0000 (UTC) Cc: "Charles A. Roelli" , emacs-devel@gnu.org To: Pierre Neidhardt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 03 17:10:30 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fEFsL-0007w2-Pq for ged-emacs-devel@m.gmane.org; Thu, 03 May 2018 17:10:30 +0200 Original-Received: from localhost ([::1]:57174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEFuR-0002UW-9O for ged-emacs-devel@m.gmane.org; Thu, 03 May 2018 11:12:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEFuH-0002TO-J9 for emacs-devel@gnu.org; Thu, 03 May 2018 11:12:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEFuC-0000cc-FH for emacs-devel@gnu.org; Thu, 03 May 2018 11:12:29 -0400 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:59588) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fEFuC-0000bf-4D for emacs-devel@gnu.org; Thu, 03 May 2018 11:12:24 -0400 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w43F5v6F027255; Thu, 3 May 2018 15:12:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=pZD2UJofZi32OqDXQPdk9nNfVKnvyWj5lEB6jgBebQE=; b=Iyia2rwFZWDrrHZ+2JIkeVj2fs7YR6pbWpkUiqqzny6hwj+b1qo3SLFFSa4wi678QjNY LHDqoGyfcVcqYtXG3LivOgq55WyJFCov/oKgooEh6WaBiRHayom26Zfg1GEQwJJQey/X 5TXZSyvwRisKZVmuJb90KMfvqEUNIn0c6DYk/Tl7QLU2dS+l00uznM6+fFeBZ+o3Q+PN vXlbamVipGCdkpnHSX4HMGuC6gsd4mrp6921Qy+g+/cclLXH+dWLbGBFTBsZWPQoQaw6 yUHc/9L97eSUPqitaZAKh1VcoahNCvXnsna7YC6xerfiHtAn0i9eSk2IpXhqxP6SNty8 SA== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2hmeg62ctw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 03 May 2018 15:12:11 +0000 Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w43FCBG8005403 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 May 2018 15:12:11 GMT Original-Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w43FC9EY028210; Thu, 3 May 2018 15:12:11 GMT In-Reply-To: <87r2mtqle4.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4678.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8881 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805030133 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.79 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:225050 Archived-At: > >> 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. >=20 > 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:=20 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'?