all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27333: URL History can't handle records
@ 2017-06-11 20:01 Ian Dunn
  2017-06-28 11:42 ` npostavs
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Dunn @ 2017-06-11 20:01 UTC (permalink / raw
  To: 27333

[-- Attachment #1: Type: text/plain, Size: 576 bytes --]


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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff, Size: 544 bytes --]

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")

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
Ian Dunn

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#27333: URL History can't handle records
  2017-06-11 20:01 bug#27333: URL History can't handle records Ian Dunn
@ 2017-06-28 11:42 ` npostavs
  0 siblings, 0 replies; 2+ messages in thread
From: npostavs @ 2017-06-28 11:42 UTC (permalink / raw
  To: Ian Dunn; +Cc: 27333

tags 27333 fixed
close 27333
quit

Ian Dunn <dunni@gnu.org> writes:

> 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))

Fixed in [1: d3a208ea8e], I decided to be a bit more specific and use `url-p' instead of `recordp'.

[1: d3a208ea8e]: 2017-06-28 07:39:05 -0400
  Don't assume url structs are vectors (Bug#27333)
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d3a208ea8e2e3a28fb7d0e30248c7d46e13fc160>





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-28 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-11 20:01 bug#27333: URL History can't handle records Ian Dunn
2017-06-28 11:42 ` npostavs

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.