emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/clipboard-collector 1b96653 06/31: Use C-c C-c binding


From: Stefan Monnier
Subject: [elpa] externals/clipboard-collector 1b96653 06/31: Use C-c C-c binding
Date: Sun, 6 Jan 2019 17:16:19 -0500 (EST)

branch: externals/clipboard-collector
commit 1b966538f7edfecbb7d88b771fb70296ff671644
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>

    Use C-c C-c binding
---
 README.org             | 17 ++++++++++++++++-
 clipboard-collector.el | 10 ++++++----
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 80489bb..d595275 100644
--- a/README.org
+++ b/README.org
@@ -12,7 +12,6 @@ contact information from a website for org capture (contact 
info gets
 transformed to be used as property drawer items).
 
 
-
 #+BEGIN_SRC elisp
 (clipboard-collector-create cc-capture-rss
  (("^http.*twitter.com"                           ":TWITTER: %s")
@@ -27,3 +26,19 @@ transformed to be used as property drawer items).
    (clipboard-collector-finish-default items)
    (org-capture-finalize)))
 #+END_SRC
+
+This creates a command called =cc-capture-rss=. When called the clipboard is
+observed and on changes which match one of the regexes, the clipboard contents
+are transformed via the format string. It's also possible to provide an
+additional function to transform the contents before applying the format 
string.
+
+When done you can press =C-c C-c= to call the finalize function (in the above
+example it would inserts the collected items and finish the org-capture).
+
+If you would like to simply collect items as they are and paste them at some 
other
+place afterwards you could use:
+
+#+BEGIN_SRC elisp
+(clipboard-collector-create cc-all
+ ((".*"  "%s")))
+#+END_SRC
diff --git a/clipboard-collector.el b/clipboard-collector.el
index a18408b..19f6d66 100644
--- a/clipboard-collector.el
+++ b/clipboard-collector.el
@@ -102,6 +102,11 @@ the matched regex.")
 
 (defvar clipboard-collector--timer nil)
 
+(defvar clipboard-collector-mode-map
+  (let ((map (make-sparse-keymap)))
+    (prog1 map
+      (define-key map (kbd "C-c C-c") 'clipboard-collector-finish))))
+
 (define-minor-mode clipboard-collector-mode
   "This mode is for internal use only.
 
@@ -126,10 +131,7 @@ clipboard contents."
   (message "Start collecting, finish with %s."
            (substitute-command-keys "\\[clipboard-collector-finish]")))
 
-(defvar clipboard-collector-mode-map
-  (let ((map (make-sparse-keymap)))
-    (prog1 map
-      (define-key map "\r" 'clipboard-collector-finish))))
+
 
 
 (defun clipboard-collector-stop-watch ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]