[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/csv2ledger 59ba841805 086/190: Guard against empty payee a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/csv2ledger 59ba841805 086/190: Guard against empty payee and sender in c2l-title-is-payee-or-sender |
Date: |
Sun, 2 Jun 2024 15:59:48 -0400 (EDT) |
branch: elpa/csv2ledger
commit 59ba8418055359018f5ecb0e1aa12168b1eb4a39
Author: Joost Kremers <joostkremers@fastmail.fm>
Commit: Joost Kremers <joostkremers@fastmail.fm>
Guard against empty payee and sender in c2l-title-is-payee-or-sender
---
csv2ledger.el | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/csv2ledger.el b/csv2ledger.el
index e30b42a890..2861bf615b 100644
--- a/csv2ledger.el
+++ b/csv2ledger.el
@@ -242,11 +242,16 @@ should contain values for `payee' and `sender'. If the
value of
otherwise the payee is returned."
(let ((payee (alist-get 'payee transaction))
(sender (alist-get 'sender transaction)))
- (if (stringp c2l-account-holder)
- (if (string-match-p c2l-account-holder payee)
- sender
- payee)
- payee)))
+ (cond
+ ((and (string-empty-p payee)
+ (string-empty-p sender))
+ "Unknown")
+ ((string-empty-p payee) sender)
+ ((string-empty-p sender) payee)
+ ((and (stringp c2l-account-holder)
+ (string-match-p c2l-account-holder payee))
+ sender)
+ (t payee))))
(defun c2l-title-is-counterpart (transaction)
"Return the counterpart of an entry.
- [nongnu] elpa/csv2ledger e8a7609736 050/190: Add user option `c2l-alignment-column`., (continued)
- [nongnu] elpa/csv2ledger e8a7609736 050/190: Add user option `c2l-alignment-column`., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 0af0aa3de2 021/190: Rename `c2l-parse-date` and update doc string., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 900eef1457 017/190: Move definition of `c2l-account-matchers-file`., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger c5b7b0766e 024/190: Rewrite `c2l-compose-entry` and `c2l-csv-line-to-ledger`., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 6597b8cd22 003/190: Initial commit of csv2ledger.el, ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 1ce1fe5297 005/190: Remove BSD license from header, point to GNU license., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger f19910d17b 099/190: Add option c2l-entry-function., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger aa55c01cc1 106/190: New user option c2l-transaction-modify-functions., ELPA Syncer, 2024/06/03
- [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 <=
- [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, 2024/06/03
- [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