Skip to content

Instantly share code, notes, and snippets.

@terrycojones
Created September 14, 2011 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terrycojones/1215878 to your computer and use it in GitHub Desktop.
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.
(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