Created
September 14, 2011 04:53
-
-
Save terrycojones/1215878 to your computer and use it in GitHub Desktop.
Emacs lisp for saving the region as a clipboard into Fluidinfo, retrieving & inserting, or deleting it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'fluiddb) | |
(setq *fluiddb-credentials* '("terrycojones" . "SECRET")) | |
(defun insert-clipboard (who) | |
(interactive "sInsert the clipboard of which user? ") | |
(let* | |
((user (if (equal who "") (car *fluiddb-credentials*) who)) | |
(tag (format "%s/clipboard" user)) | |
(result (fluiddb-query-objects-tag-values (format "has %s" tag) (list tag)))) | |
(insert (cdr (car (cdr (car (cdr (car (cdr (car (cdr (car (car (cdr result))))))))))))))) | |
(defun clear-clipboard (who) | |
(interactive "sClear the clipboard of which user? ") | |
(let | |
((tag (format "%s/clipboard" (if (equal who "") (car *fluiddb-credentials*) who)))) | |
(fluiddb-delete-objects-tag-values (format "has %s" tag) (list tag)))) | |
(defun set-clipboard (who) | |
(interactive "sSet the region as the clipboard of which user? ") | |
(let* | |
((user (if (equal who "") (car *fluiddb-credentials*) who)) | |
(tag (format "%s/clipboard" user))) | |
(clear-clipboard user) | |
(fluiddb-set-object-about-tag-value user tag (buffer-substring (region-beginning) (region-end))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment