all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Looking for generic text transformation utility library
@ 2018-07-02 12:56 Phil Eaton
  0 siblings, 0 replies; 3+ messages in thread
From: Phil Eaton @ 2018-07-02 12:56 UTC (permalink / raw)
  To: help-gnu-emacs

I can't seem to find a way to do simple programmatic transformations
without writing a good portion of code (that I imagine must have been
written before). I want to be able to make a text selection and run
`(map-selection #'prettify)` and have my `prettify` function called with
the selection and the result of `prettify` written back in place of the
selection.

Same thing goes for a hypothetical `map-buffer`, `map-line`, etc.

Is this a (builtin) thing? Or does every package re-implement this
functionality manually? Is there a library that provides these basic
transformation utilities?

Thank you!

-- 
Phil Eaton


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Looking for generic text transformation utility library
       [not found] <mailman.2919.1530543434.1292.help-gnu-emacs@gnu.org>
@ 2018-07-02 18:26 ` Emanuel Berg
  2018-07-20  2:08   ` rx use case for ETL (was: Looking for generic text transformation utility library) Van L
  0 siblings, 1 reply; 3+ messages in thread
From: Emanuel Berg @ 2018-07-02 18:26 UTC (permalink / raw)
  To: help-gnu-emacs

Phil Eaton wrote:

> I can't seem to find a way to do simple
> programmatic transformations without writing
> a good portion of code

"generic text transformation utility", you mean
like the Unix tool sed(1), the "stream editor
for filtering and transforming text", or tr(1),
to "translate or delete characters"?

Can you provide me/us with an example of
a text, as well as the end result you want it
to be translated into?

-- 
underground experts united
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 3+ messages in thread

* rx use case for ETL (was: Looking for generic text transformation utility library)
  2018-07-02 18:26 ` Looking for generic text transformation utility library Emanuel Berg
@ 2018-07-20  2:08   ` Van L
  0 siblings, 0 replies; 3+ messages in thread
From: Van L @ 2018-07-20  2:08 UTC (permalink / raw)
  To: help-gnu-emacs


>> I can't seem to find a way to do simple
>> programmatic transformations without writing
>> a good portion of code
> 
> "generic text transformation utility", you mean
> like the Unix tool sed(1), the "stream editor
> for filtering and transforming text", or tr(1),
> to "translate or delete characters"?
> 
> Can you provide me/us with an example of
> a text, as well as the end result you want it
> to be translated into?

A killer-mode in Emacs for the 
Extract Transform Load (or ETL) industry would be 
for a way to use rx (not regexp) to step by step 
transform a source buffer to desired target form.

Step 1. begin with two buffers, the source and target
which are identical

Step 2. an rx machine assisted composition buffer does
what sed(1), tr(1), regexp do by showing in two mini buffers
candidate patterns for source to target change which are 
easy human readable and writable; imagine this kind of 
workload isn’t done more than four times each year so 
the readability has to be there after long stretches
and for first timers

Step 3. stop when there are no 
undesired outliers in the target form


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-20  2:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2919.1530543434.1292.help-gnu-emacs@gnu.org>
2018-07-02 18:26 ` Looking for generic text transformation utility library Emanuel Berg
2018-07-20  2:08   ` rx use case for ETL (was: Looking for generic text transformation utility library) Van L
2018-07-02 12:56 Looking for generic text transformation utility library Phil Eaton

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.