1 09/14/78 -- Multics Emacs Lisp Mode.
  2    Last updated 11/7/80
  3 
  4 **This file is intended to be perused via dprint, print, or via an**
  5 **editor.  It is not intended to be perused with the help command **
  6 
  7 
  8 
  9 
 10 ^L
 11      Lisp   mode   facilitates  the  construction  and  editing  of  Lisp
 12 programs   in   Multics   Emacs.   Commands  for  positioning  over  Lisp
 13 expressions,   and  indenting  and  commenting  Lisp  code are available,
 14 as  well  as commands to facilitate  the testing of Lisp programs in  the
 15 Emacs environment.
 16 
 17      Lisp major mode is entered via the command
 18 
 19           ESC-X lisp-mode CR
 20 
 21 or  by  Find File'ing any file with a last component name of ".lisp" when
 22 the find-file-set-modes option is selected.  When in Lisp major mode, the
 23 comment  column  is set to 50 (column 51), and the comment prefix to ";".
 24 The  normal  comment commands, ESC-P, ESC-N, ESC-;, will act according to
 25 these settings.  If lisp-mode-hook is bound, it will be called.
 26 
 27      The following is the current command repertoire of Lisp mode:
 28 
 29 ^I (TAB)  indent-to-lisp
 30 
 31           On  a  blank  or empty line,  creates enough leading whitespace
 32           so  that  the  first  S-expression typed on this line will line
 33           up  properly  according  to  conventional Lisp indenting rules.
 34           Normally,   this  means  line  it  up  with  the  start  of the
 35           previous   S-expression,   but  in  other  circumstances  other
 36           actions  may  be  taken.   On a non-blank line,  re-adjusts the
 37           line's indentation to effect conventional Lisp indenting.
 38 
 39 ESC-Q     lisp-indent-function
 40 
 41           Put  point  and  mark  around  the  current  Lisp function (see
 42           ESC-^A).   For  all lines other than the first,  re-indent them
 43           according to conventional Lisp indentation.
 44 
 45 ESC-^A    begin-defun
 46 
 47           Move  point  to  the  beginning of the current "function".  The
 48           beginning  of  a  function  is defined as right before the last
 49           open parenthesis at the left margin.
 50 
 51 ESC-^B    backward-sexp
 52 
 53           Move  backwards  over  exactly  one balanced S-expression.  All
 54           comments,   quoted  strings,   and  slashified  characters  are
 55           considered  properly.   Will  abort  (and  beep) if unbalanced.
 56           AVOID  invoking  this  from  inside comments or quoted strings.
 57           Skips   trailing   open   parens.    Accepts  numeric  arg  for
 58           repetition count.
 59 
 60 ESC-^C    compile-function
 61 
 62           Effects  compilation  and  loading of the current Lisp function
 63           via  the Multics Lisp Compiler (lcp).  Does this by loading lcp
 64           into  the Emacs environment  (the first  time it  is used in an
 65           Emacs  invocation),  utilizing  it,  and loadfiling the result.
 66           Will  automatically  incorporate/compile the correct version of
 67           e-macros.incl.lisp  into  your  environment (the first time) as
 68           well.   Puts  the  name  of  the  function compiled on the kill
 69           stack,  so  it  can  be  yanked  into an ESC-ESC minibuffer for
 70           trial.   Displays  compiler  diagnostics  as local display.  Be
 71           careful  to  WRITE  OUT  changes  you  make  and debug via this
 72           facility; this is a common trap: you see what you have in front
 73           of you "working", and you think you are done.
 74 
 75           Forms  ESC-^C'ed  will  be  treated  as  though  they  had been
 76           encountered  at  top  level by the compiler; macro definitions,
 77           declarations,  and side-effects from compilation to compilation
 78           are  all  handled  correctly.  Declarations, macro definitions,
 79           and    reader   macro   definitions   other   than   those   in
 80           e-macros.incl.lisp  must  be ESC-^C'ed explicitly.  Information
 81           produced during any ESC-^C stays around for all future ESC-^C's
 82           in  an  Emacs invocation: the regnant Emacs environment will be
 83           used  as  the  compile AND LOAD time environments.  Thus, macro
 84           and  other  definitions ESC-^Z'ed or ESC-ESC'ed are seen by the
 85           compiler.
 86 
 87 ESC-^D    down-list-level
 88 
 89           Go  down  one  level  of list structure.  Basically the same as
 90           looking   forward   for   an   open  parenthesis,   but  it  is
 91           intelligent about Lisp comments,  quotes,  etc.
 92 
 93 ESC-^E    end-defun
 94 
 95           Go   to  right  after  the  last  close-paren  of  the  current
 96           function.   See  "begin-defun"  for a definition of the current
 97           function.    Useful   to   see   if  function  balances  parens
 98           correctly.
 99 
100 ESC-^F    forward-sexp
101 
102           Skip  forward  over  exactly  one S-expression,  positioning to
103           after   the  appropriate  close  parenthesis,   or  before  the
104           appropriate  whitespace.   Accepts  numeric  arg for repetition
105           count.   Skips  leading  close  parens.   Avoid invoking inside
106           quoted strings or comments.
107 
108 ESC-^H    mark-defun
109 
110           Put   point   and   mark  around  the  current  function.   See
111           begin-defun for a definition of the current function.
112 
113 ESC-^K    kill-sexp
114 
115           Kill  one  (or  many) S-expressions forward,  i.e.,  from point
116           to   the   point   after   that  many  complete  S-expressions.
117           Argument is how many.  Merges kills forward.
118 
119 ESC-^M (ESC-CR) lisp-cret-and-indent
120 
121           Identical  to  a  CR  (new-line)  followed  by  indent-to-lisp;
122           this  is  the  normal  way  to  terminate an input line in Lisp
123           mode.   It  puts you on a new line and indents in correctly for
124           the  next  S-expression.  Done in the middle of a line,  breaks
125           the  line  at that point,  correctly indenting the S-expression
126           which was to the right of point on the new line.
127 
128 ESC-^N    forward-list
129 
130           Move  to  right  after the end of current Lisp list.  Basically
131           the  same  as  searching  for  a  close paren,  but intelligent
132           about Lisp comments,  quoting,  etc.
133 
134 ESC-^P    backward-list
135 
136           Move  to  right  before the beginning of the current Lisp list.
137           Basically  the  same  as searching backwards for an open paren,
138           but intelligent about Lisp comments,  quoting,  etc.
139 
140 ESC-^Q    lisp-indent-region
141 
142           Re-indent   all   lines   (other   than   the   first)  in  the
143           point-to-mark region for conventional Lisp indentation.
144 
145 ESC-^R    move-defun-to-screen-top
146 
147           Move  the  current function (see begin-defun for definition) to
148           the  top  of  the  current  screen,   leaving point at function
149           beginning.
150 
151 ESC-^T    mark-sexp
152 
153           Set  point  and mark around the current S-expression.  If point
154           is  currently  before the close paren of a list,  set point and
155           mark  around  that  list.  If point is before whitespace,  mark
156           the next S-expression.
157 
158 ESC-^V    view-defun
159 
160           Print  out  current  function:   put  point and mark around the
161           current  Lisp  function (see begin-defun for a definition), and
162           display  it  (print  it  out  on  printing  terminals) as local
163           output.
164 
165 ESC-^Z    eval-top-level-form
166 
167           Evaluates  the  current  top  level form and displays its value
168           in  the  minibuffer.   A top level form has the same definition
169           as  a  function.   (See begin-defun for the definition).  Loads
170           the  file  "e-macros.incl.lisp"  to  ensure the presence of the
171           Emacs   macros.    (See  extensions.info).   This  facility  is
172           intended    for    use    in    debugging    extensions, as  is
173           compile-function,   but  will  run your code interpreted rather
174           than  compiled  which  aids  in debugging.  Be careful to WRITE
175           OUT changes you make and debug via this facility.
176 
177 ESC-(     lisp-one-less-paren
178 
179           Removes  one  close  parenthesis  from  the  end  of  the  last
180           S-expression  prior  to  this  line,  and  reindents this line.
181           Implements  "This  automatically-indented Lisp line is indented
182           one  level  too few.  There must be an extra close paren on the
183           last line.  Fix it and let's see."
184 
185 ESC-)     lisp-one-more-paren
186 
187           Adds  one close parenthesis to the end of the last S-expression
188           prior  to this line, and reindents this line.  Implements "This
189           automatically-indented  Lisp  line  is  indented  one level too
190           many.   There  must  be a missing close paren on the last line.
191           Fix it and let's see."
192 
193 
194 
195      The  following  extended commands invoked via ESC-X are available in
196 Lisp mode:
197 
198 eval-buffer
199 
200           Evaluates  the  contents  of  the buffer and displays the value
201           of  the  last form in the buffer via the minibuffer.  Loads the
202           file  "e-macros.incl.lisp"  to insure the presence of the Emacs
203           macros.   This  command is used to "load" a buffer of Lisp code
204           into    the    Emacs    environment    for    debugging.    The
205           eval-top-level-form  function  (ESC-^Z)  may  then  be  used to
206           "re-load"  any  functions  whose  definition  you  change while
207           debugging.   Be  careful  to  WRITE  OUT  changes  you make and
208           debug via these facilities.
209 
210