emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH][BUG]: eww doesnt trim whitespace from address


From: Vibhav Pant
Subject: [PATCH][BUG]: eww doesnt trim whitespace from address
Date: Fri, 21 Mar 2014 14:57:37 +0530

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
address@hidden

Attachment: ewwtrim.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]