emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 132f447: Hexify strings in EWW search queries


From: Mark Oteiza
Subject: [Emacs-diffs] master 132f447: Hexify strings in EWW search queries
Date: Sun, 3 Sep 2017 20:44:58 -0400 (EDT)

branch: master
commit 132f4472f5f066948e69894bac8ff27430e82012
Author: Mark Oteiza <address@hidden>
Commit: Mark Oteiza <address@hidden>

    Hexify strings in EWW search queries
    
    Previously, inputting "cats & dogs" would lose dogs because the
    ampersand signifies a query parameter.  Instead, hexify each word while
    preserving quotes with split-string.
    * lisp/net/eww.el (eww--dwim-expand-url): Join hexified words together
    with + separators, instead of replacing whitespace with +.
---
 lisp/net/eww.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 2fc36e1..03d9172 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -297,7 +297,8 @@ word(s) will be searched for via `eww-search-prefix'."
                (when (string= (url-filename (url-generic-parse-url url)) "")
                  (setq url (concat url "/"))))
            (setq url (concat eww-search-prefix
-                             (replace-regexp-in-string " " "+" url))))))
+                             (mapconcat
+                              #'url-hexify-string (split-string url) "+"))))))
   url)
 
 ;;;###autoload (defalias 'browse-web 'eww)



reply via email to

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