Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the magic-ed Reference Manual, version 0.2, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 16:58:23 2021 GMT+0.
• Introduction | What magic-ed is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Magic (ed) is a tiny editing facility for Common Lisp, where you can directly load, edit, manipulate and evaluate file or file content from REPL.
I find myself often running the REPL for various things but lazy enough to engage Emacs/SLIME when I need just a small edit: I'm a UNIX guy and I got used to start vi/vim/emacsclient for writing small throw-away programs.
This package also can be a starting point for people who are not accustomed to Emacs or SLIME and would like to continue using their default terminal/console editor with Common Lisp.
Install via Quicklisp, which updates distro about once a month.
(ql:quickload "magic-ed")
For simple editing from the REPL, launch your system configured EDitor
(ed "file-name.lisp")
For the daily updates track, install via Ultralisp. You can also install manually. See instructions for other installation options and use below.
You start it with:
(magic-ed:magic-ed "/tmp/test.lisp")
and it will start editor assigned to EDITOR environment variable. When you are done with editing, save it and quit: magic-ed will load that file and evaluate it. If file saving somehow failed, nothing will be evaluated.
In background, magic-ed will try to use (ed) standard function and will try to obey implementation specific features. For example, in SBCL, if sb-ext:*ed-functions* was set, magic-ed will not use environment value.
If you do not want edited file to be evaluated, you use :eval parameter like:
(magic-ed:magic-ed "/tmp/test.lisp" :eval nil)
and file will be only saved. Also, if you would like file content to be returned as escaped string, use :output parameter (accepts only :file and :string):
(setf content (magic-ed:magic-ed "/tmp/test.lisp" :output :string))
First setup EDITOR environment variable to point to your favorite editor (on *nix, often nano or vi, distribution dependent config and change) and download magic-ed code via Quicklisp, Ultralisp, or manually (clone it from this repository).
Magic-ed is available on Ultralisp. Ultralisp updates more often than Quicklisp, so this install is recommended.
Install Quicklisp, install Ultralisp. Then use the standard Quicklisp installation method.
Do an update of the QL database and install:
(ql:update-dist "quicklisp")
(ql:quickload "magic-ed")
(asdf:load-system :magic-ed)
Manual install:
Download or git clone magic-ed to Your quicklisp directory manually
( usually ~/quicklisp/local-projects/ )
For example, execute in terminal:
cd ~/quicklisp/local-projects/
git clone https://github.com/sanel/magic-ed
Then, launch Your Common Lisp of choice and in the REPL:
(ql:quickload :magic-ed)
Update Your Common Lisp configuration, adding the following line to the same file responcible for loading quicklisp on start.
In SBCL: edit Your ~/.sbclrc and add to the end, after ql lines:
(ql:quickload :magic-ed)
The magic-ed code was tested on SBCL, ECL, Clozure CL and CMUCL.
Copyright (c) 2013-2020 Sanel Zukan. You can use this code however you like, in accordance with the MIT license.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The magic-ed system |
Sanel Zukan. https://github.com/sanel/magic-ed/
MIT
Edit your code from REPL.
0.2
sb-introspect
magic-ed.asd (file)
src/magic-ed.lisp (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The magic-ed.asd file | ||
• The magic-ed/src/magic-ed.lisp file |
Next: The magic-ed/src/magic-ed․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
magic-ed.asd
magic-ed (system)
Previous: The magic-ed․asd file, Up: Lisp files [Contents][Index]
magic-ed (system)
src/magic-ed.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The magic-ed package |
src/magic-ed.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions |
Previous: Exported definitions, Up: Exported definitions [Contents][Index]
src/magic-ed.lisp (file)
Call editor from REPL and depending on options, return to REPL or evaluate the file content in REPL.
This function will try to use implmentation specific (ed) function, which will in turn invoke editor set in
EDITOR environment variable. Some Common Lisp implementations uses different strategy for setting external
editor, so if unsure what they are, make sure to consult your implementation documentation first.
If called without file, this function will invoke editor without file argument.
Supported options are:
:eval (t or nil) - if :eval was set to nil, saved content will not be evaluated
:output (:file or :string) - by default, content will be saved to file; if you want the content to
be returned as escaped string, set ’:output :string’.
src/magic-ed.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions |
Previous: Internal definitions, Up: Internal definitions [Contents][Index]
src/magic-ed.lisp (file)
Slurp file from given path.
src/magic-ed.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L M |
---|
Jump to: | F L M |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | E F M N S |
---|
Jump to: | E F M N S |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | M P S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
M | |||
magic-ed : | The magic-ed system | ||
magic-ed : | The magic-ed package | ||
| |||
P | |||
Package, magic-ed : | The magic-ed package | ||
| |||
S | |||
System, magic-ed : | The magic-ed system | ||
|
Jump to: | M P S |
---|