all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Kanis <ivan@kanis.fr>
To: Lars Magne Ingebrigtsen <larsi@gnus.org>
Cc: Emacs Development List <emacs-devel@gnu.org>
Subject: Re: patches and one bug
Date: Mon, 24 Jun 2013 18:46:50 +0200	[thread overview]
Message-ID: <87a9mflamd.fsf@kanis.fr> (raw)
In-Reply-To: <m3zjufiqaf.fsf@stories.gnus.org> (Lars Magne Ingebrigtsen's message of "Mon, 24 Jun 2013 15:36:40 +0200")

[-- Attachment #1: Type: text/plain, Size: 382 bytes --]

June, 24 at 15:36 Lars Magne Ingebrigtsen wrote:

> First of all, use `url-generic-parse-url' to parse an URL instead of
> using regexps.  Second of all, I don't really see the point.  We'll get
> a redirect, anyway.

My site doesn't redirect. Try:

M-x eww kanis.fr

I am sure I am not the only one ;)

I rewrote the patch with `url-generic-parse-url'.

Does it look good to you?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-add-for-web-site-that-don-t-redirect.patch --]
[-- Type: text/x-diff, Size: 1201 bytes --]

From 18f9f3ba20a76a3f27dc8648391a1b0d720b3402 Mon Sep 17 00:00:00 2001
From: Ivan Kanis <ivan@kanis.fr>
Date: Mon, 24 Jun 2013 18:39:39 +0200
Subject: [PATCH] add / for web site that don't redirect

---
 emacs/misc/eww.el |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/emacs/misc/eww.el b/emacs/misc/eww.el
index 0db84ab..3a8ec0b 100644
--- a/emacs/misc/eww.el
+++ b/emacs/misc/eww.el
@@ -108,8 +108,12 @@ word(s) will be searched for via `eww-search-prefix'."
   (interactive "sEnter URL or keywords: ")
   (if (and (= (length (split-string url)) 1)
            (> (length (split-string url "\\.")) 1))
-      (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url)
-        (setq url (concat "http://" url)))
+      (progn
+        (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url)
+          (setq url (concat "http://" url)))
+        ;; some site don't redirect final /
+        (when (string= (url-filename (url-generic-parse-url url)) "")
+          (setq url (concat url "/"))))
     (unless (string-match-p "^file:" url)
       (setq url (concat eww-search-prefix
                         (replace-regexp-in-string " " "+" url)))))
-- 
1.7.1


  parent reply	other threads:[~2013-06-24 16:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24  9:58 patches and one bug Ivan Kanis
2013-06-24 13:36 ` Lars Magne Ingebrigtsen
2013-06-24 13:43   ` Lars Magne Ingebrigtsen
2013-06-24 14:05   ` Rüdiger Sonderfeld
2013-06-24 17:42     ` Lars Magne Ingebrigtsen
2013-06-24 16:18   ` Ivan Kanis
2013-06-24 17:36     ` Lars Magne Ingebrigtsen
2013-06-24 19:41       ` Ivan Kanis
2013-06-24 19:47         ` Lars Magne Ingebrigtsen
2013-06-25  6:21           ` Ivan Kanis
2013-06-25 19:51             ` Lars Magne Ingebrigtsen
2013-06-25 20:23               ` Ivan Kanis
2013-06-24 16:46   ` Ivan Kanis [this message]
2013-06-24 17:39     ` 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=87a9mflamd.fsf@kanis.fr \
    --to=ivan@kanis.fr \
    --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.
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.