1 ;;;_ org2blog/l2r.el --- Persistence for org2blogger
5 ;; Copyright (C) 2010 Tom Breton (Tehom)
7 ;; Author: Tom Breton (Tehom) <tehom@panix.com>
8 ;; Keywords: lisp, internal
10 ;; This file is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; This file is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
22 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 ;; Acquisition functionality for particular modules is in the
28 ;; respective modules (all two of them)
33 (require 'tinydb
/persist
)
37 ;;;_ , Convert links as Atom indicates
39 ;;Should be absolutized (another variable, internal?). And should
40 ;;fetch it on a per-directory basis.
41 (defcustom org2blog-l2r-alist-file
42 "~/.org2blog-local2remote-alist"
43 "File that contains the persisting alist from local filenames to
48 (defvar org2blog-l2r-tq
49 (tinydb-persist-make-q org2blog-l2r-alist-file
'())
50 "Tiny db object for org2blog-l2r" )
52 ;;;_ . org2blog-l2r-remote-url
53 (defun org2blog-l2r-remote-url (path)
54 "Return the persisting translation of PATH."
56 (tinydb-alist-assoc org2blog-l2r-tq
(expand-file-name path
))))
58 ;;;_ . org2blog-l2r-cvt-link
59 (defun org2blog-l2r-cvt-link (opt-plist type path
)
60 "Convert arguments to (type path) list of the remote url."
61 (declare (ignored opt-plist
))
64 (org2blog-l2r-remote-url path
)))
66 (list type cvted-path
))))
68 ;;;_ . org2blog-l2r-store-remote-url
69 (defun org2blog-l2r-store-remote-url (filepath url
)
70 "Persistingly store the translation from FILEPATH to URL."
71 (assert (file-name-absolute-p filepath
) t
)
73 org2blog-l2r-tq filepath
(list url
)))
74 ;;;_ . org2blog-l2r-store-remote-url-yx
76 (defun org2blog-l2r-store-remote-url-yx (url filepath
)
77 "Persistingly store the translation from FILEPATH to URL.
78 An arg-conformant version of `org2blog-l2r-store-remote-url'"
79 (assert (file-name-absolute-p filepath
) t
)
81 org2blog-l2r-tq filepath
(list url
)))
86 (provide 'org2blog
/l2r
)
88 ;;;_ * Local emacs vars.
89 ;;;_ + Local variables:
94 ;;; org2blog/l2r.el ends here