[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/csv2ledger 466a098d2b 034/190: Extract new function `c2l-g
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/csv2ledger 466a098d2b 034/190: Extract new function `c2l-get-current-row` from `c2l-csv-entry-as-kill`. |
Date: |
Sun, 2 Jun 2024 15:59:43 -0400 (EDT) |
branch: elpa/csv2ledger
commit 466a098d2b845c99a1aba8947d708e09c52b0013
Author: Joost Kremers <joost.kremers@ipsoft.com>
Commit: Joost Kremers <joost.kremers@ipsoft.com>
Extract new function `c2l-get-current-row` from `c2l-csv-entry-as-kill`.
---
csv2ledger.el | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/csv2ledger.el b/csv2ledger.el
index 9ce636e67f..c0c150562a 100644
--- a/csv2ledger.el
+++ b/csv2ledger.el
@@ -270,6 +270,14 @@ strings are interpreted according to the template in
c2l--accounts))))
(c2l-compose-entry fields account)))
+(defun c2l-get-current-row ()
+ "Read the current line as a CSV row.
+Return value is a list of values as strings."
+ (let ((separator (car csv-separator-chars))
+ (quote-char (string-to-char (or (car csv-field-quotes) "")))
+ (line (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
+ (parse-csv-string line separator quote-char)))
+
;;;###autoload
(defun c2l-set-base-account ()
"Set `c2l-base-account'."
@@ -285,10 +293,7 @@ in `c2l-csv-columns'."
(interactive)
(unless c2l--accounts
(setq c2l--accounts (c2l-read-accounts c2l-accounts-file)))
- (let* ((separator (car csv-separator-chars))
- (quote-char (string-to-char (or (car csv-field-quotes) "")))
- (line (buffer-substring-no-properties (point-at-bol) (point-at-eol)))
- (row (parse-csv-string line separator quote-char))
+ (let* ((row (c2l-get-current-row))
(entry (c2l-csv-line-to-ledger row)))
(kill-new entry)
(message entry)))
- [nongnu] elpa/csv2ledger d1910389f1 100/190: Rename c2l-title-is-payee-or-sender to c2l-payee-or-sender., (continued)
- [nongnu] elpa/csv2ledger d1910389f1 100/190: Rename c2l-title-is-payee-or-sender to c2l-payee-or-sender., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 7cc0cd1a0a 029/190: Warn if trying to read a file that cannot be found., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 59ba841805 086/190: Guard against empty payee and sender in c2l-title-is-payee-or-sender, ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 6076653a0f 084/190: Rename local variable in c2l--csv-line-to-ledger., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger af1129653d 178/190: Make auto-clearing of transactions with effective date optional., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 66d5a39b99 116/190: Replace point-at-{bol|eol} with pos-{bol|eol}., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 3925c6b34a 113/190: Small fixes to the README., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger e6a7312467 112/190: Small updates to the README., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger cc5050faaf 117/190: Fix doc string for c2l-create-amount, ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger d00914d9f1 044/190: c2l-csv-line-to-ledger: Check c2l-fallback-account before asking the user., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 466a098d2b 034/190: Extract new function `c2l-get-current-row` from `c2l-csv-entry-as-kill`.,
ELPA Syncer <=
- [nongnu] elpa/csv2ledger 799beb345b 035/190: New function `c2l-has-header`., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 2531e81bcf 082/190: Add user option c2l-transaction-modify-function., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 81322ebde0 072/190: Use c2l--amount-p in c2l--has-header., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger bf995e11cb 080/190: Rename balancing account back to target account., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 521edc8471 081/190: Do not create c2l-base-account as a buffer-local variable., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger ea515e3ae6 074/190: Set default value of c2l-base-account to "Assets:Unknown"., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger c72b617d68 159/190: Fix typo in the README, ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 3a309c795a 139/190: Fix the README., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 0bcf56f4b8 140/190: Update the README., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger f299813350 146/190: Recognise amounts without cents in c2l--amount-p, ELPA Syncer, 2024/06/03