From 765d59771f33f86d1dffa41c90ef67d309528009 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 24 Mar 2013 16:43:32 +0100 Subject: [PATCH] Add clark-set-tags command Replaces the previously added tags. --- clark.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/clark.js b/clark.js index 16d96e7..1304218 100644 --- a/clark.js +++ b/clark.js @@ -197,6 +197,24 @@ function clark_remove(I) { interactive("clark-remove", "Remove the bookmark of the current URL" + " from the database.", clark_remove); +function clark_set_tags(I) { + check_buffer(I.buffer, content_buffer); + + let url_string = + load_spec_uri_string(load_spec(I.buffer.top_frame)); + let tags = yield I.minibuffer.read( + $prompt="tags (comma delimited): " + ); + let command = clark_program + ' set-tags "' + url_string + '" ' + + tags.split(',').map( + function (str) { return "'" + str.trim() + "'"; } + ).join(" "); + let result = yield shell_command(command); + I.window.minibuffer.message("CLark done"); +} +interactive("clark-set-tags", "Replace the tags for the bookmark of" + + " the current URL.", clark_set_tags); + define_keymap("clark_keymap"); define_key(clark_keymap, "?", "clark-exists-p"); @@ -206,5 +224,6 @@ 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"); +define_key(clark_keymap, "t", "clark-set-tags"); provide("clark");