summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-12-10 01:58:57 +0100
committerGravatar Tom Willemse2013-12-10 01:58:57 +0100
commit6a9af94b7ac5c2d9e681dbc749e9c9c66ae4e1a7 (patch)
tree58668174f4c704c29411724a0c5fa9257d96978d
parent0d9b8338580ba6ca3537528f74eb16fd8986d026 (diff)
downloadpersistent-outline-6a9af94b7ac5c2d9e681dbc749e9c9c66ae4e1a7.tar.gz
persistent-outline-6a9af94b7ac5c2d9e681dbc749e9c9c66ae4e1a7.zip
Add Version header, docs, genericsHEADmaster
-rw-r--r--persistent-outline.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/persistent-outline.el b/persistent-outline.el
index 9e5d052..1a0bb95 100644
--- a/persistent-outline.el
+++ b/persistent-outline.el
@@ -4,6 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: convenience, outlines
+;; Version: 0.1.0
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -47,8 +48,11 @@
:group 'persistent-outline
:type 'directory)
-(defclass perso-file-local-storage () ())
-(defclass perso-filesystem-storage () ())
+(defclass perso-file-local-storage () ()
+ :documentation
+ "A storage back-end that saves the state in a file-local variable.")
+(defclass perso-filesystem-storage () ()
+ "A storage back-end that saves the state in a dedicated file.")
(defvar perso-outline)
@@ -134,6 +138,9 @@ functions for creating backup and autosave filenames."
(unless (file-exists-p directory)
(make-directory directory :parents))))
+(defgeneric perso-save-to-storage (storage outline)
+ "Tell the storage back-end to save the current outline state.")
+
(defmethod perso-save-to-storage ((storage perso-file-local-storage)
outline)
"Save the current states to a file-local variable."
@@ -150,6 +157,9 @@ functions for creating backup and autosave filenames."
(print outline (current-buffer))
(write-file filename))))
+(defgeneric perso-load-from-storage (storage)
+ "Tell the storage back-end to load the saved outline state.")
+
(defmethod perso-load-from-storage ((storage perso-file-local-storage))
"Load saved states from a file-local variable."
(when (boundp (make-local-variable 'perso-outline))