update packages

This commit is contained in:
2026-06-27 11:34:21 +02:00
parent 4be4f859c4
commit 1aaef48596
246 changed files with 7997 additions and 4359 deletions

View File

@@ -69,7 +69,8 @@
;; one will ever have an account named "e342asd2131". If
;; someones does, this will probably still work for them.
;; I should only highlight error and warning lines.
"ledger bal e342asd2131 --strict --explicit "
(format "%s bal e342asd2131 --strict --explicit "
(shell-quote-argument ledger-binary-path))
t nil)
(goto-char data-pos)
@@ -88,7 +89,7 @@
(point-marker))))))
(add-text-properties (line-beginning-position) (line-end-position)
(list 'font-lock-face 'ledger-font-report-clickable-face))
(setq have-warnings 'true)
(setq have-warnings t)
(end-of-line))))
(if (not have-warnings)
(insert "No errors or warnings reported."))))

View File

@@ -84,7 +84,7 @@ If nil, full account names are offered for completion."
(sort (delete-dups payees-list) #'string-lessp)))
(defun ledger-payees-list ()
"Return a list of all known account names as strings.
"Return a list of all known payees as strings.
Looks in `ledger-payees-file' if set, otherwise the current buffer."
(if ledger-payees-file
(let ((f ledger-payees-file))
@@ -355,9 +355,6 @@ an alist (ACCOUNT-ELEMENT . NODE)."
(when (and realign-after ledger-post-auto-align)
(ledger-post-align-postings (line-beginning-position) (line-end-position)))))))))
(defun ledger-trim-trailing-whitespace (str)
(replace-regexp-in-string "[ \t]*$" "" str))
(defun ledger-comments-list ()
"Collect comments from the buffer."
(let ((comments '()))
@@ -379,7 +376,7 @@ Interactively, if point is after a payee, complete the
transaction with the details from the last transaction to that
payee."
(interactive)
(let* ((name (ledger-trim-trailing-whitespace
(let* ((name (string-trim-right
(buffer-substring
(save-excursion
(unless (eq (ledger-thing-at-point) 'transaction)

View File

@@ -183,31 +183,40 @@ specified line, returns nil."
(ledger-context-at-point)))))
(defun ledger-context-line-type (context-info)
"Return the line-type symbol component of CONTEXT-INFO."
(nth 0 context-info))
(defun ledger-context-current-field (context-info)
"Return the symbol naming the field at point in CONTEXT-INFO."
(nth 1 context-info))
(defun ledger-context-field-info (context-info field-name)
"Return the (FIELD VALUE POSITION) cell for FIELD-NAME in CONTEXT-INFO."
(assoc field-name (nth 2 context-info)))
(defun ledger-context-field-present-p (context-info field-name)
"Return non-nil if FIELD-NAME is present in CONTEXT-INFO."
(not (null (ledger-context-field-info context-info field-name))))
(defun ledger-context-field-value (context-info field-name)
"Return the string value of FIELD-NAME in CONTEXT-INFO."
(nth 1 (ledger-context-field-info context-info field-name)))
(defun ledger-context-field-position (context-info field-name)
"Return the buffer position of FIELD-NAME's start in CONTEXT-INFO."
(nth 2 (ledger-context-field-info context-info field-name)))
(defun ledger-context-field-end-position (context-info field-name)
"Return the buffer position one past FIELD-NAME's end in CONTEXT-INFO."
(+ (ledger-context-field-position context-info field-name)
(length (ledger-context-field-value context-info field-name))))
(defun ledger-context-goto-field-start (context-info field-name)
"Move point to the start of FIELD-NAME in CONTEXT-INFO."
(goto-char (ledger-context-field-position context-info field-name)))
(defun ledger-context-goto-field-end (context-info field-name)
"Move point one past the end of FIELD-NAME in CONTEXT-INFO."
(goto-char (ledger-context-field-end-position context-info field-name)))
(provide 'ledger-context)

View File

@@ -35,6 +35,9 @@
(defvar ledger-works nil
"Non-nil if the ledger binary can support `ledger-mode' interactive features.")
(defvar ledger-exec--args-only nil
"Internal variable, used for testing.")
(defgroup ledger-exec nil
"Interface to the Ledger command-line accounting program."
:group 'ledger)
@@ -90,6 +93,8 @@ otherwise the error output is displayed and an error is raised."
(append (list (point-min) (point-max)
ledger-binary-path nil (list outbuf errfile) nil "-f" "-")
(list "--date-format" ledger-default-date-format)
(when ledger-exec--args-only
(list "--args-only"))
args)))))
(if (ledger-exec-success-p exit-code outbuf)
outbuf

View File

@@ -33,10 +33,6 @@
(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))
(declare-function flymake-make-diagnostic "flymake" (buffer beg end type text &optional data overlay-properties))
(defvar-local ledger--flymake-proc nil)
(defcustom ledger-flymake-be-pedantic nil
@@ -114,14 +110,14 @@ Flymake calls this with REPORT-FN as needed."
(group-n 1 "Error: " (one-or-more not-newline) "\n"))
nil t)
for msg = (match-string 1)
for (beg . end) = (flymake-diag-region
source
(string-to-number (match-string 2)))
for type = :error
for region = (flymake-diag-region
source
(string-to-number (match-string 2)))
when region
collect (flymake-make-diagnostic source
beg
end
type
(car region)
(cdr region)
:error
msg)
into diags
finally (funcall report-fn diags)))
@@ -134,11 +130,9 @@ Flymake calls this with REPORT-FN as needed."
;;;###autoload
(defun ledger-flymake-enable ()
"Enable `flymake-mode' in `ledger-mode' buffers."
(unless (> emacs-major-version 25)
(error "Ledger-flymake requires Emacs version 26 or higher"))
;; Add `ledger-flymake' to `flymake-diagnostic-functions' so that flymake can
;; work in ledger-mode:
(add-hook 'flymake-diagnostic-functions 'ledger-flymake nil t)
(add-hook 'flymake-diagnostic-functions #'ledger-flymake nil t)
(flymake-mode))
(provide 'ledger-flymake)

View File

@@ -307,7 +307,8 @@
(defface ledger-font-N-symbol-face
`((t :inherit default))
"Face for symbol in N directives")
"Face for symbol in N directives"
:group 'ledger-faces)
(defface ledger-font-payee-directive-face
`((t :inherit ledger-font-directive-face))

View File

@@ -27,7 +27,9 @@
;;; Code:
(defcustom ledger-init-file-name "~/.ledgerrc"
"Location of the ledger initialization file. nil if you don't have one."
"Location of the ledger initialization file.
nil if you don't have one or don't wish to read it."
:type '(choice (const :tag "Do not read ledger initialization file" nil)
file)
:group 'ledger-exec)

View File

@@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; lexical-binding: nil -*-
(define-package "ledger-mode" "20251219.2350"
(define-package "ledger-mode" "20260609.609"
"Helper code for use with the \"ledger\" command-line tool."
'((emacs "26.1"))
:url "https://github.com/ledger/ledger-mode"
:commit "40e6a167530e21968e3ce7b8cb74e7595cb6009a"
:revdesc "40e6a167530e")
:commit "b0ee99feb2dcae5e304ad735d82d488f2191a51c"
:revdesc "b0ee99feb2dc")

View File

@@ -4,9 +4,10 @@
;; This file is not part of GNU Emacs.
;; Package-Version: 20251219.2350
;; Package-Revision: 40e6a167530e
;; Package-Version: 20260609.609
;; Package-Revision: b0ee99feb2dc
;; Package-Requires: ((emacs "26.1"))
;; URL: https://github.com/ledger/ledger-mode
;; This is free software; you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free
@@ -70,7 +71,7 @@
(defun ledger-mode-dump-variable (var)
"Format VAR for dump to buffer."
(if var
(insert (format " %s: %S\n" (symbol-name var) (eval var)))))
(insert (format " %s: %S\n" (symbol-name var) (symbol-value var)))))
(defun ledger-mode-dump-group (group)
"Dump GROUP customizations to current buffer."
@@ -156,12 +157,10 @@ the balance into that."
(ledger-exec-ledger buffer (current-buffer) "stats")
(buffer-substring-no-properties (point-min) (1- (point-max))))))
(when balance
(message balance))))
(message "%s" balance))))
(defvar ledger-mode-abbrev-table)
(defvar ledger-date-string-today (ledger-format-date))
;;; Editing commands
@@ -386,7 +385,9 @@ With prefix ARG, decrement by that many instead."
(define-key map (kbd "C-c C-o C-a") #'ledger-report-redo)
(define-key map (kbd "C-c C-o C-e") #'ledger-report-edit-report)
(define-key map (kbd "C-c C-o C-g") #'ledger-report-goto)
;; `C-g' is reserved as the universal quit key, so use `C-v' (visit) for
;; ledger-report-goto instead.
(define-key map (kbd "C-c C-o C-v") #'ledger-report-goto)
(define-key map (kbd "C-c C-o C-k") #'ledger-report-quit)
(define-key map (kbd "C-c C-o C-r") #'ledger-report)
(define-key map (kbd "C-c C-o C-s") #'ledger-report-save)
@@ -399,7 +400,7 @@ With prefix ARG, decrement by that many instead."
(define-key map (kbd "S-<down>") #'ledger-date-down)
;; Reset the `text-mode' override of this standard binding
(define-key map (kbd "C-M-i") 'completion-at-point)
(define-key map (kbd "C-M-i") #'completion-at-point)
map)
"Keymap for `ledger-mode'.")
@@ -447,11 +448,11 @@ With prefix ARG, decrement by that many instead."
(define-derived-mode ledger-mode text-mode "Ledger"
"A mode for editing ledger data files."
(ledger-check-version)
(setq font-lock-defaults
'(ledger-font-lock-keywords t nil nil nil))
(add-hook 'font-lock-extend-region-functions 'ledger-fontify-extend-region)
(setq-local font-lock-defaults
'(ledger-font-lock-keywords t nil nil nil))
(add-hook 'font-lock-extend-region-functions #'ledger-fontify-extend-region nil t)
(add-hook 'completion-at-point-functions #'ledger-complete-at-point nil t)
(add-hook 'after-save-hook 'ledger-report-redo nil t)
(add-hook 'after-save-hook 'ledger-report-redo-after-save nil t)
(add-hook 'post-command-hook 'ledger-highlight-xact-under-point nil t)
(add-hook 'before-revert-hook 'ledger-highlight--before-revert nil t)

View File

@@ -153,25 +153,27 @@ Argument OVL-BOUNDS contains bounds for the transactions to be left visible."
(when-let* ((endpoint (re-search-forward regex nil 'end))
(bounds (ledger-navigate-find-element-extents endpoint)))
(push bounds lines)
;; move to the end of the xact, no need to search inside it more
(goto-char (cadr bounds))))
;; Move to the end of the xact, no need to search inside it more.
;; Defensive: if extent end is at or before point, advance past the
;; match end so the loop can never wedge.
(goto-char (max (cadr bounds) (1+ (match-end 0))))))
(nreverse lines))))
(defun ledger-occur-compress-matches (buffer-matches)
"Identify sequential xacts to reduce number of overlays required.
BUFFER-MATCHES should be a list of (BEG END) lists."
(if buffer-matches
(let ((points (list))
(current-beginning (caar buffer-matches))
(current-end (cl-cadar buffer-matches)))
(dolist (match (cdr buffer-matches))
(if (< (- (car match) current-end) 2)
(setq current-end (cadr match))
(push (list current-beginning current-end) points)
(setq current-beginning (car match))
(setq current-end (cadr match))))
(nreverse (push (list current-beginning current-end) points)))))
(when buffer-matches
(let ((points (list))
(current-beginning (caar buffer-matches))
(current-end (cl-cadar buffer-matches)))
(dolist (match (cdr buffer-matches))
(if (< (- (car match) current-end) 2)
(setq current-end (cadr match))
(push (list current-beginning current-end) points)
(setq current-beginning (car match))
(setq current-end (cadr match))))
(nreverse (push (list current-beginning current-end) points)))))
(provide 'ledger-occur)

View File

@@ -156,8 +156,10 @@ described above."
:type 'boolean
:group 'ledger-reconcile)
(defvar-local ledger-reconcile-last-balance-message nil)
(defvar-local ledger-reconcile-last-balance-equals-target nil)
(defvar-local ledger-reconcile-last-balance-message nil
"Most recent cleared/pending balance line, displayed in the reconcile header.")
(defvar-local ledger-reconcile-last-balance-equals-target nil
"Non-nil when the most recent balance equals the reconciliation target.")
(defface ledger-reconcile-last-balance-equals-target-face
'((t :inherit (header-line success)))

View File

@@ -40,7 +40,7 @@
"\\(^[~=A-Za-z].+\\)+")
(defconst ledger-comment-regex
"^[;#|\\*%].*\\|[ \t]+;.*")
"^[;#|*%].*\\|[ \t]+;.*")
(defconst ledger-multiline-comment-start-regex
"^!comment$")
@@ -87,12 +87,6 @@
(defconst ledger-account-name-or-directive-regex
(format "\\(?:%s\\|%s\\)" ledger-account-any-status-regex ledger-account-directive-regex))
(defconst ledger-account-pending-regex
(concat "\\(^[ \t]+\\)!" ledger-account-name-maybe-virtual-regex))
(defconst ledger-account-cleared-regex
(concat "\\(^[ \t]+\\)*" ledger-account-name-maybe-virtual-regex))
(defmacro ledger-define-regexp (name regex docs &rest args)
"Simplify the creation of a Ledger regex and helper functions."
(let* ((regex (eval regex))

View File

@@ -1,4 +1,4 @@
;; ledger-report.el --- Helper code for use with the "ledger" command-line tool -*- lexical-binding: t; -*-
;;; ledger-report.el --- Helper code for use with the "ledger" command-line tool -*- lexical-binding: t; -*-
;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
@@ -32,6 +32,7 @@
(declare-function ledger-read-string-with-default "ledger-mode" (prompt default))
(declare-function ledger-read-account-with-prompt "ledger-mode" (prompt))
(declare-function ledger-read-payee-with-prompt "ledger-mode" (prompt))
(declare-function ledger-read-date "ledger-mode" (prompt))
(require 'easymenu)
(require 'ansi-color)
@@ -70,6 +71,8 @@ specifier."
("payee" . ledger-report-payee-format-specifier)
("account" . ledger-report-account-format-specifier)
("month" . ledger-report-month-format-specifier)
("amount" . ledger-report-amount-format-specifier)
("date" . ledger-report-date-format-specifier)
("tagname" . ledger-report-tagname-format-specifier)
("tagvalue" . ledger-report-tagvalue-format-specifier))
"An alist mapping ledger report format specifiers to implementing functions.
@@ -162,7 +165,12 @@ Calls `shrink-window-if-larger-than-buffer'."
(defvar ledger-report-buffer-name "*Ledger Report*")
(defvar-local ledger-report-name nil)
(defvar-local ledger-report-cmd nil)
(defvar-local ledger-report-cmd nil
"The raw command template for the current ledger report buffer.
Format specifiers such as %(binary) and %(ledger-file) are left
unexpanded and resolved at execution time in `ledger-do-report',
so the current values of `ledger-binary-path' and the ledger file
take effect on each run.")
(defvar-local ledger-report-saved nil)
(defvar-local ledger-report-current-month nil)
(defvar-local ledger-report-is-reversed nil)
@@ -193,10 +201,11 @@ See documentation for the function `ledger-master-file'")
(save-excursion
(reverse-region (point) (point-max)))))
(defun ledger-report-maybe-shrink-window ()
"Shrink window if `ledger-report-resize-window' is non-nil."
(defun ledger-report-maybe-shrink-window (buf)
"Shrink window displaying BUF if `ledger-report-resize-window' is non-nil."
(when ledger-report-resize-window
(shrink-window-if-larger-than-buffer)))
(when-let* ((w (get-buffer-window buf)))
(shrink-window-if-larger-than-buffer w))))
(defvar ledger-report-mode-map
(let ((map (make-sparse-keymap)))
@@ -237,7 +246,7 @@ See documentation for the function `ledger-master-file'")
(define-derived-mode ledger-report-mode special-mode "Ledger-Report"
"A mode for viewing ledger reports."
(setq-local revert-buffer-function #'ledger-report-redo)
(setq-local revert-buffer-function #'ledger-report--revert-buffer)
(hack-dir-local-variables-non-file-buffer))
(defconst ledger-report--extra-args-marker "[[ledger-mode-flags]]")
@@ -259,6 +268,14 @@ See documentation for the function `ledger-master-file'")
;; values, but it remains to be implemented.
(ledger-read-string-with-default "Tag Value" nil))
(defun ledger-report-amount-format-specifier ()
"Return a commoditized amount."
(ledger-commodity-to-string (ledger-read-commodity-string "Amount")))
(defun ledger-report-date-format-specifier ()
"Return a date."
(ledger-read-date "Date: "))
(defun ledger-report-read-name ()
"Read the name of a ledger report to use, with completion.
@@ -305,7 +322,7 @@ used to generate the buffer, navigating the buffer, etc."
(with-silent-modifications
(erase-buffer)
(ledger-do-report ledger-report-cmd))
(ledger-report-maybe-shrink-window)
(ledger-report-maybe-shrink-window (current-buffer))
(run-hooks 'ledger-report-after-report-hook)
(message (substitute-command-keys (concat "\\[ledger-report-quit] to quit; "
"\\[ledger-report-redo] to redo; "
@@ -339,7 +356,7 @@ returns nil."
(defun ledger-report-read-command (report-cmd)
"Read the command line to create a report from REPORT-CMD."
(read-from-minibuffer "Report command line: "
(if (null report-cmd) "ledger " report-cmd)
(if (null report-cmd) "%(binary) " report-cmd)
nil nil 'ledger-report-cmd-prompt-history))
(defun ledger-report-ledger-file-format-specifier ()
@@ -416,7 +433,7 @@ MONTH is of the form (YEAR . INDEX) where INDEX ranges from
(defun ledger-report-month-format-specifier ()
"Substitute current month."
(with-current-buffer (or ledger-report-buffer-name (current-buffer))
(with-current-buffer ledger-report-buffer-name
(let* ((month (or ledger-report-current-month (ledger-report--current-month)))
(year (car month))
(month-index (cdr month)))
@@ -427,7 +444,9 @@ MONTH is of the form (YEAR . INDEX) where INDEX ranges from
Format specifiers are defined in the
`ledger-report-format-specifiers' alist. The functions are
called in the ledger buffer for which the report is being run."
called in the ledger buffer for which the report is being run.
This function must be called from a report buffer."
(let ((ledger-buf ledger-report-ledger-buf))
(with-temp-buffer
(save-excursion (insert report-cmd))
@@ -465,13 +484,19 @@ called in the ledger buffer for which the report is being run."
(defun ledger-report-cmd (report-name edit)
"Get the command line to run the report name REPORT-NAME.
Optionally EDIT the command."
Optionally EDIT the command.
The returned command retains its format specifiers (e.g., %(binary)
and %(ledger-file)) so that `ledger-do-report' can expand them each
time the report runs. This keeps saved reports in `ledger-reports'
responsive to later changes in `ledger-binary-path' or the current
ledger file, rather than baking in the values observed when the
report was first run."
(let ((report-cmd (car (cdr (assoc report-name ledger-reports)))))
;; logic for substitution goes here
(when (or (null report-cmd) edit)
(setq report-cmd (ledger-report-read-command report-cmd))
(setq ledger-report-saved nil)) ;; this is a new report, or edited report
(setq report-cmd (ledger-report-expand-format-specifiers report-cmd))
(setq ledger-report-cmd report-cmd)
(or (string-empty-p report-name)
(ledger-report-name-exists report-name)
@@ -491,7 +516,7 @@ Optionally EDIT the command."
(previous-month (ledger-report--shift-month current-month shift)))
(setq ledger-report-current-month previous-month)
(ledger-report-cmd ledger-report-name nil)
(ledger-report-redo)))
(revert-buffer)))
(defun ledger-report--add-links ()
"Replace file and line annotations with buttons."
@@ -518,16 +543,19 @@ Optionally EDIT the command."
(defun ledger-do-report (cmd)
"Run a report command line CMD.
CMD may contain a (shell-quoted) version of
`ledger-report--extra-args-marker', which will be replaced by
arguments returned by `ledger-report--compute-extra-args'."
CMD may contain format specifiers (e.g., %(binary), %(ledger-file))
which are expanded via `ledger-report-expand-format-specifiers'
each time the report runs. It may also contain a (shell-quoted)
version of `ledger-report--extra-args-marker', which will be
replaced by arguments returned by `ledger-report--compute-extra-args'."
(goto-char (point-min))
(let* ((marker ledger-report--extra-args-marker)
(let* ((expanded-cmd (ledger-report-expand-format-specifiers cmd))
(marker ledger-report--extra-args-marker)
(marker-re (concat " *" (regexp-quote marker)))
(args (ledger-report--compute-extra-args cmd))
(args (ledger-report--compute-extra-args expanded-cmd))
(args-str (concat " " (mapconcat #'shell-quote-argument args " ")))
(clean-cmd (replace-regexp-in-string marker-re "" cmd t t))
(real-cmd (replace-regexp-in-string marker-re args-str cmd t t)))
(clean-cmd (replace-regexp-in-string marker-re "" expanded-cmd t t))
(real-cmd (replace-regexp-in-string marker-re args-str expanded-cmd t t)))
(setq header-line-format
(and ledger-report-use-header-line
`(:eval (ledger-report--compute-header-line ,clean-cmd))))
@@ -541,7 +569,7 @@ arguments returned by `ledger-report--compute-extra-args'."
(setq report (ansi-color-apply report)))
(save-excursion
(insert report))
(when (ledger-report--cmd-needs-links-p cmd)
(when (ledger-report--cmd-needs-links-p expanded-cmd)
(save-excursion
(ledger-report--add-links))))))
@@ -571,31 +599,42 @@ specific posting at point instead."
(if (not rbuf)
(error "There is no ledger report buffer"))
(pop-to-buffer rbuf)
(ledger-report-maybe-shrink-window)))
(ledger-report-maybe-shrink-window rbuf)))
(defun ledger-report-redo (&optional _ignore-auto _noconfirm)
"Redo the report in the current ledger report buffer.
(defun ledger-report-redo-after-save ()
"If `ledger-report-auto-refresh' is non-nil, redo the report buffer.
This is intended to be added to `after-save-hook' by `ledger-mode'."
(when (and ledger-report-auto-refresh
(get-buffer ledger-report-buffer-name))
(with-current-buffer ledger-report-buffer-name
(revert-buffer))))
(defun ledger-report--revert-buffer (&optional _ignore-auto _noconfirm)
"Redo the report in the current buffer.
IGNORE-AUTO and NOCONFIRM are for compatibility with
`revert-buffer-function' and are currently ignored."
(when (buffer-live-p ledger-report-ledger-buf)
(setq ledger-report-cursor-line-number (line-number-at-pos))
(with-silent-modifications
(erase-buffer)
(ledger-do-report ledger-report-cmd)
(when ledger-report-is-reversed
(ledger-report-reverse-lines))
(when ledger-report-auto-refresh-sticky-cursor
(forward-line (- ledger-report-cursor-line-number 5))))
(ledger-report-maybe-shrink-window (current-buffer))
(run-hooks 'ledger-report-after-report-hook)))
(defun ledger-report-redo ()
"Redo the report in the ledger report buffer."
(interactive)
(unless (or (derived-mode-p 'ledger-mode)
(derived-mode-p 'ledger-report-mode))
(user-error "Not in a ledger-mode or ledger-report-mode buffer"))
(let ((cur-buf (current-buffer)))
(when (and ledger-report-auto-refresh
(get-buffer ledger-report-buffer-name))
(pop-to-buffer (get-buffer ledger-report-buffer-name))
(ledger-report-maybe-shrink-window)
(setq ledger-report-cursor-line-number (line-number-at-pos))
(with-silent-modifications
(erase-buffer)
(ledger-do-report ledger-report-cmd)
(when ledger-report-is-reversed
(ledger-report-reverse-lines))
(when ledger-report-auto-refresh-sticky-cursor
(forward-line (- ledger-report-cursor-line-number 5))))
(run-hooks 'ledger-report-after-report-hook)
(pop-to-buffer cur-buf))))
(when (get-buffer ledger-report-buffer-name)
(with-current-buffer ledger-report-buffer-name
(revert-buffer))))
(defun ledger-report-quit ()
"Quit the ledger report buffer and kill its buffer."
@@ -614,8 +653,11 @@ IGNORE-AUTO and NOCONFIRM are for compatibility with
(defun ledger-report-edit-report ()
"Edit the current report command in the mini buffer and re-run the report."
(interactive)
(setq ledger-report-cmd (ledger-report-read-command ledger-report-cmd))
(ledger-report-redo))
(unless (derived-mode-p 'ledger-report-mode)
(user-error "Not a ledger report buffer"))
(with-current-buffer ledger-report-buffer-name
(setq ledger-report-cmd (ledger-report-read-command ledger-report-cmd))
(revert-buffer)))
(define-obsolete-function-alias 'ledger-report-select-report #'ledger-report "ledger 4.0.0")
@@ -673,7 +715,7 @@ IGNORE-AUTO and NOCONFIRM are for compatibility with
(setq ledger-report-cmd (replace-match "" nil nil ledger-report-cmd))
(setq ledger-report-cmd (concat ledger-report-cmd
" --exchange " ledger-reconcile-default-commodity))))
(ledger-report-redo))
(revert-buffer))
(provide 'ledger-report)

View File

@@ -74,11 +74,6 @@ abbreviation for a day and the number of that day in the week."
:type '(alist :key-type string :value-type (group integer))
:group 'ledger-schedule)
(defsubst ledger-between (val low high)
"Return TRUE if VAL >= LOW and <= HIGH."
(declare (obsolete <= "Ledger-mode v4.0.1"))
(<= low val high))
(defun ledger-schedule-days-in-month (month year)
"Return number of days in the MONTH, MONTH is from 1 to 12.
If YEAR is nil, assume it is not a leap year"
@@ -142,8 +137,8 @@ The dates are given by the pairs MONTH1 DAY1 and MONTH2 DAY2."
(target-month (gensym))
(target-day (gensym)))
`(let* ((,decoded (decode-time date))
(,target-month (nth 4 decoded))
(,target-day (nth 3 decoded)))
(,target-month (nth 4 ,decoded))
(,target-day (nth 3 ,decoded)))
(and (and (> ,target-month ,month1)
(< ,target-month ,month2))
(and (> ,target-day ,day1)