[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/beancount 687775da63 088/103: Minor refactoring of region
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/beancount 687775da63 088/103: Minor refactoring of region commands (with no expected functionality changes). |
Date: |
Mon, 29 Apr 2024 15:59:48 -0400 (EDT) |
branch: elpa/beancount
commit 687775da63784d153a3c1cfee9801090c6b51842
Author: blais <blais@furius.ca>
Commit: blais <blais@furius.ca>
Minor refactoring of region commands (with no expected functionality
changes).
---
beancount.el | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/beancount.el b/beancount.el
index 76b878eea0..c3f5614ec4 100644
--- a/beancount.el
+++ b/beancount.el
@@ -923,34 +923,34 @@ Only useful if you have not installed Beancount properly
in your PATH.")
buffer-file-name
(or link lnarg))))))
-(defun beancount-region (rmin rmax &optional command &rest args)
- "Get the info from \"region\" from `beancount-doctor-program'."
+;; Note: Eventually we'd like to be able to honor some metadata in the file
that
+;; would point to the top-level filename.
+(defun beancount-command-on-region (rmin rmax command)
+ "Run a command with a region as the final arguments."
(when (use-region-p)
(let* ((compilation-read-command nil)
(region-command (or command "region"))
- (args (append (list beancount-doctor-program
- region-command
- buffer-file-name)
- args
- (list (format "%d:%d"
+ (args (append command
+ (list buffer-file-name
+ (format "%d:%d"
(line-number-at-pos rmin)
(line-number-at-pos
(if (= 0 (save-excursion (goto-char
rmax) (current-column)))
- (1- rmax) rmax)))))))
- ;(message args)))
+ (1- rmax) rmax)))
+ ))))
(apply #'beancount--run args))))
(defun beancount-region-default (rmin rmax)
(interactive "r")
- (beancount-region rmin rmax "region"))
+ (beancount-command-on-region rmin rmax (list beancount-doctor-program
"region")))
(defun beancount-region-value (rmin rmax)
(interactive "r")
- (beancount-region rmin rmax "region" "--conversion=value"))
+ (beancount-command-on-region rmin rmax (list beancount-doctor-program
"region" "--conversion=value")))
(defun beancount-region-cost (rmin rmax)
(interactive "r")
- (beancount-region rmin rmax "region" "--conversion=cost"))
+ (beancount-command-on-region rmin rmax (list beancount-doctor-program
"region" "--conversion=cost")))
(defvar beancount-price-program "bean-price"
"Program to run the price fetching commands.")
- [nongnu] elpa/beancount 8091f35803 056/103: beancount.el: Add beancount-electric-currency, (continued)
- [nongnu] elpa/beancount 8091f35803 056/103: beancount.el: Add beancount-electric-currency, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount 449212459e 072/103: fix parenthses mismatch on beancount outline 1-8, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount d560451fda 071/103: Use beancount-level-N faces instead of org-level-N, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount bde2d6c499 089/103: Add function to jump to previous transaction, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount c77e340ed2 003/103: ., ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount e8a5bce28c 086/103: Fix typo in beancount-number-alignment-column docstring, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount 72956f0f0e 097/103: Change sign of prefix argument for `beancount-insert-date`, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount 7a0ef01d1f 066/103: Add command to open file with fava, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount aab2a23f15 074/103: Fix headlines fontification test, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount 519bfd868f 093/103: (Merge remote-tracking branch 'github/main'), ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount 687775da63 088/103: Minor refactoring of region commands (with no expected functionality changes).,
ELPA Syncer <=
- [nongnu] elpa/beancount 94bae42833 091/103: Extend CI to run tests on Emacs 28 too, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount 0f1e33067e 100/103: Fix a bug where `beancount-accounts` was read from the minibuffer, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount 763a8d3fe4 095/103: Add docstrings, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount 3ef6031332 078/103: Fix headlines fontification and two minor cleanups, ELPA Syncer, 2024/04/29
- [nongnu] elpa/beancount ec4b299edf 028/103: beancount.el: Bring back outline folding functionality, ELPA Syncer, 2024/04/29