From: Vibhav Pant <vibhavp@gmail.com>
To: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: [PATCH][BUG]: eww doesnt trim whitespace from address
Date: Fri, 21 Mar 2014 14:57:37 +0530 [thread overview]
Message-ID: <CA+T2Sh1dq-F0eEpcMgUvC7nPZSF7eAV5zf4QzgwqnBpBop=Kgw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1158 bytes --]
As of now, eww does not rim the user specified address, this often
leads to problems especially if the address is from the clipboard (eww
reports that the service isnt known). Most browsers automatically do
this, so I have included a patch to solve this problem.
This patch simply setq's url to a "trimmed" version of it.
The change is pretty non trivial, so I think it can be included in this release.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index e8eb09c..aa3e245 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -153,6 +153,10 @@ See also `eww-form-checkbox-selected-symbol'."
If the input doesn't look like an URL or a domain name, the
word(s) will be searched for via `eww-search-prefix'."
(interactive "sEnter URL or keywords: ")
+ (setq url (replace-regexp-in-string (rx (or (: bos (* (any " \t\n")))
+ (: (* (any " \t\n")) eos)))
+ ""
+ url))
(cond ((string-match-p "\\`file://" url))
((string-match-p "\\`ftp://" url)
(user-error "FTP is not supported."))
--
Vibhav Pant
vibhavp@gmail.com
[-- Attachment #2: ewwtrim.patch --]
[-- Type: text/x-patch, Size: 717 bytes --]
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index e8eb09c..aa3e245 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -153,6 +153,10 @@ See also `eww-form-checkbox-selected-symbol'."
If the input doesn't look like an URL or a domain name, the
word(s) will be searched for via `eww-search-prefix'."
(interactive "sEnter URL or keywords: ")
+ (setq url (replace-regexp-in-string (rx (or (: bos (* (any " \t\n")))
+ (: (* (any " \t\n")) eos)))
+ ""
+ url))
(cond ((string-match-p "\\`file://" url))
((string-match-p "\\`ftp://" url)
(user-error "FTP is not supported."))
next reply other threads:[~2014-03-21 9:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-21 9:27 Vibhav Pant [this message]
2014-11-03 13:46 ` [PATCH][BUG]: eww doesnt trim whitespace from address Ted Zlatanov
2014-11-03 14:49 ` Yuri Khan
2014-11-04 16:33 ` Ted Zlatanov
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='CA+T2Sh1dq-F0eEpcMgUvC7nPZSF7eAV5zf4QzgwqnBpBop=Kgw@mail.gmail.com' \
--to=vibhavp@gmail.com \
--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.