unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: James Cloos <cloos@jhcloos.com>
Subject: lisp/usr/url-history bug in cvs head
Date: Sun, 20 Feb 2005 03:10:56 -0500	[thread overview]
Message-ID: <m3ll9jzm5r.fsf@lugabout.cloos.reno.nv.us> (raw)

I'm running cvs head updated w/in the last 8 hours.

I've been getting backtraces whenever gnus tries to display an html
mail which tries to dl stuff such as images.

The root cause is is url/url-history.el:

First it has:

|> (defvar url-history-hash-table nil
|>   "Hash table for global history completion.")

then, later, 

|> (defun url-have-visited-url (url)
|>   (url-do-setup)
|>   (gethash url url-history-hash-table nil))

whereas the next defun includes this snippet:

|> (defun url-completion-function (string predicate function)
|>   (url-do-setup)
|> ;;; ...
|>    ((eq function 'lambda)
|>     (and url-history-hash-table
|> 	 (gethash string url-history-hash-table)
|> 	 t))

As you can see, url-completion-function confirms that
url-history-hash-table is non-null before calling gethash.
Both functions also call (url-do-setup), so that cannot
be presumed to set url-history-hash-table.

I presume that url-have-visited-url should use (and) as well.
If so, the patch below adds that call.


diff -uNr emacs/lisp/url/url-history.el url-fix/lisp/url/url-history.el
--- a/lisp/url/url-history.el	2004-10-10 16:37:43.000000000 -0400
+++ b/lisp/url/url-history.el	2005-02-20 03:06:19.388079195 -0500
@@ -164,7 +164,8 @@
 
 (defun url-have-visited-url (url)
   (url-do-setup)
-  (gethash url url-history-hash-table nil))
+  (and url-history-hash-table
+       (gethash url url-history-hash-table nil)))
 
 (defun url-completion-function (string predicate function)
   (url-do-setup)


-JimC
-- 
James H. Cloos, Jr. <cloos@jhcloos.com>

                 reply	other threads:[~2005-02-20  8:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ll9jzm5r.fsf@lugabout.cloos.reno.nv.us \
    --to=cloos@jhcloos.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).