aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-06-12 23:22:22 +0200
committerGravatar Tom Willemse2013-06-12 23:22:22 +0200
commit612189139623bfc6cb45dadee3aeb0f8491d9fc7 (patch)
treea8cc9f342c37908c6409f964aa20975137d29b3b
parent6f5171c1caeb714e690e5f4caa18b16543e01051 (diff)
downloadclark-612189139623bfc6cb45dadee3aeb0f8491d9fc7.tar.gz
clark-612189139623bfc6cb45dadee3aeb0f8491d9fc7.zip
Check bookmark doesn't exist before inserting
The `add' command checks if the given url has been registered before and if so will print a message about this.
-rw-r--r--lisp/clark.lisp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/clark.lisp b/lisp/clark.lisp
index bb28bb3..b84e360 100644
--- a/lisp/clark.lisp
+++ b/lisp/clark.lisp
@@ -196,9 +196,11 @@ bookmark."
Add URL with NAME, DESCRIPTION and TAGS to the database. TAGS may be
omitted or any number of tag names."
- (with-transaction *db*
- (insert-bookmark url name description)
- (add-tags (last-insert-rowid *db*) tags)))
+ (if (not (bookmark-exists-p url))
+ (with-transaction *db*
+ (insert-bookmark url name description)
+ (add-tags (last-insert-rowid *db*) tags))
+ (format t "~A has already been bookmarked~%" url)))
(defcommand edit (url &rest rest)
"Edit a bookmark."