summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ldg-commodities.el2
-rw-r--r--lisp/ldg-exec.el2
-rw-r--r--lisp/ldg-init.el2
-rw-r--r--lisp/ldg-occur.el2
-rw-r--r--lisp/ldg-post.el26
-rw-r--r--lisp/ldg-reconcile.el16
-rw-r--r--lisp/ldg-report.el9
-rw-r--r--lisp/ldg-test.el14
-rw-r--r--lisp/ldg-texi.el26
9 files changed, 60 insertions, 39 deletions
diff --git a/lisp/ldg-commodities.el b/lisp/ldg-commodities.el
index 004d4f56..c5500785 100644
--- a/lisp/ldg-commodities.el
+++ b/lisp/ldg-commodities.el
@@ -29,7 +29,7 @@
(defcustom ledger-reconcile-default-commodity "$"
"The default commodity for use in target calculations in ledger reconcile."
:type 'string
- :group 'ledger)
+ :group 'ledger-reconcile)
(defun ledger-split-commodity-string (str)
"Split a commoditized amount into two parts"
diff --git a/lisp/ldg-exec.el b/lisp/ldg-exec.el
index af5dd3a8..d62fd419 100644
--- a/lisp/ldg-exec.el
+++ b/lisp/ldg-exec.el
@@ -38,7 +38,7 @@
(defcustom ledger-binary-path "ledger"
"Path to the ledger executable."
:type 'file
- :group 'ledger)
+ :group 'ledger-exec)
(defun ledger-exec-ledger (input-buffer &optional output-buffer &rest args)
"Run Ledger using INPUT-BUFFER and optionally capturing output in OUTPUT-BUFFER with ARGS."
diff --git a/lisp/ldg-init.el b/lisp/ldg-init.el
index fbb4b838..72317088 100644
--- a/lisp/ldg-init.el
+++ b/lisp/ldg-init.el
@@ -24,7 +24,7 @@
(defcustom ledger-init-file-name "~/.ledgerrc"
"Location of the ledger initialization file. nil if you don't have one"
- :group 'ledger)
+ :group 'ledger-exec)
(defvar ledger-environment-alist nil)
diff --git a/lisp/ldg-occur.el b/lisp/ldg-occur.el
index c3f04c5d..1561d6f8 100644
--- a/lisp/ldg-occur.el
+++ b/lisp/ldg-occur.el
@@ -35,7 +35,7 @@
(defconst ledger-occur-overlay-property-name 'ledger-occur-custom-buffer-grep)
(defcustom ledger-occur-use-face-unfolded t
- "If non-nil use a custom face for xacts shown in `ledger-occur' mode."
+ "If non-nil, use a custom face for xacts shown in `ledger-occur' mode using ledger-occur-xact-face."
:type 'boolean
:group 'ledger)
(make-variable-buffer-local 'ledger-occur-use-face-unfolded)
diff --git a/lisp/ldg-post.el b/lisp/ldg-post.el
index 14c3c55f..de28a8a9 100644
--- a/lisp/ldg-post.el
+++ b/lisp/ldg-post.el
@@ -28,7 +28,7 @@
;;; Code:
(defgroup ledger-post nil
- ""
+ "Options for controlling how Ledger-mode deals with postings and completion"
:group 'ledger)
(defcustom ledger-post-auto-adjust-amounts nil
@@ -37,19 +37,17 @@
:group 'ledger-post)
(defcustom ledger-post-amount-alignment-column 52
- "If non-nil, ."
+ "The column Ledger-mode attempts to align amounts to."
:type 'integer
:group 'ledger-post)
-(defcustom ledger-post-use-iswitchb nil
- "If non-nil, ."
- :type 'boolean
- :group 'ledger-post)
-
-(defcustom ledger-post-use-ido nil
- "If non-nil, ."
- :type 'boolean
- :group 'ledger-post)
+(defcustom ledger-post-use-completion-engine :built-in
+ "Which completion engine to use, :iswitchb or :ido chose those engines,
+:built-in uses built-in Ledger-mode completion"
+ :type '(radio (const :tag "built in completion" :built-in)
+ (const :tag "ido completion" :ido)
+ (const :tag "iswitchb completion" :iswitchb) )
+ :group 'ledger-post)
(defun ledger-post-all-accounts ()
"Return a list of all accounts in the buffer."
@@ -73,13 +71,13 @@
PROMPT is a string to prompt with. CHOICES is a list of
strings to choose from."
(cond
- (ledger-post-use-iswitchb
+ ((eq ledger-post-use-completion-engine :iswitchb)
(let* ((iswitchb-use-virtual-buffers nil)
(iswitchb-make-buflist-hook
(lambda ()
(setq iswitchb-temp-buflist choices))))
(iswitchb-read-buffer prompt)))
- (ledger-post-use-ido
+ ((eq ledger-post-use-completion-engine :ido)
(ido-completing-read prompt choices))
(t
(completing-read prompt choices))))
@@ -114,7 +112,7 @@ PROMPT is a string to prompt with. CHOICES is a list of
(defun ledger-next-amount (&optional end)
"Move point to the next amount, as long as it is not past END."
- (when (re-search-forward "\\( \\|\t\\| \t\\)[ \t]*-?\\([A-Z$€£]+ *\\)?\\(-?[0-9,]+?\\)\\(.[0-9]+\\)?\\( *[A-Z$€£]+\\)?\\([ \t]*@@?[^\n;]+?\\)?\\([ \t]+;.+?\\)?$" (marker-position end) t)
+ (when (re-search-forward "\\( \\|\t\\| \t\\)[ \t]*-?\\([A-Z$€£]+ *\\)?\\(-?[0-9,]+?\\)\\(.[0-9]+\\)?\\( *[A-Z$€£]+\\)?\\([ \t]*@@?[^\n;]+?\\)?\\([ \t]+;.+?\\|[ \t]*\\)?$" (marker-position end) t)
(goto-char (match-beginning 0))
(skip-syntax-forward " ")
(- (or (match-end 4)
diff --git a/lisp/ldg-reconcile.el b/lisp/ldg-reconcile.el
index 6a9d05fd..6093f9df 100644
--- a/lisp/ldg-reconcile.el
+++ b/lisp/ldg-reconcile.el
@@ -23,7 +23,7 @@
;;; Commentary:
-;;
+;; Code to handle reconciling Ledger files wiht outside sources
;;; Code:
@@ -32,31 +32,35 @@
(defvar ledger-acct nil)
(defvar ledger-target nil)
+(defgroup ledger-reconcile nil
+ "Options for Ledger-mode reconciliation"
+ :group 'ledger)
+
(defcustom ledger-recon-buffer-name "*Reconcile*"
"Name to use for reconciliation window."
- :group 'ledger)
+ :group 'ledger-reconcile)
(defcustom ledger-fold-on-reconcile t
"If t, limit transactions shown in main buffer to those matching the reconcile regex."
:type 'boolean
- :group 'ledger)
+ :group 'ledger-reconcile)
(defcustom ledger-buffer-tracks-reconcile-buffer t
"If t, then when the cursor is moved to a new xact in the recon window.
Then that transaction will be shown in its source buffer."
:type 'boolean
- :group 'ledger)
+ :group 'ledger-reconcile)
(defcustom ledger-reconcile-force-window-bottom nil
"If t make the reconcile window appear along the bottom of the register window and resize."
:type 'boolean
- :group 'ledger)
+ :group 'ledger-reconcile)
(defcustom ledger-reconcile-toggle-to-pending t
"If true then toggle between uncleared and pending.
reconcile-finish will mark all pending posting cleared."
:type 'boolean
- :group 'ledger)
+ :group 'ledger-reconcile)
(defun ledger-reconcile-get-balances ()
diff --git a/lisp/ldg-report.el b/lisp/ldg-report.el
index 4db58494..0aa91ac0 100644
--- a/lisp/ldg-report.el
+++ b/lisp/ldg-report.el
@@ -28,6 +28,11 @@
(eval-when-compile
(require 'cl))
+(defgroup ledger-report nil
+ "Customization option for the Report buffer"
+ :group 'ledger
+)
+
(defcustom ledger-reports
'(("bal" "ledger -f %(ledger-file) bal")
("reg" "ledger -f %(ledger-file) reg")
@@ -46,7 +51,7 @@ in that variable for more information on the behavior of each
specifier."
:type '(repeat (list (string :tag "Report Name")
(string :tag "Command Line")))
- :group 'ledger)
+ :group 'ledger-report)
(defcustom ledger-report-format-specifiers
'(("ledger-file" . ledger-report-ledger-file-format-specifier)
@@ -58,7 +63,7 @@ specifier."
The function is called with no parameters and expected to return the
text that should replace the format specifier."
:type 'alist
- :group 'ledger)
+ :group 'ledger-report)
(defvar ledger-report-buffer-name "*Ledger Report*")
diff --git a/lisp/ldg-test.el b/lisp/ldg-test.el
index 7667a05e..dbba9546 100644
--- a/lisp/ldg-test.el
+++ b/lisp/ldg-test.el
@@ -19,15 +19,19 @@
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;; MA 02111-1307, USA.
-(defcustom ledger-source-directory "~/src/ledger"
- "Directory where the Ledger sources are located."
- :type 'directory
+(defgroup ledger-test nil
+ "Definitions for the Ledger testing framework"
:group 'ledger)
-(defcustom ledger-test-binary "~/Products/ledger/debug/ledger"
+(defcustom ledger-source-directory "~/ledger/"
"Directory where the Ledger sources are located."
+ :type 'directory
+ :group 'ledger-test)
+
+(defcustom ledger-test-binary "/Products/ledger/debug/ledger"
+ "Directory where the Ledger debug binary is located."
:type 'file
- :group 'ledger)
+ :group 'ledger-test)
(defun ledger-test-org-narrow-to-entry ()
(outline-back-to-heading)
diff --git a/lisp/ldg-texi.el b/lisp/ldg-texi.el
index 53e050ce..84ba34c2 100644
--- a/lisp/ldg-texi.el
+++ b/lisp/ldg-texi.el
@@ -19,9 +19,19 @@
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;; MA 02111-1307, USA.
-(defvar ledger-path "/Users/johnw/bin/ledger")
-(defvar ledger-sample-doc-path "/Users/johnw/src/ledger/doc/sample.dat")
-(defvar ledger-normalization-args "--args-only --columns 80")
+(defgroup ledger-texi nil
+"Options for working on Ledger texi documentation"
+:group 'ledger)
+
+(defcustom ledger-texi-sample-doc-path "~/ledger/doc/sample.dat"
+"Location for sample data to be used in texi tests"
+:type 'file
+:group 'ledger-texi)
+
+(defcustom ledger-texi-normalization-args "--args-only --columns 80"
+"texi normalization for producing ledger output"
+:type 'string
+:group 'ledger-texi)
(defun ledger-update-test ()
(interactive)
@@ -92,10 +102,10 @@
(defun ledger-texi-expand-command (command data-file)
(if (string-match "\\$LEDGER" command)
- (replace-match (format "%s -f \"%s\" %s" ledger-path
- data-file ledger-normalization-args) t t command)
- (concat (format "%s -f \"%s\" %s " ledger-path
- data-file ledger-normalization-args) command)))
+ (replace-match (format "%s -f \"%s\" %s" ledger-binary-path
+ data-file ledger-texi-normalization-args) t t command)
+ (concat (format "%s -f \"%s\" %s " ledger-binary-path
+ data-file ledger-texi-normalization-args) command)))
(defun ledger-texi-invoke-command (command)
(with-temp-buffer (shell-command command t (current-buffer))
@@ -122,7 +132,7 @@
(let ((section (match-string 1))
(example-name (match-string 2))
(command (match-string 3)) expanded-command
- (data-file ledger-sample-doc-path)
+ (data-file ledger-texi-sample-doc-path)
input output)
(goto-char (match-end 0))
(forward-line)