Gnus development mailing list
 help / color / mirror / Atom feed
From: joakim@verona.se
To: Lars Magne Ingebrigtsen <larsi@gnus.org>
Cc: ding@gnus.org, emacs-devel <emacs-devel@gnu.org>
Subject: Re: eww
Date: Tue, 18 Jun 2013 13:32:19 +0200	[thread overview]
Message-ID: <m338sfr6ws.fsf@exodia.verona.se> (raw)
In-Reply-To: <m31u82jed6.fsf@stories.gnus.org> (Lars Magne Ingebrigtsen's message of "Sun, 16 Jun 2013 16:53:57 +0200")

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> eww probably has a lot of stuff that could still be fixed up, but the
> basics are working now.  That is, you can search for stuff on Google and
> visit Wikipedia.  :-)
>
> I wrote it up a bit here:
>
> http://lars.ingebrigtsen.no/2013/06/eww.html


While you are at it, could you implement something like the patch below?

I use it in the xwidget branch for simplifying browsing in emacs.


diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 695b7a1..1fa52ce 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -667,7 +667,7 @@ regarding its parameter treatment."
 ;; functions allows them to be stand-alone commands, making it easier
 ;; to switch between browsers.
 
-(defun browse-url-interactive-arg (prompt)
+(defun browse-url-interactive-arg (prompt &optional default-url)
   "Read a URL from the minibuffer, prompting with PROMPT.
 If `transient-mark-mode' is non-nil and the mark is active,
 it defaults to the current region, else to the URL at or before
@@ -684,7 +684,8 @@ for use in `interactive'."
 				      "[\t\r\f\n ]+" ""
 				      (buffer-substring-no-properties
 				       (region-beginning) (region-end))))
-				(browse-url-url-at-point)))
+				(browse-url-url-at-point)
+                                default-url))
 	(not (eq (null browse-url-new-window-flag)
 		 (null current-prefix-arg)))))
 
@@ -791,6 +792,13 @@ narrowed."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Browser-independent commands
 
+(defun url-tidy (url)
+  "Tidy up URL as much as possible."
+  (if (equal 0 (string-match ".*://" url))
+      url
+    (concat "http://" url) ;;TODO guess more url forms, like mailto
+    ))
+
 ;; A generic command to call the current browse-url-browser-function
 
 ;;;###autoload
@@ -803,6 +811,7 @@ first, if that exists."
   (interactive (browse-url-interactive-arg "URL: "))
   (unless (called-interactively-p 'interactive)
     (setq args (or args (list browse-url-new-window-flag))))
+  (setq url (url-tidy url))
   (let ((process-environment (copy-sequence process-environment))
 	(function (or (and (string-match "\\`mailto:" url)
 			   browse-url-mailto-function)

-- 
Joakim Verona



  parent reply	other threads:[~2013-06-18 11:32 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-16 14:53 eww Lars Magne Ingebrigtsen
2013-06-16 15:21 ` eww Adam Sjøgren
2013-06-16 15:29   ` eww Lars Magne Ingebrigtsen
2013-06-16 15:46     ` eww Lars Magne Ingebrigtsen
2013-06-16 17:01       ` eww Dmitry Gutov
2013-06-16 17:06         ` eww Lars Magne Ingebrigtsen
2013-06-17 21:00           ` eww Lars Magne Ingebrigtsen
2013-06-17 23:35             ` eww Ted Zlatanov
2013-06-18  0:01               ` eww Lars Magne Ingebrigtsen
2013-07-09 13:20                 ` eww Ted Zlatanov
2013-08-01 14:39                   ` eww Lars Magne Ingebrigtsen
2013-07-09 10:23               ` eww Julien Cubizolles
2013-07-09 10:42                 ` eww David Edmondson
2013-06-16 23:42 ` eww lee
2013-06-17  5:57   ` eww Lars Magne Ingebrigtsen
2013-06-17 18:46     ` eww lee
2013-06-18  2:19 ` eww Tom Tromey
2013-06-18 11:23   ` eww Lars Magne Ingebrigtsen
2013-06-18 14:34     ` eww Tom Tromey
2013-06-18 15:01       ` eww Lars Magne Ingebrigtsen
2013-06-18 15:43         ` eww Tom Tromey
2013-06-18 14:39     ` eww Tom Tromey
2013-06-18 15:14       ` eww Lars Magne Ingebrigtsen
2013-06-18 16:17         ` eww Tom Tromey
2013-06-18 19:06           ` eww Steinar Bang
2013-06-18 19:07     ` eww Stefan Monnier
2013-06-18 11:31   ` eww Lars Magne Ingebrigtsen
2013-06-18 14:42     ` eww Tom Tromey
2013-06-18 15:04       ` eww Lars Magne Ingebrigtsen
2013-06-18 19:13         ` eww Stefan Monnier
2013-06-18 19:17           ` eww Eli Zaretskii
2013-06-18 20:21             ` eww Stefan Monnier
2013-06-18 23:34               ` eww James Cloos
2013-06-19  2:50               ` eww Eli Zaretskii
2013-06-19  4:49                 ` eww Stefan Monnier
2013-06-18 23:03             ` eww Xue Fuqiao
2013-06-19  3:03               ` eww Eli Zaretskii
2013-06-18 19:27           ` eww Tom Tromey
2013-06-18 23:40     ` eww Juri Linkov
2013-06-19  0:51       ` eww Stefan Monnier
2013-06-19  1:08         ` eww Russ Allbery
2013-06-19 10:14           ` eww Rasmus
2013-06-19 10:34         ` eww Christopher Schmidt
2013-06-25  7:43       ` eww lee
2013-06-25  9:05         ` eww Tassilo Horn
2013-06-25 13:27           ` eww Steinar Bang
2013-06-27  9:05           ` eww lee
2013-06-18 11:32 ` joakim [this message]
2013-06-18 12:16   ` eww Andreas Schwab
2013-06-18 13:57   ` eww Lars Magne Ingebrigtsen
2013-06-18 14:01     ` eww joakim
2013-06-19 10:21 ` eww Ivan Kanis
2013-06-19 11:52   ` eww Steinar Bang
2013-06-19 12:14   ` eww Ivan Kanis
2013-08-01 11:59 ` eww John Williams
2013-08-02  0:20   ` eww John Williams
2013-08-02  0:27     ` eww Lars Magne Ingebrigtsen
2013-08-02 19:48       ` eww Richard Stallman
2013-08-03 11:30         ` eww Lars Magne 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=m338sfr6ws.fsf@exodia.verona.se \
    --to=joakim@verona.se \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).