Subject: Fix "bookmark.el should raise reasonable error for empty filename entry"

From: Karl Fogel <[email-masked]>
Date: Mon, 05 Oct 2009 00:26:53 -0400

fixed
--

I think this is fixed now, though I'm not positive it was broken in the
first place.  I've made `bookmark-default-handler' raise a catchable
error on entries that have no filename.

But in general, if you're defining your own types of bookmarks, you
should be defining custom handlers for them.  So when you say "I have
code that allows for bookmarks that have no filename", I'm curious to
see that code.  It's impossible, in the general case, for bookmark.el to
tolerate all entries it does not recognize -- a sufficiently bizarre
entry might not even have discernable boundaries, for example.  We must
depend on custom handlers to handle custom data.

Anyway, here's the commit:

  $ cvs ci -F msg lisp/bookmark.el lisp/ChangeLog
  /sources/emacs/emacs/lisp/bookmark.el,v  <--  lisp/bookmark.el
  new revision: 1.131; previous revision: 1.130
  /sources/emacs/emacs/lisp/ChangeLog,v  <--  lisp/ChangeLog
  new revision: 1.16357; previous revision: 1.16356
  Mailing notification to [email-masked]... sent.
  $ 

And this is the log message, so you can get an idea of what I did:

  (bookmark-handle-bookmark): If bookmark has no file,
    don't do anything related to relocating, just return nil. 
  (bookmark-error-no-filename): New error.
  (bookmark-default-handler): Signal `bookmark-error-no-filename' if
    bookmark has no file.  Don't even attempt to handle things that
    are not files; the whole point of custom handlers is to keep that
    knowledge elsewhere anyway.  Tighten some comments.
  (bookmark-file-or-variation-thereof): Remove now-unused function.
  (bookmark-location): Doc string fix.