GNU bug report logs - #20148
24.4: function `bookmark-get-bookmark'

Previous Next

Package: emacs;

Reported by: Boruch Baum <boruch_baum <at> gmx.com>

Date: Fri, 20 Mar 2015 04:44:02 UTC

Severity: wishlist

Tags: fixed

Found in version 24.4

Fixed in version 26.3

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: Boruch Baum <boruch_baum <at> gmx.com>, 20148 <at> debbugs.gnu.org
Subject: bug#20148: 24.4: function `bookmark-get-bookmark'
Date: Thu, 19 Mar 2015 22:04:42 -0700 (PDT)
> Function `bookmark-get-bookmark' ...
> 
> 1] tests for the existence of a bookmark by checking whether the input
> string matches a cons cell. This casts a net much wider than desirable,
> and might better be (assoc bookmark-name-or-record bookmark-alist).

See the actual code.

> 2] returns only a string value on error, without passing nil back to the
> calling function.
> 
> My usage case is that I was scripting a function to find org-mode files
> in a directory tree, and add them to a bookmark list if they aren't
> already bookmarked according to my naming convention. Originally, I had
> tried checking for the existence of a bookmark using a few of the
> bookmark.el functions, such as bookmark-get-bookmark, but that looked
> inconvenient because they returned string values on failure.

See the actual code.

The doc string neglects to mention the optional argument.  It should
say something like this (taken from Bookmark+):

  Non-nil optional arg NOERROR means return nil if BOOKMARK is not a
  valid bookmark.  If NOERROR is nil then raise an error in this case.




This bug report was last modified 5 years and 363 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.