summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-03-20 12:24:39 -0700
committerCraig Earls <enderw88@gmail.com>2013-03-20 12:24:39 -0700
commitaa04b392a0b9c543e7796bb1dd89c2ee24abc74a (patch)
tree534ab5adb37a7a582ee258b876850702788a26b4 /lisp
parent17496feda0452bc7add76252534f6239722d3bed (diff)
parent7c6f9005922dc22b257b4acc9b6639f4c5589638 (diff)
downloadfork-ledger-aa04b392a0b9c543e7796bb1dd89c2ee24abc74a.tar.gz
fork-ledger-aa04b392a0b9c543e7796bb1dd89c2ee24abc74a.tar.bz2
fork-ledger-aa04b392a0b9c543e7796bb1dd89c2ee24abc74a.zip
Merge branch 'next' into ledger-mode-automatic-transactions
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ldg-new.el56
1 files changed, 16 insertions, 40 deletions
diff --git a/lisp/ldg-new.el b/lisp/ldg-new.el
index c42e2ef8..8ff95cd3 100644
--- a/lisp/ldg-new.el
+++ b/lisp/ldg-new.el
@@ -91,48 +91,24 @@
(delete-char 3)
(forward-line 1))))))
-(defun ledger-dump-variable (var)
+(defun ledger-mode-dump-variable (var)
(if var
- (insert (format "%s: %S\n" (symbol-name var) (eval var)))))
-
-(defun ledger-mode-dump-variables ()
- (interactive)
- (find-file "ledger-mode-dump")
- (delete-region (point-min) (point-max))
- (insert "Ledger Mode Configuration Dump\n")
- (insert "Date: " (current-time-string) "\n")
- (insert "Emacs: " (version) "\n")
- (insert "System Configuration: "system-configuration "\n")
- (insert "ldg-commodities:\n")
- (ledger-dump-variable 'ledger-reconcile-default-commodity)
- (insert "ldg-exec:\n")
- (ledger-dump-variable 'ledger-works)
- (ledger-dump-variable 'ledger-binary-path)
- (insert "ldg-occur:\n")
- (ledger-dump-variable 'ledger-occur-use-face-unfolded)
- (ledger-dump-variable 'ledger-occur-mode)
- (ledger-dump-variable 'ledger-occur-history)
- (ledger-dump-variable 'ledger-occur-last-match)
- (insert "ldg-post:\n")
- (ledger-dump-variable 'ledger-post-auto-adjust-postings)
- (ledger-dump-variable 'ledger-post-account-alignment-column)
- (ledger-dump-variable 'ledger-post-amount-alignment-column)
- (ledger-dump-variable 'ledger-post-use-completion-engine)
- (insert "ldg-reconcile:\n")
- (ledger-dump-variable 'ledger-recon-buffer-name)
- (ledger-dump-variable 'ledger-fold-on-reconcile)
- (ledger-dump-variable 'ledger-buffer-tracks-reconcile-buffer)
- (ledger-dump-variable 'ledger-reconcile-force-window-bottom)
- (ledger-dump-variable 'ledger-reconcile-toggle-to-pending)
- (insert "ldg-reports:\n")
- (ledger-dump-variable 'ledger-reports)
- (ledger-dump-variable 'ledger-report-format-specifiers)
- (ledger-dump-variable 'ledger-report-buffer-name)
- (insert "ldg-state:")
- (ledger-dump-variable 'ledger-clear-whole-transactions)
- (insert "ldg-xact:\n")
- (ledger-dump-variable 'ledger-highlight-xact-under-point))
+ (insert (format " %s: %S\n" (symbol-name var) (eval var)))))
+(defun ledger-mode-dump-group (group)
+ "Dump GROUP customizations to current buffer"
+ (let ((members (custom-group-members group nil)))
+ (dolist (member members)
+ (cond ((eq (cadr member) 'custom-group)
+ (insert (format "Group %s:\n" (symbol-name (car member))))
+ (ledger-mode-dump-group (car member)))
+ ((eq (cadr member) 'custom-variable)
+ (ledger-mode-dump-variable (car member)))))))
+
+(defun ledger-mode-dump-configuration ()
+ "Dump all customizations"
+ (find-file "ledger-mode-dump")
+ (ledger-mode-dump-group 'ledger))
(provide 'ledger)