diff options
author | Craig Earls <enderw88@gmail.com> | 2014-01-01 13:26:19 -0800 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2014-01-01 13:26:19 -0800 |
commit | 876cfa1f78d4c036332f3d918a88817fe72353e4 (patch) | |
tree | acc405b9370387e21c4a97c3e74776dda8cdcb39 /lisp/ledger-mode.el | |
parent | c00e4eb8c69c5e55a3283cf692df2146c6bc8d9f (diff) | |
parent | e00ed8c77039eb3bee1c4ad70a4c3adb5eb922c9 (diff) | |
download | fork-ledger-876cfa1f78d4c036332f3d918a88817fe72353e4.tar.gz fork-ledger-876cfa1f78d4c036332f3d918a88817fe72353e4.tar.bz2 fork-ledger-876cfa1f78d4c036332f3d918a88817fe72353e4.zip |
Merge pull request #227 from 4ourbit/patch-2
More context-aware ledger pcomplete rules.
Thanks.
Diffstat (limited to 'lisp/ledger-mode.el')
-rw-r--r-- | lisp/ledger-mode.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el index 28856bd4..0d683168 100644 --- a/lisp/ledger-mode.el +++ b/lisp/ledger-mode.el @@ -145,6 +145,11 @@ Can indent, complete or align depending on context." (defvar ledger-mode-abbrev-table) +(defvar ledger-date-string-today + (format-time-string (or + (cdr (assoc "date-format" ledger-environment-alist)) + ledger-default-date-format))) + (defun ledger-remove-effective-date () "Removes the effective date from a transaction or posting." (interactive) @@ -153,7 +158,7 @@ Can indent, complete or align depending on context." (save-restriction (narrow-to-region (point-at-bol) (point-at-eol)) (beginning-of-line) - (cond ((eq 'xact context) + (cond ((eq 'pmnt-transaction context) (re-search-forward ledger-iso-date-regexp) (when (= (char-after) ?=) (let ((eq-pos (point))) @@ -187,7 +192,7 @@ With a prefix argument, remove the effective date. " (save-restriction (narrow-to-region (point-at-bol) (point-at-eol)) (cond - ((eq 'xact context) + ((eq 'pmnt-transaction context) (beginning-of-line) (re-search-forward ledger-iso-date-regexp) (when (= (char-after) ?=) @@ -320,7 +325,7 @@ With a prefix argument, remove the effective date. " 'ledger-parse-arguments) (set (make-local-variable 'pcomplete-command-completion-function) 'ledger-complete-at-point) - (set (make-local-variable 'pcomplete-termination-string) "") + (add-to-list 'completion-at-point-functions 'pcomplete-completions-at-point) (add-hook 'post-command-hook 'ledger-highlight-xact-under-point nil t) (add-hook 'before-revert-hook 'ledger-occur-remove-all-overlays nil t) |