help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Iterating over buffer lines


From: Platon Pronko
Subject: Re: Iterating over buffer lines
Date: Sat, 17 Jun 2023 08:10:33 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

On 2023-06-17 06:19, Joshua Lambert wrote:
I have created some functions that make changes to one buffer line of
a csv file. Let's call those functions a, b and c. Each of those take
one or more arguments. I want to create a separate interactive
function that does what function a, b, and c do, but on every line of
the region. I successfully created a function (act-on-region-by-line)
to go through all lines in a region and then call function a, function
b, or function c. But, It seems redundant to have multiple functions
that have 9-15 lines similar and one line different, the one that
specifies function a, b or c. What is the best way to be efficient in
this situation?

I have attempted to pass function b as a parameter, but I am slow to
understand how to do that. Is that the best way, or is there another?

Thanks,
J Lambert


It's a bit difficult to understand what the problem is without seeing the code. 
Can you show the code for your latest attempt?

Yes, passing function as a parameter seems to be the best way. And partial 
function application might be useful here as well.

--
Best regards,
Platon Pronko
PGP 2A62D77A7A2CB94E




reply via email to

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