aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2013-03-24 16:30:52 +0100
committerGravatar Tom Willemsen2013-03-24 16:30:52 +0100
commit2b090c652e019460c80a6889c7c9f69e2613601a (patch)
treedb43791c7c7f3e5ddf94e905609e8d3ab9d74ecb
parent4ebf6ce650b687ed49e428ddb69178c7cc81dc9a (diff)
downloadclark-2b090c652e019460c80a6889c7c9f69e2613601a.tar.gz
clark-2b090c652e019460c80a6889c7c9f69e2613601a.zip
Add clark-remove command
Removes the current url from the database.
-rw-r--r--js/clark.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/clark.js b/js/clark.js
index 3620f7e..16d96e7 100644
--- a/js/clark.js
+++ b/js/clark.js
@@ -185,6 +185,18 @@ function clark_exists_p(I) {
interactive("clark-exists-p", "Check to see if the current url"
+ " exists in the database.", clark_exists_p);
+function clark_remove(I) {
+ check_buffer(I.buffer, content_buffer);
+
+ let url_string =
+ load_spec_uri_string(load_spec(I.buffer.top_frame));
+ let command = clark_program + ' remove "' + url_string + '"';
+ let result = yield shell_command(command);
+ I.window.minibuffer.message("CLark done");
+}
+interactive("clark-remove", "Remove the bookmark of the current URL"
+ + " from the database.", clark_remove);
+
define_keymap("clark_keymap");
define_key(clark_keymap, "?", "clark-exists-p");
@@ -193,5 +205,6 @@ define_key(clark_keymap, "A", "clark-add-link");
define_key(clark_keymap, "e", "clark-edit");
define_key(clark_keymap, "f", "clark-find-url");
define_key(clark_keymap, "F", "clark-find-url-new-buffer");
+define_key(clark_keymap, "r", "clark-remove");
provide("clark");