From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Boruch Baum <boruch_baum@gmx.com>
Cc: 20148@debbugs.gnu.org
Subject: bug#20148: 24.4: function `bookmark-get-bookmark'
Date: Fri, 20 Mar 2015 10:31:51 -0400 [thread overview]
Message-ID: <jwv8ueryc4f.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <550BFEA1.8080100@gmx.com> (Boruch Baum's message of "Fri, 20 Mar 2015 07:04:01 -0400")
Does that mean the bug can be closed?
Stefan
>>>>> "Boruch" == Boruch Baum <boruch_baum@gmx.com> writes:
> Hello Drew. Apology for the inconvenience.
> On 03/20/2015 01:04 AM, Drew Adams wrote:
>>> 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.
> You're right. You could have just said 'line 336, not 335'.
>>
>>> 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.
> Missed that also.
> --
> hkp://keys.gnupg.net
> CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0
next prev parent reply other threads:[~2015-03-20 14:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-20 4:42 bug#20148: 24.4: function `bookmark-get-bookmark' Boruch Baum
2015-03-20 5:04 ` Drew Adams
2015-03-20 11:04 ` Boruch Baum
2015-03-20 14:31 ` Stefan Monnier [this message]
2015-03-20 14:44 ` Boruch Baum
2019-05-26 10:12 ` Stefan Kangas
2019-05-30 12:38 ` Basil L. Contovounesios
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=jwv8ueryc4f.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=20148@debbugs.gnu.org \
--cc=boruch_baum@gmx.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).