[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/csv2ledger 88c394d5bb 066/190: Rename c2l-payee-or-sender
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/csv2ledger 88c394d5bb 066/190: Rename c2l-payee-or-sender to c2l-title-is-payee-or-sender. |
Date: |
Sun, 2 Jun 2024 15:59:46 -0400 (EDT) |
branch: elpa/csv2ledger
commit 88c394d5bbe28b5ef8f550e459dab4f528f65535
Author: Joost Kremers <joostkremers@fastmail.fm>
Commit: Joost Kremers <joostkremers@fastmail.fm>
Rename c2l-payee-or-sender to c2l-title-is-payee-or-sender.
---
csv2ledger.el | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/csv2ledger.el b/csv2ledger.el
index 0bacacb017..be15f59463 100644
--- a/csv2ledger.el
+++ b/csv2ledger.el
@@ -120,7 +120,7 @@ for the field in question."
:type '(repeat (cons (symbol :tag "Field") function))
:group 'csv2ledger)
-(defcustom c2l-title-function #'c2l-payee-or-sender
+(defcustom c2l-title-function #'c2l-title-is-payee-or-sender
"Function to create a title.
The function should take as argument an entry alist of
field-value pairs and should return a string. The string
@@ -194,21 +194,22 @@ format, it just splits DATE on the separator, reverses
the date
parts and joins them again, using a hyphen as separator."
(string-join (nreverse (split-string date "[./-]" t "[[:space:]]")) "-"))
-(defun c2l-payee-or-sender (entry)
+(defun c2l-title-is-payee-or-sender (transaction)
"Return payee or sender based on `c2l-account-holder'.
This function is for use as the value of `c2l-title-function'.
-ENTRY should be an alist containing field-value pairs for an
-entry and should contain values for `payee' and `sender'. If the
-value of `c2l-account-holder' matches the payee, the sender is
-returned, otherwise the payee is returned."
- (when (stringp c2l-account-holder)
- (let ((payee (alist-get 'payee entry))
- (sender (alist-get 'sender entry)))
- (if (string-match-p c2l-account-holder payee)
- sender
- payee))))
(defun c2l--compose-entry (items &optional from to)
+TRANSACTION should be an alist containing field-value pairs and
+should contain values for `payee' and `sender'. If the value of
+`c2l-account-holder' matches the payee, the sender is returned,
+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)))
"Create a ledger entry.
ITEMS is an alist containing (key . value) pairs that should be
included in the entry. It should contain values for the keys
- [nongnu] elpa/csv2ledger a4ded4f5dc 109/190: Change the default value of c2l-csv-columns to the empty list., (continued)
- [nongnu] elpa/csv2ledger a4ded4f5dc 109/190: Change the default value of c2l-csv-columns to the empty list., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 170dc4ae5c 102/190: Update README.md, ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 07281e2558 097/190: Update to the README., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger f234878bd2 180/190: Update to the README, ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 3b203a66e1 118/190: Improve code layout., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 64da760597 119/190: Update copyright year., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 98ab50c9a7 185/190: New command c2l-read-account-matchers, ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger e744d0706f 186/190: Update version number., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 188ddacde7 057/190: Rename target account to balancing account., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger a1b0dd35e1 053/190: Update README., ELPA Syncer, 2024/06/03
- [nongnu] elpa/csv2ledger 88c394d5bb 066/190: Rename c2l-payee-or-sender to c2l-title-is-payee-or-sender.,
ELPA Syncer <=
- [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