impromptu

Spawn $EDITOR to update an association list for CLI scripts.

  1. impromptu
  2. Overview
  3. Format
  4. Source
  5. Version History

Overview

[procedure] (edit-properties alist)

Formats alist to a temporary file and spawns the user's preferred editor on it. If the editor exits with a zero error level, the file is parsed back into a new association list having keywords for keys and returned.

If the editor exits with a non-zero error, edit-properties returns #f.

The editor is sought in the following order:

Format

'((User: . "joeblack")
  (Description: . "Joe Black, an old friend of the family, is\na short, stocky fellow with greased black hair."))

Produces the following file:

 :User: joeblack
 :Description:
 Joe Black, an old friend of the family, is
 a short, stocky fellow with greased black hair.

Source

The source is on github.

Version History

0.1.6
Resolve dependency issue (embedded-test vs. test)
0.1.5
Don't quote $EDITOR or $VISUAL (handles the 'subl -w' case)
0.1.4
Support $VISUAL
0.1.3
Fix handling of newlines