Subject: URL History can't handle records

From: Ian Dunn <[email-masked]>
Date: Sun, 11 Jun 2017 16:01:18 -0400

Since the change to records a few months ago, I've seen a bug with `url-history-save-history'.  When I try to run it, I see:

Error running timer ‘url-history-save-history’: (wrong-type-argument stringp #s(url "https" nil nil "duckduckgo.com" nil "/html/?q=emacs" nil nil t nil t))

A backtrace puts it at the `string-match' call in `url-history-save-history'.  I think the problem is that url-history is using a url struct instead of a string, which, according to `url-history-update-url', isn't supposed to be happening.

The following patch should fix this:

diff --git a/lisp/url/url-history.el b/lisp/url/url-history.el
index 1fa085400d..af52d5861e 100644
--- a/lisp/url/url-history.el
+++ b/lisp/url/url-history.el
@@ -106,7 +106,7 @@ to run the `url-history-setup-save-timer' function manually."
 
 (defun url-history-update-url (url time)
   (setq url-history-changed-since-last-save t)
-  (puthash (if (vectorp url) (url-recreate-url url) url) time
+  (puthash (if (recordp url) (url-recreate-url url) url) time
            url-history-hash-table))
 
 (autoload 'url-make-private-file "url-util")

-- 
Ian Dunn