From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#19902: 25.0.50; [PATCH] Make eww entry point more info-like Date: Thu, 19 Feb 2015 10:03:50 -0500 Message-ID: <87r3tmymcp.fsf@udel.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424358329 4688 80.91.229.3 (19 Feb 2015 15:05:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Feb 2015 15:05:29 +0000 (UTC) To: 19902@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 19 16:05:17 2015 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 1YOSfD-0000IA-CR for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Feb 2015 16:05:15 +0100 Original-Received: from localhost ([::1]:56667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOSfC-0006xv-J5 for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Feb 2015 10:05:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOSf3-0006tY-KP for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2015 10:05:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOSf0-0002p0-Cd for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2015 10:05:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57501) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOSf0-0002og-9z for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2015 10:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YOSf0-0001e6-1v for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2015 10:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Feb 2015 15:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19902 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14243582576271 (code B ref -1); Thu, 19 Feb 2015 15:05:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Feb 2015 15:04:17 +0000 Original-Received: from localhost ([127.0.0.1]:48741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YOSeE-0001d0-06 for submit@debbugs.gnu.org; Thu, 19 Feb 2015 10:04:17 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37093) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YOSe9-0001cq-30 for submit@debbugs.gnu.org; Thu, 19 Feb 2015 10:04:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOSe5-0002HN-Qg for submit@debbugs.gnu.org; Thu, 19 Feb 2015 10:04:08 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOSe5-0002HI-O8 for submit@debbugs.gnu.org; Thu, 19 Feb 2015 10:04:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOSe1-0006i2-AK for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2015 10:04:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOSds-0002BR-VG for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2015 10:04:01 -0500 Original-Received: from mail-qa0-f42.google.com ([209.85.216.42]:52845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOSds-0002BD-RS for bug-gnu-emacs@gnu.org; Thu, 19 Feb 2015 10:03:52 -0500 Original-Received: by mail-qa0-f42.google.com with SMTP id w8so5994420qac.1 for ; Thu, 19 Feb 2015 07:03:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type; bh=/YWbFN1Dgmw27aieEb4P8gDUrZ1KcaNMpxqSiveehdE=; b=OQJ+QHZZjV0sx/4HmlXIl97HkBmMbMPWUgykr2wlfZjU/X7sLO0cm1wNZ5meA6uAAr MB0FnrFdaqLjvfu/JMehA4oVt+Bcy79iGbRg58m1ANbqVs7loUjETOcVo/YJ4hgD5Lep rjIwG0sd7+stt/x9jkLEjqPk46wEOXwNXISj0kaeKo31WvnwiMXOgWVgyiOC/fJ8HbvJ R3Xyxi+OyOwSxz39S6Z7nNQyPSJUwCLalYGOaLEEFZJADPNAp32oB2zMCuiIwOI2r5nZ eV/Wn203PqroQzGybQ4F5QKgPvqS5MgG1saAaa6WNBXHzcRwsxXrzYBEZOsgWK9Wk3NE COLQ== X-Gm-Message-State: ALoCoQkqUiISPMsYkjb9TL++bzf8gy18rnSi2P12I5rUc6qy6cUK/kOZqjjeTjMU21OHVpFyN0KE X-Received: by 10.140.148.4 with SMTP id 4mr13040872qhu.61.1424358232263; Thu, 19 Feb 2015 07:03:52 -0800 (PST) Original-Received: from holos (c-73-163-124-41.hsd1.md.comcast.net. [73.163.124.41]) by mx.google.com with ESMTPSA id z67sm19872745qgz.10.2015.02.19.07.03.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Feb 2015 07:03:51 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:99596 Archived-At: --- eww already has some info-like behaviour, and I think this is a good thing. An example is isearch in eww. It's weird how M-x eww will always just reset the whole eww session instead of going back to a buried eww buffer. Also, now that eww has a nice way to select instances with S, there should be an easy way to duplicate eww buffers. The way info does this is with clone-buffer, and it makes sense for eww to do the same. With these changes, one can keep eww sessions around without clobbering them every time M-x eww is invoked. Now, one can have multiple eww's, and to get to one of them, either: M-x eww RET S M-N eww RET where M-N is the numeric prefix N. Aside from eww's `S' command for switching sessions, this is very much like how one uses info, and usage feels much smoother and familiar for an Emacs interface. P.S. This (or some other patches I have sitting on the ML) puts my contributions over 15 lines. Paperwork is currently a WIP. lisp/ChangeLog | 6 ++++++ lisp/net/eww.el | 25 ++++++++++++++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 933e5bb..f12889a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-02-19 Mark Oteiza + + * net/eww.el (eww): Behave more like `info' entry point + (eww-fetch): Replaces prior eww function. + (eww-mode-map): More Info-like `M-n' for `clone-buffer' + 2015-02-19 Stefan Monnier * emacs-lisp/smie.el (smie-prec2->grammar): Fix corner case problem. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index b7ee065..ad322ed 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -239,8 +239,7 @@ This list can be customized via `eww-suggest-uris'." (push uri uris))))) (nreverse uris))) -;;;###autoload -(defun eww (url) +(defun eww-fetch (url) "Fetch URL and render the page. If the input doesn't look like an URL or a domain name, the word(s) will be searched for via `eww-search-prefix'." @@ -288,6 +287,23 @@ word(s) will be searched for via `eww-search-prefix'." (url-retrieve url 'eww-render (list url nil (current-buffer)))) +;;;###autoload +(defun eww (&optional url buffer) + "Enter eww, the Emacs Web Wowser. +Optional argument URL specifies the target to navigate; +the default is `eww-search-prefix'. + +In interactive use, a numeric prefix argument of N selects an eww +buffer named \"*eww*\"." + (interactive + (let ((buf (get-buffer (if (numberp current-prefix-arg) + (format "*eww*<%s>" current-prefix-arg) + "*eww*")))) + (list (unless buf (read-string "Enter URL or keywords: ")) + buf))) + (if buffer (pop-to-buffer-same-window buffer) + (eww-fetch url))) + ;;;###autoload (defalias 'browse-web 'eww) ;;;###autoload @@ -624,7 +640,7 @@ the like." (let ((map (make-sparse-keymap))) (set-keymap-parent map special-mode-map) (define-key map "g" 'eww-reload) ;FIXME: revert-buffer-function instead! - (define-key map "G" 'eww) + (define-key map "G" 'eww-fetch) (define-key map [?\t] 'shr-next-link) (define-key map [?\M-\t] 'shr-previous-link) (define-key map [backtab] 'shr-previous-link) @@ -648,8 +664,7 @@ the like." (define-key map "b" 'eww-add-bookmark) (define-key map "B" 'eww-list-bookmarks) - (define-key map [(meta n)] 'eww-next-bookmark) - (define-key map [(meta p)] 'eww-previous-bookmark) + (define-key map [(meta n)] 'clone-buffer) (easy-menu-define nil map "" '("Eww" -- 2.3.0