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

Patch: Supporting More Characters in Queries in emacspeak-bookshare.el



Hi,
Right now, if you use an apostrophe in any bookshare query (like if a title or an author's name has an apostrophe), emacspeak will fail to fetch the response. This is because the apostrophe is not percent-encoded with `url-encode-url'.
A function that does this better is `url-hexify-string`. I changed emacspeak to use that instead. Below is the patch:
1 file changed, 3 insertions(+), 3 deletions(-)
lisp/emacspeak-bookshare.el | 6 +++---

modified   lisp/emacspeak-bookshare.el
@@ -426,7 +426,7 @@ Interactive prefix arg filters search by category."
 Interactive prefix arg filters search by category."
   (interactive
    (list
-    (url-encode-url
+    (url-hexify-string
      (read-from-minibuffer "Title: "))
     current-prefix-arg))
   (cond
@@ -445,12 +445,12 @@ Interactive prefix arg filters search by category."
 (defun emacspeak-bookshare-title/author-search (query)
   "Perform a Bookshare title/author  search."
   (interactive "sTitle/Author: ")
-  (emacspeak-bookshare-api-call "book/searchTA" query))
+  (emacspeak-bookshare-api-call "book/searchTA" (url-hexify-string query)))
 
 (defun emacspeak-bookshare-fulltext-search (query)
   "Perform a Bookshare fulltext search."
   (interactive "sFulltext Search: ")
-  (emacspeak-bookshare-api-call "book/searchFTS" query))
+  (emacspeak-bookshare-api-call "book/searchFTS" (url-hexify-string query)))
 
 (defun emacspeak-bookshare-since-search (query &optional category)
   "Perform a Bookshare date  search.



|May 1995 - Last Year |Current Year|


If you have questions about this archive or had problems using it, please contact us.

Contact Info Page