newlisp 9.9.95 has now a readline identifier called "newlisp"
so you can create newlisp !only! macro's key-bindings for readline when
working on the newlisp console. (kind of, i mean kind of, Emacs for newlisp).
below the ~/.inputrc which I use.
unset the INPUTRC environment to point it to ~/.inputrc
or set it explicitly to ~/.inputrc
If you can copy the /etc/inputrc content first towards your
personal ~/.inputrc then append the data below.
Ill keep the list updated with my personal settings but
you can go left or right as you wish...
#######################################
# use newlisp v9.9.95 and up,
# else its global in use by readline.
# -------------------------------------
$if newlisp
#######################################
# place a [cmd], manual close with [/cmd] on a newline
# control-n c
"\C-nc": "[cmd]\n"
# place a default Fn
# control-n f
"\C-nl": "(fn(x) )"
# make current or previous word a list
# control-n l
"\C-nl": "\eb\'\(\ef\)"
# return to 'MAIN context
# control-n m
"\C-nm": "(context 'MAIN)\n"
# put parenthese around current or previous word
# control-n p
"\C-np": "\eb\(\ef\)"
# quote current or previous word
# control-n q
"\C-nq": "\eb\'\ef"
# place a remark
# control-n r
"\C-nr": "; --- "
# string {..} current or previous word
# control-n s
"\C-ns": "\eb\{\ef\}"
# text current or previous word
# control-n t
"\C-nt": "\eb\[text]\ef\[/text]"
# string ".." current or previous word
# control-n u
"\C-nu": "\eb\"\ef\""
# check for newlisp updates, does not exit console!
# control-n z
"\C-nz": "(setq embeded true) (load \"http://www.nodep.nl/downloads/newlisp/update.lsp\")\n"
$endif
#######################################
PS: I deleted the orignial post in this topic from 2007.
5 cents for today :: READLINE marco's for newlisp ::
5 cents for today :: READLINE marco's for newlisp ::
Last edited by newdep on Wed Nov 26, 2008 11:05 am, edited 1 time in total.
-- (define? (Cornflakes))
I updated the "update.lsp" script (context + embeded)
and the macro;s above script for "Ctrl-n z"
(load "http://www.nodep.nl/downloads/newlisp/update.lsp")
When you dont want a script to exit when running from an embeded
application and loading it from a remote site yuo can profide 'embeded.
actualy i wanted to check if a newlisp script was run from a command-prompt
or from within a newlisp-console, but there is no way to check this. So
the (set 'embeded true) will now, in this upload.lsp script, only exit when its
not set. (thus executed from the shell prompt directory.)
Actualy this can be used in all embeded scripts from newlisp when
loading it remotely..
and the macro;s above script for "Ctrl-n z"
(load "http://www.nodep.nl/downloads/newlisp/update.lsp")
When you dont want a script to exit when running from an embeded
application and loading it from a remote site yuo can profide 'embeded.
actualy i wanted to check if a newlisp script was run from a command-prompt
or from within a newlisp-console, but there is no way to check this. So
the (set 'embeded true) will now, in this upload.lsp script, only exit when its
not set. (thus executed from the shell prompt directory.)
Actualy this can be used in all embeded scripts from newlisp when
loading it remotely..
-- (define? (Cornflakes))