update of packages
This commit is contained in:
@@ -87,7 +87,7 @@ Returns a list with (value commodity)."
|
||||
(t (list 0 ledger-reconcile-default-commodity)))))))
|
||||
|
||||
(defun ledger-string-balance-to-commoditized-amount (str)
|
||||
"Return a commoditized amount (val, 'comm') from STR."
|
||||
"Return a commoditized amount (val, \"comm\") from STR."
|
||||
; break any balances with multi commodities into a list
|
||||
(mapcar #'(lambda (st)
|
||||
(ledger-split-commodity-string st))
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
(defconst ledger-separator-string "\\(\\s-\\s-+\\)")
|
||||
(defconst ledger-amount-string ledger-amount-regexp)
|
||||
(defconst ledger-commoditized-amount-string ledger-commoditized-amount-regexp)
|
||||
(defconst ledger-cost-string ledger-cost-regexp)
|
||||
(defconst ledger-balance-assertion-string ledger-balance-assertion-regexp)
|
||||
(defconst ledger-comment-string "\\(?:[ \t]*\n\\)?[ \t]*;[ \t]*\\(.*?\\)")
|
||||
(defconst ledger-nil-string "\\([ \t]+\\)")
|
||||
@@ -66,7 +67,10 @@
|
||||
(ledger-single-line-config date nil payee comment)
|
||||
(ledger-single-line-config date nil payee)))
|
||||
(list 'acct-transaction (list (ledger-single-line-config indent comment)
|
||||
(ledger-single-line-config indent status nil account separator commoditized-amount nil cost nil balance-assertion)
|
||||
(ledger-single-line-config indent status nil account separator commoditized-amount nil balance-assertion)
|
||||
(ledger-single-line-config indent status nil account separator commoditized-amount nil cost comment)
|
||||
(ledger-single-line-config indent status nil account separator commoditized-amount nil cost)
|
||||
(ledger-single-line-config indent status nil account separator commoditized-amount comment)
|
||||
(ledger-single-line-config indent status nil account separator commoditized-amount)
|
||||
(ledger-single-line-config indent status nil account separator amount)
|
||||
@@ -105,7 +109,7 @@ where the \"users\" point was."
|
||||
(list line-type field fields)))
|
||||
|
||||
(defun ledger-thing-at-point ()
|
||||
"Describe thing at points. Return 'transaction, 'posting, or nil.
|
||||
"Describe thing at points. Return \='transaction, \='posting, or nil.
|
||||
Leave point at the beginning of the thing under point"
|
||||
(let ((here (point)))
|
||||
(goto-char (line-beginning-position))
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
(require 'cl-lib)
|
||||
(require 'flymake)
|
||||
(require 'ledger-exec) ; for `ledger-binary-path'
|
||||
(require 'ledger-report) ; for `ledger-master-file'
|
||||
|
||||
;; To silence byte compiler warnings in Emacs 25 and older:
|
||||
(declare-function flymake-diag-region "flymake" (buffer line &optional col))
|
||||
@@ -66,8 +67,8 @@ Flymake calls this with REPORT-FN as needed."
|
||||
(kill-process ledger--flymake-proc))
|
||||
;; Save the current buffer, the narrowing restriction, remove any
|
||||
;; narrowing restriction.
|
||||
(let ((source (current-buffer))
|
||||
(file (buffer-file-name)))
|
||||
(let* ((source (current-buffer))
|
||||
(file (or (ledger-master-file) (buffer-file-name))))
|
||||
(save-restriction
|
||||
(widen)
|
||||
;; Reset the `ledger--flymake-proc' process to a new process
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(define-package "ledger-mode" "20220623.1125" "Helper code for use with the \"ledger\" command-line tool"
|
||||
(define-package "ledger-mode" "20230925.1013" "Helper code for use with the \"ledger\" command-line tool"
|
||||
'((emacs "25.1"))
|
||||
:commit "8bad528d43007e0310b5e72e6e021b502b30495c")
|
||||
:commit "105d67626e91acb4550ab860e0dc4247c8a4c79e")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
|
||||
@@ -22,7 +22,11 @@
|
||||
;; MA 02110-1301 USA.
|
||||
|
||||
;;; Commentary:
|
||||
;; Most of the general ledger-mode code is here.
|
||||
;; This Emacs library provides a major mode for editing files in the format used
|
||||
;; by the `ledger' command-line accounting system.
|
||||
|
||||
;; It also provides automated support for some `ledger' workflows, such as
|
||||
;; reconciling transactions, or running certain reports.
|
||||
|
||||
;;; Code:
|
||||
|
||||
@@ -156,7 +160,7 @@ And calculate the target-delta of the account being reconciled."
|
||||
(let ((context (car (ledger-context-at-point))))
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(narrow-to-region (point-at-bol) (point-at-eol))
|
||||
(narrow-to-region (line-beginning-position) (line-end-position))
|
||||
(beginning-of-line)
|
||||
(cond ((eq 'xact context)
|
||||
(re-search-forward ledger-iso-date-regexp)
|
||||
@@ -189,7 +193,7 @@ With a prefix argument, remove the effective date."
|
||||
(let* ((context (car (ledger-context-at-point)))
|
||||
(date-string (or date (ledger-read-date "Effective date: "))))
|
||||
(save-restriction
|
||||
(narrow-to-region (point-at-bol) (point-at-eol))
|
||||
(narrow-to-region (line-beginning-position) (line-end-position))
|
||||
(cond
|
||||
((eq 'xact context)
|
||||
(beginning-of-line)
|
||||
@@ -325,7 +329,9 @@ With a prefix argument, remove the effective date."
|
||||
(ledger-init-load-init-file)
|
||||
(setq-local comment-start ";")
|
||||
(setq-local indent-line-function #'ledger-indent-line)
|
||||
(setq-local indent-region-function 'ledger-post-align-postings))
|
||||
(setq-local indent-region-function 'ledger-post-align-postings)
|
||||
(setq-local beginning-of-defun-function #'ledger-navigate-beginning-of-xact)
|
||||
(setq-local end-of-defun-function #'ledger-navigate-end-of-xact))
|
||||
|
||||
;;;###autoload
|
||||
(add-to-list 'auto-mode-alist '("\\.ledger\\'" . ledger-mode))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
This is ledger-mode.info, produced by makeinfo version 7.0.1 from
|
||||
This is ledger-mode.info, produced by makeinfo version 6.8 from
|
||||
ledger-mode.texi.
|
||||
|
||||
Copyright © 2013, Craig Earls. All rights reserved.
|
||||
@@ -1487,64 +1487,64 @@ Keystroke Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top1744
|
||||
Node: Introduction to Ledger-mode2557
|
||||
Node: Quick Installation2786
|
||||
Node: Menus3718
|
||||
Node: Quick Demo4033
|
||||
Node: Quick Add4463
|
||||
Node: Reconciliation5561
|
||||
Node: Reports7245
|
||||
Node: Narrowing8275
|
||||
Node: The Ledger Buffer8859
|
||||
Node: Navigating Transactions9265
|
||||
Node: Adding Transactions9813
|
||||
Node: Setting a Transactions Effective Date11312
|
||||
Node: Quick Balance Display12212
|
||||
Node: Copying Transactions12744
|
||||
Node: Editing Amounts13346
|
||||
Node: Marking Transactions14417
|
||||
Node: Formatting Transactions16112
|
||||
Node: Deleting Transactions16710
|
||||
Node: Sorting Transactions17150
|
||||
Node: Narrowing Transactions18702
|
||||
Node: The Reconcile Buffer20552
|
||||
Node: Basics of Reconciliation21017
|
||||
Node: Starting a Reconciliation21966
|
||||
Node: Mark Transactions Pending23815
|
||||
Node: Edit Transactions During Reconciliation24484
|
||||
Node: Finalize Reconciliation25127
|
||||
Node: Adding and Deleting Transactions during Reconciliation25784
|
||||
Node: Changing Reconciliation Account26368
|
||||
Node: Changing Reconciliation Target26918
|
||||
Node: The Report Buffer27236
|
||||
Node: Running Basic Reports27494
|
||||
Node: Adding and Editing Reports28927
|
||||
Node: Expansion Formats30314
|
||||
Node: Make Report Transactions Active31955
|
||||
Node: Reversing Report Order32662
|
||||
Node: Scheduling Transactions33355
|
||||
Node: Specifying Upcoming Transactions34211
|
||||
Node: Transactions that occur on specific dates34785
|
||||
Node: Transactions that occur on specific days35826
|
||||
Node: Customizing Ledger-mode36955
|
||||
Node: Ledger-mode Customization37219
|
||||
Node: Customization Variables37904
|
||||
Node: Ledger Customization Group38384
|
||||
Node: Ledger Reconcile Customization Group39024
|
||||
Node: Ledger Report Customization Group41967
|
||||
Node: Ledger Faces Customization Group42686
|
||||
Node: Ledger Post Customization Group44433
|
||||
Node: Ledger Exec Customization Group45260
|
||||
Node: Ledger Test Customization Group45759
|
||||
Node: Ledger Texi Customization Group46161
|
||||
Node: Generating Ledger Regression Tests46653
|
||||
Node: Embedding Example results in Ledger Documentation46916
|
||||
Node: Hacking Ledger-mode47205
|
||||
Node: Use org-like outlines47430
|
||||
Node: Concept Index48095
|
||||
Node: Command & Variable Index53611
|
||||
Node: Keystroke Index61721
|
||||
Node: Top1742
|
||||
Node: Introduction to Ledger-mode2555
|
||||
Node: Quick Installation2784
|
||||
Node: Menus3716
|
||||
Node: Quick Demo4031
|
||||
Node: Quick Add4461
|
||||
Node: Reconciliation5559
|
||||
Node: Reports7243
|
||||
Node: Narrowing8273
|
||||
Node: The Ledger Buffer8857
|
||||
Node: Navigating Transactions9263
|
||||
Node: Adding Transactions9811
|
||||
Node: Setting a Transactions Effective Date11310
|
||||
Node: Quick Balance Display12210
|
||||
Node: Copying Transactions12742
|
||||
Node: Editing Amounts13344
|
||||
Node: Marking Transactions14415
|
||||
Node: Formatting Transactions16110
|
||||
Node: Deleting Transactions16708
|
||||
Node: Sorting Transactions17148
|
||||
Node: Narrowing Transactions18700
|
||||
Node: The Reconcile Buffer20550
|
||||
Node: Basics of Reconciliation21015
|
||||
Node: Starting a Reconciliation21964
|
||||
Node: Mark Transactions Pending23813
|
||||
Node: Edit Transactions During Reconciliation24482
|
||||
Node: Finalize Reconciliation25125
|
||||
Node: Adding and Deleting Transactions during Reconciliation25782
|
||||
Node: Changing Reconciliation Account26366
|
||||
Node: Changing Reconciliation Target26916
|
||||
Node: The Report Buffer27234
|
||||
Node: Running Basic Reports27492
|
||||
Node: Adding and Editing Reports28925
|
||||
Node: Expansion Formats30312
|
||||
Node: Make Report Transactions Active31953
|
||||
Node: Reversing Report Order32660
|
||||
Node: Scheduling Transactions33353
|
||||
Node: Specifying Upcoming Transactions34209
|
||||
Node: Transactions that occur on specific dates34783
|
||||
Node: Transactions that occur on specific days35824
|
||||
Node: Customizing Ledger-mode36953
|
||||
Node: Ledger-mode Customization37217
|
||||
Node: Customization Variables37902
|
||||
Node: Ledger Customization Group38382
|
||||
Node: Ledger Reconcile Customization Group39022
|
||||
Node: Ledger Report Customization Group41965
|
||||
Node: Ledger Faces Customization Group42684
|
||||
Node: Ledger Post Customization Group44431
|
||||
Node: Ledger Exec Customization Group45258
|
||||
Node: Ledger Test Customization Group45757
|
||||
Node: Ledger Texi Customization Group46159
|
||||
Node: Generating Ledger Regression Tests46651
|
||||
Node: Embedding Example results in Ledger Documentation46914
|
||||
Node: Hacking Ledger-mode47203
|
||||
Node: Use org-like outlines47428
|
||||
Node: Concept Index48093
|
||||
Node: Command & Variable Index53609
|
||||
Node: Keystroke Index61719
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
@@ -37,12 +37,14 @@
|
||||
(defcustom ledger-post-account-alignment-column 4
|
||||
"The column Ledger-mode attempts to align accounts to."
|
||||
:type 'integer
|
||||
:group 'ledger-post)
|
||||
:group 'ledger-post
|
||||
:safe 'integerp)
|
||||
|
||||
(defcustom ledger-post-amount-alignment-column 52
|
||||
"The column Ledger-mode attempts to align amounts to."
|
||||
:type 'integer
|
||||
:group 'ledger-post)
|
||||
:group 'ledger-post
|
||||
:safe 'integerp)
|
||||
|
||||
(defcustom ledger-post-amount-alignment-at :end
|
||||
"Position at which the amount is aligned.
|
||||
@@ -52,7 +54,8 @@ followed by unaligned commodity) or :decimal to align at the
|
||||
decimal separator."
|
||||
:type '(radio (const :tag "align at the end of amount" :end)
|
||||
(const :tag "align at the decimal separator" :decimal))
|
||||
:group 'ledger-post)
|
||||
:group 'ledger-post
|
||||
:safe (lambda (x) (memq x '(:end :decimal))))
|
||||
|
||||
(defcustom ledger-post-auto-align t
|
||||
"When non-nil, realign post amounts when indenting or completing."
|
||||
@@ -158,7 +161,7 @@ regular text."
|
||||
(t (call-interactively 'ledger-post-align-xact))))
|
||||
|
||||
(defun ledger-post-edit-amount ()
|
||||
"Call 'calc-mode' and push the amount in the posting to the top of stack."
|
||||
"Call `calc-mode' and push the amount in the posting to the top of stack."
|
||||
(interactive)
|
||||
(goto-char (line-beginning-position))
|
||||
(when (re-search-forward ledger-post-line-regexp (line-end-position) t)
|
||||
|
||||
@@ -121,7 +121,7 @@ if string is longer, it is not truncated unless
|
||||
(defcustom ledger-reconcile-sort-key "(0)"
|
||||
"Key for sorting reconcile buffer.
|
||||
|
||||
Possible values are '(date)', '(amount)', '(payee)' or '(0)' for
|
||||
Possible values are \"(date)\", \"(amount)\", \"(payee)\" or \"(0)\" for
|
||||
no sorting, i.e. using ledger file order."
|
||||
:type 'string
|
||||
:group 'ledger-reconcile)
|
||||
@@ -353,8 +353,8 @@ Return the number of uncleared xacts found."
|
||||
|
||||
(defun ledger-reconcile-finish ()
|
||||
"Mark all pending posting or transactions as cleared.
|
||||
Depends on ledger-reconcile-clear-whole-transactions, save the buffers
|
||||
and exit reconcile mode if `ledger-reconcile-finish-force-quit'"
|
||||
Depends on ledger-clear-whole-transactions, save the buffers and
|
||||
exit reconcile mode if `ledger-reconcile-finish-force-quit'"
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
@@ -577,15 +577,16 @@ moved and recentered. If they aren't strange things happen."
|
||||
|
||||
(with-current-buffer rbuf
|
||||
(if (> (ledger-reconcile-refresh) 0)
|
||||
(ledger-reconcile-change-target target))
|
||||
(ledger-display-balance)))))
|
||||
(ledger-reconcile-change-target target)
|
||||
(ledger-display-balance))))))
|
||||
|
||||
(defvar ledger-reconcile-mode-abbrev-table)
|
||||
|
||||
(defun ledger-reconcile-change-target (&optional target)
|
||||
"Change the TARGET amount for the reconciliation process."
|
||||
(interactive)
|
||||
(setq ledger-target (or target (ledger-read-commodity-string ledger-reconcile-target-prompt-string))))
|
||||
(setq ledger-target (or target (ledger-read-commodity-string ledger-reconcile-target-prompt-string)))
|
||||
(ledger-display-balance))
|
||||
|
||||
(defmacro ledger-reconcile-change-sort-key-and-refresh (sort-by)
|
||||
"Set the sort-key to SORT-BY."
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
(defvar ledger-iso-date-regexp)
|
||||
|
||||
(defconst ledger-amount-decimal-comma-regex
|
||||
"-?[1-9][0-9.]*[,]?[0-9]*")
|
||||
"-?\\(?:[1-9][0-9.]\\|0\\)*[,]?[0-9]*")
|
||||
|
||||
(defconst ledger-amount-decimal-period-regex
|
||||
"-?[1-9][0-9,]*[.]?[0-9]*")
|
||||
"-?\\(?:[1-9][0-9,]*\\|0\\)[.]?[0-9]*")
|
||||
|
||||
(defconst ledger-other-entries-regex
|
||||
"\\(^[~=A-Za-z].+\\)+")
|
||||
@@ -192,7 +192,7 @@
|
||||
(group (and num (? num)))
|
||||
(eval sep)
|
||||
(group (and num (? num)))))))
|
||||
"Match a single date, in its 'written' form.")
|
||||
"Match a single date, in its \"written\" form.")
|
||||
|
||||
(ledger-define-regexp full-date
|
||||
(macroexpand
|
||||
@@ -344,7 +344,7 @@
|
||||
(note end-note))
|
||||
|
||||
(defconst ledger-amount-regex
|
||||
(concat "\\( \\|\t\\| \t\\)[ \t]*-?"
|
||||
(concat "\\( \\|\t\\| \t\\)[ \t]*[-+=]? *"
|
||||
"\\(?:" ledger-commodity-regexp " *\\)?"
|
||||
;; We either match just a number after the commodity with no
|
||||
;; decimal or thousand separators or a number with thousand
|
||||
@@ -352,7 +352,7 @@
|
||||
;; or `.', because the match is non-greedy, it must leave at
|
||||
;; least one of those symbols for the following capture
|
||||
;; group, which then finishes the decimal part.
|
||||
"\\(-?\\(?:[0-9]+\\|[0-9,.]+?\\)\\)"
|
||||
"\\([-+=]? *\\(?:[0-9]+\\|[0-9,.]+?\\)\\)"
|
||||
"\\([,.][0-9)]+\\)?"
|
||||
"\\(?: *" ledger-commodity-regexp "\\)?"
|
||||
"\\([ \t]*[@={]@?[^\n;]+?\\)?"
|
||||
@@ -401,12 +401,14 @@
|
||||
))
|
||||
|
||||
(defconst ledger-posting-regex
|
||||
(concat "^[[:blank:]]+" ; initial white space
|
||||
"\\(\\([*!]\\)?" ; state and account 1, state 2
|
||||
"[[:blank:]]*\\(.*?\\)\\)?" ; account 3
|
||||
"\\(?:\\(?:\t\\|[[:blank:]]\\{2,\\}\\)" ; column separator
|
||||
"\\([^;\n]*?\\)" ; amount 4
|
||||
"[[:blank:]]*\\(;.*\\)?\\)?$" ; comment 5
|
||||
(concat "^[[:blank:]]+" ; initial white space
|
||||
;; state and account, subexp 1
|
||||
"\\(\\([*!]\\)?" ; state, subexp 2
|
||||
"[[:blank:]]*\\(.*?\\)\\)?" ; account, subexp 3
|
||||
"\\(?:\\(?:\t\\|[[:blank:]]\\{2,\\}\\)"
|
||||
"\\([^;\n]*?\\)\\)?" ; amount, subexp 4
|
||||
"\\(?:\\(?:\t\\|[[:blank:]]\\{2,\\}\\)"
|
||||
"\\(;.*\\)\\)?$" ; comment, subexp 5
|
||||
))
|
||||
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ used to generate the buffer, navigating the buffer, etc."
|
||||
(defun ledger-report-payee-format-specifier ()
|
||||
"Substitute a payee name.
|
||||
|
||||
The user is prompted to enter a payee and that is substitued. If
|
||||
The user is prompted to enter a payee and that is substituted. If
|
||||
point is in an xact, the payee for that xact is used as the
|
||||
default."
|
||||
;; It is intended completion should be available on existing
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
"Toggle the cleared status of the transaction under point.
|
||||
Optional argument STYLE may be `pending' or `cleared', depending
|
||||
on which type of status the caller wishes to indicate (default is
|
||||
`cleared'). Returns the new status as 'pending 'cleared or nil.
|
||||
`cleared'). Returns the new status as `pending' `cleared' or nil.
|
||||
This function is rather complicated because it must preserve both
|
||||
the overall formatting of the ledger xact, as well as ensuring
|
||||
that the most minimal display format is used. This could be
|
||||
|
||||
@@ -155,9 +155,10 @@ Leave point on the first amount."
|
||||
(let* ((extents (ledger-navigate-find-xact-extents (point)))
|
||||
(transaction (buffer-substring-no-properties (car extents) (cadr extents)))
|
||||
(encoded-date (ledger-parse-iso-date date)))
|
||||
(push-mark)
|
||||
(ledger-xact-find-slot encoded-date)
|
||||
(insert transaction
|
||||
(if ledger-copy-transaction-insert-blank-line-after
|
||||
(if (and ledger-copy-transaction-insert-blank-line-after (not (eobp)))
|
||||
"\n\n"
|
||||
"\n"))
|
||||
(beginning-of-line -1)
|
||||
@@ -169,7 +170,7 @@ Leave point on the first amount."
|
||||
(goto-char (match-beginning 0)))))
|
||||
|
||||
(defun ledger-delete-current-transaction (pos)
|
||||
"Delete the transaction surrounging POS."
|
||||
"Delete the transaction surrounding POS."
|
||||
(interactive "d")
|
||||
(let ((bounds (ledger-navigate-find-xact-extents pos)))
|
||||
(delete-region (car bounds) (cadr bounds)))
|
||||
|
||||
Reference in New Issue
Block a user