pkg update and first config fix

org-brain not working, add org-roam
This commit is contained in:
2022-12-19 23:02:34 +01:00
parent 02b3e07185
commit 82f05baffe
885 changed files with 356098 additions and 36993 deletions

View File

@@ -156,7 +156,8 @@ Then one of the elements this function returns will be
(defun ledger-accounts-list-in-buffer ()
"Return a list of all known account names in the current buffer as strings.
Considers both accounts listed in postings and those declared with \"account\" directives."
Considers both accounts listed in postings and those declared
with \"account\" directives."
(let ((accounts (ledger-accounts-in-buffer)))
(when ledger-accounts-exclude-function
(setq accounts (cl-remove-if ledger-accounts-exclude-function accounts)))
@@ -300,7 +301,7 @@ Looks in `ledger-accounts-file' if set, otherwise the current buffer."
(skip-chars-forward "([") ;; for virtual accounts
(setq start (point)))
(setq delete-suffix (save-excursion
(when (search-forward-regexp (rx (or eol (repeat 2 space))) (line-end-position) t)
(when (search-forward-regexp (rx (or eol (or ?\t (repeat 2 space)))) (line-end-position) t)
(- (match-beginning 0) end)))
realign-after t
collection (if ledger-complete-in-steps

View File

@@ -53,7 +53,7 @@
(concat (apply 'concat (mapcar 'ledger-get-regex-str elements)) "[ \t]*$"))
(defmacro ledger-single-line-config (&rest elements)
"Take list of ELEMENTS and return regex and element list for use in context-at-point."
"Take ELEMENTS and return regex and element list for use in context-at-point."
`(list (ledger-line-regex (quote ,elements)) (quote ,elements)))
(defconst ledger-line-config

View File

@@ -59,13 +59,11 @@
(current-buffer)))
(defun ledger-exec-success-p (exit-code ledger-output-buffer)
"Return t if EXIT-CODE is non-zero and output in LEDGER-OUTPUT-BUFFER is successful."
(with-current-buffer ledger-output-buffer
(goto-char (point-min))
(if (or (not (zerop exit-code))
(and (> (buffer-size) 1) (looking-at (regexp-quote "While"))))
nil ;; failure, there is an error starting with "While"
ledger-output-buffer)))
"Return non-nil if EXIT-CODE and LEDGER-OUTPUT-BUFFER indicate success."
(and (zerop exit-code)
(with-current-buffer ledger-output-buffer
(goto-char (point-min))
(not (and (> (buffer-size) 1) (looking-at (regexp-quote "While")))))))
(defun ledger-exec-ledger (input-buffer &optional output-buffer &rest args)
"Run Ledger using INPUT-BUFFER.
@@ -98,7 +96,7 @@ otherwise the error output is displayed and an error is raised."
(delete-file errfile))))
(defun ledger-version-greater-p (needed)
"Verify the ledger binary is usable for `ledger-mode' (version greater than NEEDED)."
"Verify the ledger binary version is at least NEEDED."
(let ((version-strings '()))
(with-temp-buffer
(when (ledger-exec-ledger (current-buffer) (current-buffer) "--version")

View File

@@ -620,8 +620,8 @@ See `font-lock-keywords' for the full description."
"\\(?:[[:blank:]]+\\([^[:blank:]\n]+"
"\\(?:[[:blank:]]+[^[:blank:]\n]+\\)?\\)"
"\\(?:[[:blank:]]+\\(.*?\\)"
"\\(?:\t\\|[ \t]\\{2,\\}\\(.*?\\)"
"\\(?:\t\\|[ \t]\\{2,\\}\\(;.*\\)\\)?\\)?\\)?\\)?$")
"\\(?:\\(?:\t\\|[ \t]\\{2,\\}\\)\\(.*?\\)"
"\\(?:\\(?:\t\\|[ \t]\\{2,\\}\\)\\(;.*\\)\\)?\\)?\\)?\\)?$")
(1 'ledger-font-timeclock-directive-face)
(2 'ledger-font-posting-date-face nil :lax)
(3 (ledger-font-face-by-timeclock-state 1 '(ledger-font-posting-account-cleared-face

View File

@@ -1,6 +1,6 @@
(define-package "ledger-mode" "20211214.1449" "Helper code for use with the \"ledger\" command-line tool"
(define-package "ledger-mode" "20220623.1125" "Helper code for use with the \"ledger\" command-line tool"
'((emacs "25.1"))
:commit "3ec65b8931e8989ac590e95921e46f9e2fac6821")
:commit "8bad528d43007e0310b5e72e6e021b502b30495c")
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@@ -99,14 +99,15 @@ This uses `org-read-date', which see."
(org-read-date nil t nil prompt))))
(defun ledger-get-minibuffer-prompt (prompt default)
"Return a string composing of PROMPT and DEFAULT appropriate for a minibuffer prompt."
"Return a minibuffer prompt string composing PROMPT and DEFAULT."
(concat prompt
(if default
(concat " (" default "): ")
": ")))
(defun ledger-completing-read-with-default (prompt default collection)
"Return a user supplied string after PROMPT, or DEFAULT while providing completions from COLLECTION."
"Return a user-supplied string after PROMPT.
Use the given DEFAULT, while providing completions from COLLECTION."
(completing-read (ledger-get-minibuffer-prompt prompt default)
collection nil nil nil 'ledger-minibuffer-history default))

View File

@@ -1,4 +1,4 @@
This is ledger-mode.info, produced by makeinfo version 6.7 from
This is ledger-mode.info, produced by makeinfo version 7.0.1 from
ledger-mode.texi.
Copyright © 2013, Craig Earls. All rights reserved.
@@ -45,7 +45,7 @@ Overview
Ledger is a command line accounting tool that provides double-entry
accounting based on a text journal. It provides no bells or whistles,
and returns the user to the days before user interfaces were even a
1twinkling in their fathers CRT.
twinkling in their fathers CRT.
Ledger-mode assists you in maintaining input files for Ledger,
running reports and much more...
@@ -247,7 +247,7 @@ several additional commands to ease navigation. M-n and M-p
navigate between next and previous xacts or directives.
Additionally, M-x ledger-navigate-previous-uncleared and M-x
ledger-navigate-next-uncleared navigate to the next and precious
ledger-navigate-next-uncleared navigate to the next and previous
uncleared transactions.

@@ -1487,64 +1487,64 @@ Keystroke Index

Tag Table:
Node: Top1742
Node: Introduction to Ledger-mode2556
Node: Quick Installation2785
Node: Menus3717
Node: Quick Demo4032
Node: Quick Add4462
Node: Reconciliation5560
Node: Reports7244
Node: Narrowing8274
Node: The Ledger Buffer8858
Node: Navigating Transactions9264
Node: Adding Transactions9812
Node: Setting a Transactions Effective Date11311
Node: Quick Balance Display12211
Node: Copying Transactions12743
Node: Editing Amounts13345
Node: Marking Transactions14416
Node: Formatting Transactions16111
Node: Deleting Transactions16709
Node: Sorting Transactions17149
Node: Narrowing Transactions18701
Node: The Reconcile Buffer20551
Node: Basics of Reconciliation21016
Node: Starting a Reconciliation21965
Node: Mark Transactions Pending23814
Node: Edit Transactions During Reconciliation24483
Node: Finalize Reconciliation25126
Node: Adding and Deleting Transactions during Reconciliation25783
Node: Changing Reconciliation Account26367
Node: Changing Reconciliation Target26917
Node: The Report Buffer27235
Node: Running Basic Reports27493
Node: Adding and Editing Reports28926
Node: Expansion Formats30313
Node: Make Report Transactions Active31954
Node: Reversing Report Order32661
Node: Scheduling Transactions33354
Node: Specifying Upcoming Transactions34210
Node: Transactions that occur on specific dates34784
Node: Transactions that occur on specific days35825
Node: Customizing Ledger-mode36954
Node: Ledger-mode Customization37218
Node: Customization Variables37903
Node: Ledger Customization Group38383
Node: Ledger Reconcile Customization Group39023
Node: Ledger Report Customization Group41966
Node: Ledger Faces Customization Group42685
Node: Ledger Post Customization Group44432
Node: Ledger Exec Customization Group45259
Node: Ledger Test Customization Group45758
Node: Ledger Texi Customization Group46160
Node: Generating Ledger Regression Tests46652
Node: Embedding Example results in Ledger Documentation46915
Node: Hacking Ledger-mode47204
Node: Use org-like outlines47429
Node: Concept Index48094
Node: Command & Variable Index53610
Node: Keystroke Index61720
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

End Tag Table

View File

@@ -98,13 +98,13 @@ Requires empty line separating xacts."
(ledger-navigate-end-of-xact))))
(defun ledger-navigate-skip-lines-backwards (re)
"Move backwards if necessary until RE does not match at the beginning of the line."
"Move backwards if necessary until the line beginning does not match RE."
(beginning-of-line)
(while (and (looking-at-p re)
(zerop (forward-line -1)))))
(defun ledger-navigate-skip-lines-forwards (re)
"Move forwards if necessary until RE does not match at the beginning of the line."
"Move forwards if necessary until the line beginning does not match RE."
(beginning-of-line)
(while (and (looking-at-p re)
(zerop (forward-line 1)))))

View File

@@ -52,7 +52,8 @@ This uses `ledger-occur-xact-face'."
(defvar ledger-occur-mode-map (make-sparse-keymap))
(define-minor-mode ledger-occur-mode
"A minor mode which display only transactions matching `ledger-occur-current-regex'."
"A minor mode which display only transactions matching a pattern.
The pattern is given by `ledger-occur-current-regex'."
:init-value nil
:lighter (:eval (format " Ledger-Narrow(%s)" ledger-occur-current-regex))
:keymap ledger-occur-mode-map
@@ -136,7 +137,7 @@ Argument OVL-BOUNDS contains bounds for the transactions to be left visible."
(point-max) ledger-occur-overlay-property-name t))
(defun ledger-occur-find-matches (regex)
"Return a list of 2-number tuples describing the beginning and end of transactions meeting REGEX."
"Return a list of bounds for transactions matching REGEX."
(save-excursion
(goto-char (point-min))
;; Set initial values for variables

View File

@@ -97,7 +97,8 @@ Looks only as far as END, if supplied, otherwise `point-max'."
(ledger-post-align-postings (car bounds) (cadr bounds))))
(defun ledger-post-align-postings (beg end)
"Align all accounts and amounts between BEG and END, or the current region, or, if no region, the current line."
"Align all accounts and amounts between BEG and END.
The current region is used, or, if no region, the current line."
(interactive "r")
(save-match-data
(save-excursion

View File

@@ -127,8 +127,12 @@ no sorting, i.e. using ledger file order."
:group 'ledger-reconcile)
(defcustom ledger-reconcile-insert-effective-date nil
"If t, prompt for effective date when clearing transactions."
:type 'boolean
"If t, prompt for effective date when clearing transactions.
If this is a function, it is called with no arguments with point
at the posting to be cleared. The return value is then used as
described above."
:type '(choice boolean function)
:group 'ledger-reconcile)
(defcustom ledger-reconcile-finish-force-quit nil
@@ -215,6 +219,19 @@ And calculate the target-delta of the account being reconciled."
(car where)
(error "Function ledger-reconcile-get-buffer: Buffer not set")))
(defun ledger-reconcile-insert-effective-date ()
"Prompt for an effective date and insert it at point, if enabled.
If the value of variable `ledger-reconcile-insert-effective-date'
is a function, it is called with the point where the effective
date would be inserted. If it returns non-nil, prompt for an
effective date and insert it at point. If it is not a function,
do the same if its value is non-nil."
(when (if (functionp ledger-reconcile-insert-effective-date)
(save-excursion (funcall ledger-reconcile-insert-effective-date))
ledger-reconcile-insert-effective-date)
(ledger-insert-effective-date)))
(defun ledger-reconcile-toggle ()
"Toggle the current transaction, and mark the recon window."
(interactive)
@@ -229,9 +246,8 @@ And calculate the target-delta of the account being reconciled."
(setq status (ledger-toggle-current (if ledger-reconcile-toggle-to-pending
'pending
'cleared)))
(when ledger-reconcile-insert-effective-date
;; Ask for effective date & insert it
(ledger-insert-effective-date)))
;; Ask for effective date & insert it, if enabled
(ledger-reconcile-insert-effective-date))
;; remove the existing face and add the new face
(remove-text-properties (line-beginning-position)
(line-end-position)
@@ -448,7 +464,8 @@ POSTING is used in `ledger-clear-whole-transactions' is nil."
(nth 2 posting))))) ; amount
(defun ledger-do-reconcile (&optional sort)
"SORT the uncleared transactions in the account and display them in the *Reconcile* buffer.
"SORT the uncleared transactions in the account.
The sorted results are displayed in in the *Reconcile* buffer.
Return a count of the uncleared transactions."
(let* ((buf ledger-buf)
(account ledger-acct)
@@ -480,7 +497,8 @@ Return a count of the uncleared transactions."
(length xacts)))
(defun ledger-reconcile-ensure-xacts-visible ()
"Ensure the last of the visible transactions in the ledger buffer is at the bottom of the main window.
"Ensure the last of the visible transactions in the ledger buffer is visible.
This is achieved by placing that transaction at the bottom of the main window.
The key to this is to ensure the window is selected when the buffer point is
moved and recentered. If they aren't strange things happen."
@@ -497,7 +515,7 @@ moved and recentered. If they aren't strange things happen."
(add-hook 'post-command-hook 'ledger-reconcile-track-xact nil t)))
(defun ledger-reconcile-track-xact ()
"Force the ledger buffer to recenter on the transaction at point in the reconcile buffer."
"Recenter the ledger buffer on the transaction at point in the reconcile buffer."
(if (and ledger-buffer-tracks-reconcile-buffer
(member this-command (list 'next-line
'previous-line

View File

@@ -404,7 +404,7 @@
(concat "^[[:blank:]]+" ; initial white space
"\\(\\([*!]\\)?" ; state and account 1, state 2
"[[:blank:]]*\\(.*?\\)\\)?" ; account 3
"\\(?:\t\\|[[:blank:]]\\{2,\\}" ; column separator
"\\(?:\\(?:\t\\|[[:blank:]]\\{2,\\}\\)" ; column separator
"\\([^;\n]*?\\)" ; amount 4
"[[:blank:]]*\\(;.*\\)?\\)?$" ; comment 5
))

View File

@@ -658,7 +658,7 @@ IGNORE-AUTO and NOCONFIRM are for compatibility with
(ledger-report--change-month 1))
(defun ledger-report-toggle-default-commodity ()
"Add or remove \"--exchange `ledger-reconcile-default-commodity' to the current report."
"Toggle exchange of reported amounts to `ledger-reconcile-default-commodity'."
(interactive)
(unless (derived-mode-p 'ledger-report-mode)
(user-error "Not a ledger report buffer"))

View File

@@ -127,7 +127,8 @@ COUNT 0) means EVERY day-of-week (eg. every Saturday)"
day-of-week)))
(defun ledger-schedule-constrain-every-count-day (day-of-week skip start-date)
"Return a form that is true for every DAY-OF-WEEK skipping SKIP, starting on START-DATE.
"Return a form that is true for every DAY-OF-WEEK.
Skips SKIP, and starts on START-DATE.
For example every second Friday, regardless of month."
(let ((start-day (nth 6 (decode-time start-date))))
(if (eq start-day day-of-week) ;; good, can proceed
@@ -135,7 +136,8 @@ For example every second Friday, regardless of month."
(error "START-DATE day of week doesn't match DAY-OF-WEEK"))))
(defun ledger-schedule-constrain-date-range (month1 day1 month2 day2)
"Return a form of DATE that is true if DATE falls between MONTH1 DAY1 and MONTH2 DAY2."
"Return a form of DATE that is true if DATE falls between two dates.
The dates are given by the pairs MONTH1 DAY1 and MONTH2 DAY2."
(let ((decoded (cl-gensym))
(target-month (cl-gensym))
(target-day (cl-gensym)))
@@ -278,7 +280,8 @@ date descriptor."
(ledger-schedule-constrain-day-in-month count day-of-week)))))
(defun ledger-schedule-list-upcoming-xacts (candidate-items early horizon)
"Search CANDIDATE-ITEMS for xacts that occur within the period today - EARLY to today + HORIZON."
"Search CANDIDATE-ITEMS for xacts that occur within the given period.
The period runs from (today - EARLY) to (today + HORIZON)."
(let ((start-date (time-subtract (current-time) (days-to-time early)))
test-date items)
(cl-loop for day from 0 to (+ early horizon) by 1 do

View File

@@ -59,7 +59,7 @@
(insert "\n; Ledger-mode: End sort\n\n"))
(defun ledger-sort-startkey ()
"Return the actual date so the sort subroutine doesn't sort on the entire first line."
"Return the date portion of the current line, for use in sorting."
(buffer-substring-no-properties (point) (+ 10 (point))))
(defun ledger-sort-region (beg end)

View File

@@ -148,7 +148,8 @@ MOMENT is an encoded date"
:group 'ledger)
(defun ledger-copy-transaction-at-point (date)
"Ask for a new DATE and copy the transaction under point to that date. Leave point on the first amount."
"Ask for a new DATE and copy the transaction under point to that date.
Leave point on the first amount."
(interactive (list
(ledger-read-date "Copy to date: ")))
(let* ((extents (ledger-navigate-find-xact-extents (point)))