Major mode for interacting with an inferior Neuron process. The following commands are available: key binding --- -------
TAB nrn-complete-symbol DEL backward-delete-char-untabify C-x Prefix Command menu-bar Prefix Command C-c Prefix Command C-d delete-char RET comint-send-input ESC Prefix Command
C-x ? sim-rcs-status C-x c sim-current-files C-x z sim-switch-to-buffer C-x s sim-save-sim C-x f sim-load-file C-x l sim-load-sim C-x C-l mv-output
C-c C-b user-interrupt C-c C-@ process-region C-c n next-prompt C-c p previous-prompt C-c C-d send-eof C-c C-p comint-previous-prompt C-c C-n comint-next-prompt C-c C-l mv-output C-c C-e comint-show-maximum-output C-c C-r comint-show-output C-c C-o comint-kill-output C-c RET comint-copy-old-input C-c C-\ comint-quit-subjob C-c C-z comint-stop-subjob C-c C-c comint-interrupt-subjob C-c C-w backward-kill-word C-c C-u comint-kill-input C-c C-a comint-bol
ESC TAB nrn-complete-symbol ESC C-q indent-c-exp ESC C-l comint-show-output ESC A-s comint-next-matching-input-from-input ESC A-r comint-previous-matching-input-from-input ESC s comint-next-matching-input ESC r comint-previous-matching-input ESC n comint-next-input ESC p comint-previous-input
A NEURON process can be fired up with M-x run-neuron.
Customisation: Entry to this mode runs the hooks on comint-mode-hook and
inferior-nrn-mode-hook (in that order).
Commands:
Return after the end of the process' output sends the text from the
end of process to point.
Delete converts tabs to spaces as it moves back.
Tab or Esc-Tab does completion for neuron commands
This listing may not be complete.
To see a list of all commands known to emacs hit tab from
beginning of line.
If you accidentally suspend your process, use M-x comint-continue-subjob
to continue it.
____________________________________________________________
Run an inferior Neuron process, input and output via buffer neuron.
With argument, allows you to set the default dir. If called from
a file associated with a simulation (index, hoc or mod file) will
automatically set default dir from that file.
Options can be set with prefix arg:
^U : ask for simulation directory (will use default name neuron if available)
^U^U : ask for simulation name (will take dir from current buffer)
____________________________________________________________
Create the nrn-command-alist (which see) from procs in files from
sim-files-alist as well as elsewhere.
____________________________________________________________
Perform completion on partial NEURON command preceding point. That symbol is compared against known NEURON command that exist and any additional characters determined by what is there are inserted. ____________________________________________________________
nil ____________________________________________________________
Find index files and set its key bindings, local variables, etc. ____________________________________________________________
Load in scene.hoc file in a crash free manner. If load things with xopen and have an error (such as trying to graph something that doesn't exist) will crash. ____________________________________________________________
nil ____________________________________________________________
nil ____________________________________________________________
Reset datestr and runnum known to NEURON according to current date and emacs variable sim-runnum (which see), use prefix argument (^U) to give specific runnum. ____________________________________________________________
============================================================
Initialization file for NEURON. ____________________________________________________________
Directory containing source code for NEURON. Ancillary programs and files are expected to be in nrn-neuronhome/../local ____________________________________________________________
Program invoked by the run-neuron command ____________________________________________________________
List the contents of variable sim-files-alist in a readable form. This is the list of files under sim controls with what emacs believes to be the current versions.
See sim-rcs-status to determine the actual contents of the directory, there should be no discrepency. ____________________________________________________________
nil ____________________________________________________________
Look in current index file to set sim-template-files to filenames
and version numbers.
____________________________________________________________
Function used to look at local variables for debugging. ____________________________________________________________
Perform rcs-get-file (which see) and loads the version into simulation. Entering 'log' instead of version number gives file comment listing and does not load file. Optional prefix (^u) means ignore version number and just load file in current directory. Otherwise blank version number means most recent version. ____________________________________________________________
Replaced with sim-load-sim with prefix argument (^U) ____________________________________________________________
Use variable sim-files-alist to load simulation using simload. Will not overwrite an altered file if it has the requested version number. Calls program simload in sim-bin-dir.
simload goes through the following flow chart:
1) does the file exist?
no -> check it out,
yes ->
2) has the file been altered since the last sim-save-sim?
no -> do nothing,
yes ->
3) is the version number in the directory the one we are looking for (ie the one in
sim-files-alist)?
yes -> do nothing (even if changes have been made),
no ->
4) has the file been changed?
no -> overwrite it with requested version,
yes -> ask user the following:
5) What should I do about this changed version? Options:
Ci and use new version (ci), leave (le), mv to .tmp (mv), or discard (rm)?
ci or le will cause the file present in the directory to be used.
mv or rm will cause the requested version number to be used.
____________________________________________________________
Load template files in order give in sim-template-files. See sim-load-sim. For templates can use 0 as a version number, meaning current version in main directory. This will search first CWD then sim-library-path for this file. ____________________________________________________________
Put the current situation in a temporary buffer. Optional arg gives extra commentary. ____________________________________________________________
Directly check the RCS status of the files being managed for the simulation (see function sim-current-files to list these files).
Option of 'current' which checks the $Id line in the files in the current directory, 'heads' which gives the highest version number or 'diffs' which runs rcs-diffs (which see) comparing each current file with the latest checked-in version.
With argument (ie ^u) can set sim-files-alist to correspond to current contents of the directory (c) or to heads (h). ____________________________________________________________
Look in current index file to set sim-files-alist to filenames and version numbers. ____________________________________________________________
Find index file to set sim-files-alist to most recent filenames and version numbers. ____________________________________________________________
RCS any of the files needed for the simulation as defined by sim-files-alist and put comment in the index file. Also query the user as to whether they want to save sim-output-file as an archival file. ____________________________________________________________
Set version for given simulation file. To change files being used need to add a new @@ line to index. ____________________________________________________________
Switch to a file being managed as part of this simulation. With argument, positions cursor at end of buffer. ____________________________________________________________
Switch to the sim process buffer. With argument, positions cursor at end of buffer. ____________________________________________________________
Look through all emacs buffers to find index files that are associated with a simulation. Produce a brief listing of these. Prefix arg gives longer listing equivalent to 'sim-portrait' for each one. ____________________________________________________________
============================================================
Command to run on output file to look at results. ____________________________________________________________
Set to nil for normal operation, is buffer local and should always be nil in interactive buffer. If output is being redirected in an undesirable manner, reset this to nil ____________________________________________________________
Function to move point to the first non-blank character in the current statement. ____________________________________________________________
Indent each line of the current hoc grouping following point. To indent a whole block of code, point must be positioned just before the opening brace, as in c-mode. ____________________________________________________________
Indent current line as hoc code. ____________________________________________________________
Removes newlines and excess spaces from region to send to use as a label on the bottom of all of the graphs. Also refreshes the date label. ____________________________________________________________
Major mode for editing .hoc files for neurons.
key binding
--- -------
C-return hoc-send-line-and-save C-x Prefix Command } ?? ESC Prefix Command DEL backward-delete-char-untabify
C-x C-p hoc-previous-function C-x d rcs-diffs C-x z sim-switch-to-buffer C-x ? sim-rcs-status C-x s sim-save-sim C-x f sim-load-file C-x l sim-load-sim C-x C-n hoc-next-function C-x p hoc-send-proc C-x i hoc-label-with-region C-x c hoc-neuron-command C-x w hoc-send-region C-x C-e hoc-send-line
ESC C-x hoc-send-proc ESC TAB nrn-complete-symbol ESC C-q hoc-indent-exp
Entry into this mode calls the value of hoc-mode-hook with no arguments, if that value is non-nil.
By default, tab indents the current line according to indentation rules similar to c-mode. If you want tab to insert a hardware tab, you can turn off hoc-mode indentation by calling hoc-indent-toggle.
Variables controlling hoc mode indentation:
hoc-block-indent
Additional indentation for each block surrounded by braces. Only relevant
if hoc-indent-enable is non-nil.
hoc-continued-statement-offset
Additional indentation for a line which is a continuation of the previous
line. Only relevant if hoc-indent-enable is non-nil.
____________________________________________________________
Send command to neuron ____________________________________________________________
Finds the next hoc function by searching for a pattern matching beginning of function. ____________________________________________________________
Finds the prior hoc function by searching for a pattern matching beginning of function. ____________________________________________________________
Sends the current buffer to neuron and switches you to neuron buffer. This saves the file before sending it. Neuron is actually sent a command to read the file.
>> DANGER: if there is ANY error in the buffer NEURON will crash. << If uncertain, it is better to select the whole buffer and use hoc-send-region, or else send procs individually ____________________________________________________________
Sends current line of text to the hoc interpreter (neuron). ____________________________________________________________
Sends current line of text to the neuron interpreter and saves file. ____________________________________________________________
Sends a procedure or func to the interpreter (neuron). Adds its name onto nrn-command-alist ____________________________________________________________
Sends a region or block of text to the hoc interpreter (neuron) directly. If point=mark, a block will defined by a nonindented line and the contents of the {} which follow. ____________________________________________________________
Toggles the function of the TAB key. TAB can either insert a hardware tab or calculate a line indentation as is done in c-mode. ____________________________________________________________
============================================================
Indentation of hoc statements with respect to containing block. ____________________________________________________________
Extra indent for lines not starting new statements. ____________________________________________________________
Copyright ©1998 WW Lytton, all rights reserved