[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/1] Split fields by comma and whitespace for summary

From: Antoine Kalmbach
Subject: [PATCH 0/1] Split fields by comma and whitespace for summary
Date: Sat, 7 Nov 2020 16:50:00 +0200

If I try rec-cmd-show-summary and put in two fields "Distance,Time",
I get an error message "apply: Args out of range: [], 0".
Invoking edebug finds that on line 2099 we have

    (rec-summary-populate (vconcat (mapcar (lambda (field) (list field 15 nil)) 
summary-fields)) summary-list)

Looking at summary-list, I'm seeing it getting evaluated to

    Result: [("Distance,Time" 15 nil)]

So I suppose when making the header for the tabulated list one must first
split the string.

I inserted the comma there because the docstring of rec-cmd-show-summary says I
should do so, but looking at line 908 shows that rec-summary-fields[0] does not
split the string by a comma, but by the default whitespace.

Indeed, if in my file I set the summary record to

    %summary: Distance Time

The summary works, but if I do it like the docstring says, with a comma, it
doesn't work. The minibuffer prompt does not split the string.

[0] https://git.savannah.gnu.org/cgit/recutils.git/tree/etc/rec-mode.el#n908
[1] https://git.savannah.gnu.org/cgit/recutils.git/tree/etc/rec-mode.el#n2080

Antoine Kalmbach (1):
  Split fields by comma and whitespace for summary

 ChangeLog       | 5 +++++
 etc/rec-mode.el | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

2.24.3 (Apple Git-128)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]