emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* emacs regex work done within literate org-mode?
@ 2014-04-17 19:53 Lawrence Bottorff
  2014-04-17 20:59 ` Thorsten Jolitz
  2014-04-18 11:29 ` Bastien
  0 siblings, 2 replies; 3+ messages in thread
From: Lawrence Bottorff @ 2014-04-17 19:53 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2006 bytes --]

A while back I declared war against what I call "tunneling" i.e., the
typical programmer practice of just working along on something without
making any sort of notes or comments . . . and that day's "Werdegang" as
they say in German (steps, procedure, process?) being only as good as your
memory of it. I see org mode as capable of is beating tunneling by actually
writing a story of your day's work inside an org-mode file.

For example, I'm working on a database project where I'd like to do lots of
emacs regex to get a file of comma delimited lines turned into sql
INSERT-ready statements. Here's what the VALUES of my INSERT look like:

(UPPER (SUBSTRING(MD5(RAND()) FROM 1 FOR 6)), ,'P',1)

the first part up until ...FOR 6)) is just a six-place hex id generator
(mysql syntax) for the record, then comes an empty field, then 'P' etc. So
I'm looking to shove a chunk of text from my comma delimited file into the
empty field. e.g.,

(...FROM 1 FOR 6)),'new thing 1','P',1)

where 'new thing 1' came from a line in the comma delim file. Right, so I
can do this with Emacs' regex in a one-off tunneling sort of way, but how
could I do this inside an org-mode file? I'm guessing I would need to use
elisp (perl, lisp, etc) in a literate way, i.e., my org-mode file would
have code sections and results sections. But could the results of running
literate code then be fed into the next section of literate code? I need to
run code on data, get results, run more code on that -- all while
interactively composing my org-mode file. Is this possible?

Basically, I'm looking for something better than the typical Emacs REPL
session where you have the option of simply saving the entire session's
REPL buffer. But I don't want it to be so cumbersome that I'm writing a
tutorial, either -- even though that's what I'm sort of doing. The dream
would be that a whole day's work could be contained in org-mode files --
both the code and the description of what's going on and how things came
(in)to be(ing).

LB

[-- Attachment #2: Type: text/html, Size: 2338 bytes --]

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

end of thread, other threads:[~2014-04-18 11:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-17 19:53 emacs regex work done within literate org-mode? Lawrence Bottorff
2014-04-17 20:59 ` Thorsten Jolitz
2014-04-18 11:29 ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).