unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Joost Kremers <joostkremers@fastmail.fm>
To: Philip Kaludercic <philipk@posteo.net>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [ELPA] New package: csv2ledger
Date: Mon, 20 May 2024 14:06:51 +0200	[thread overview]
Message-ID: <86ttisd6w4.fsf@fastmail.fm> (raw)
In-Reply-To: <87seydm0eh.fsf@posteo.net> (Philip Kaludercic's message of "Mon,  20 May 2024 07:02:14 +0000")

Hi Philip,

On Mon, May 20 2024, Philip Kaludercic wrote:
> Joost Kremers <joostkremers@fastmail.fm> writes:
>> https://codeberg.org/joostkremers/csv2ledger
>
> I don't have the time for a proper review of the package for now, but
> that shouldn't block adding the package.  I'll try to come back to you
> later with a few comments (e.g. getting rid of the dash dependency).

Is dash a real problem? I mean, it's on GNU ELPA, and I specifically made sure
to target the version there.

I can remove dash if you prefer, though. There are two dash functions I use that
don't seem to have a direct built-in equivalent (as far as I can tell):
`-compose` and `-zip-pair`. I'm sure I can deal with them.

>> There are already many solutions to do this conversion, not the least Ledger
>> itself, which provides a `convert` command. None of these are Emacs-based,
>> however, and none that I know of offer the customisability that I needed
>> myself.
>
> Can you elaborate on what you mean by "Emacs-based"?

Conveniently integrated into Emacs. You're right, of course, that any CLI-based
solution can be integrated into Emacs with some glue code. It's just that I'm
not aware that anyone has written such glue code. (Though I might have missed
something, of course).

>> I'm proposing this package for inclusion into Non-GNU ELPA, not GNU ELPA,
>> because it depends on a package that's only available on MELPA,
>> `parse-csv`.[3] (If that is a problem, please let me know. I'm assuming it's
>> a problem for GNU ELPA, but not for Non-GNU ELPA.)[4]

> That is a blocker for both repositories.

OK. Makes sense, actually.

> A quick peak at the package reveals it to be more or less a single
> function.  Can you check of the csv-mode on ELPA provides anything you
> need?  It seems like something that could be replicated in that package.

Yes, it's just one single function, `parse-csv-string`. I've taken a closer look
at csv-mode and just found the function `csv--collect-fields`, which seems to do
basically the same as `parse-csv-string`, but a) it's an internal function; and
b) it doesn't strip quotes from field values.

Neither seems unsolvable, I guess. I would be interested in your opinion,
though, as to what would be better: add a public function to csv-mode.el that
strips the quotes, or call `csv--collect-fields` from csv2ledger.el and strip
the quotes there?

-- 
Joost Kremers
Life has its moments



  reply	other threads:[~2024-05-20 12:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 14:24 [ELPA] New package: csv2ledger Joost Kremers
2024-05-20  7:02 ` Philip Kaludercic
2024-05-20 12:06   ` Joost Kremers [this message]
2024-05-20 12:18     ` Philip Kaludercic
2024-05-20 12:26       ` Philip Kaludercic
2024-05-20 14:27       ` Joost Kremers
2024-05-29  8:01         ` Joost Kremers
2024-06-02 19:49           ` Philip Kaludercic
2024-06-02 21:14             ` Joost Kremers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ttisd6w4.fsf@fastmail.fm \
    --to=joostkremers@fastmail.fm \
    --cc=emacs-devel@gnu.org \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).