summaryrefslogtreecommitdiff
path: root/lisp/ledger-report.el
diff options
context:
space:
mode:
authorAtheriel <atheriel@gmail.com>2016-07-16 13:33:40 -0400
committerAtheriel <atheriel@gmail.com>2016-07-16 13:44:19 -0400
commit7de71e650717656d0b151dead8cbf12e53061f06 (patch)
treea4c73de64acc1ba30352b7a53a07b94bb370f094 /lisp/ledger-report.el
parent755cdfc0aff064833e263af1df3ccc3661dafe83 (diff)
downloadfork-ledger-7de71e650717656d0b151dead8cbf12e53061f06.tar.gz
fork-ledger-7de71e650717656d0b151dead8cbf12e53061f06.tar.bz2
fork-ledger-7de71e650717656d0b151dead8cbf12e53061f06.zip
Makes links in ledger-report "register" commands optional.
This commit adds a new custom `ledger-report-links-in-register' flag that controls whether `ledger-report' will attempt to link transactions in the report buffer to the entries in the original file. Essentially, it controls whether `ledger-report' will silently pass the "--prepend-format" flag to the binary. The primary motivation for this is that not all implementations of ledger support the "--prepend-format" flag, and thus all "register" commands run by `ledger-report' (and usually _only_ "register" commands) will always fail, because they are treated as a special case in `ledger-do-report'. At present, the user has no ability to prevent the "--prepend-format" flag from being silently passed to the binary. This commit provides that feature. [ci skip]
Diffstat (limited to 'lisp/ledger-report.el')
-rw-r--r--lisp/ledger-report.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ledger-report.el b/lisp/ledger-report.el
index 67e738ab..a577e067 100644
--- a/lisp/ledger-report.el
+++ b/lisp/ledger-report.el
@@ -82,6 +82,12 @@ text that should replace the format specifier."
:type 'boolean
:group 'ledger-report)
+(defcustom ledger-report-links-in-register t
+ "When non-nil, attempt to link transactions in \"register\"
+reports to their location in the currrent ledger file buffer."
+ :type 'boolean
+ :group 'ledger-report)
+
(defvar ledger-report-buffer-name "*Ledger Report*")
(defvar ledger-report-name nil)
@@ -337,11 +343,12 @@ Optional EDIT the command."
;; --subtotal does not produce identifiable transactions, so don't
;; prepend location information for them
(if (and register-report
+ ledger-report-links-in-register
(not (string-match "--subtotal" cmd)))
(concat cmd " --prepend-format='%(filename):%(beg_line):'")
cmd)
t nil)
- (when register-report
+ (when (and register-report ledger-report-links-in-register)
(goto-char data-pos)
(while (re-search-forward "^\\(/[^:]+\\)?:\\([0-9]+\\)?:" nil t)
(let ((file (match-string 1))