4 SRecode Minor Mode

The Semantic Recode minor mode enables a keymap and menu that provides simple access to different templates or template applications.

The key prefix is C-c /.

If the variable srecode-takeover-INS-key is set, then the key INSERT can also be used.

The most important key is bound to srecode-insert which is C-c / /, or INSERT INSERT. Quick Start.

Major key bindings are:

C-c / /

Insert a template whose name is typed into the minibuffer.

C-c / <lower case letter>

Reserved for direct binding of simple templates to keys using a key binding command in the template file.

C-c / <upper case letter>

Reserved for template applications (Such as comment or get/set inserter.)

C-c / E

Edit the code of a template.

C-c / .

Insert template again. This will cause the previously inserted template to be inserted again.

4.1 Field Editing

By default, when inserting a template, if the user needs to enter text to fill in a part of the template, then the minibuffer is used to query for that information. SRecode also supports a field-editing mode that can be used instead. To enable it set:

Function: srecode-insert-ask-variable-method

Determine how to ask for a dictionary value when inserting a template. Only the ASK style inserter will query the user for a value. Dictionary value references that ask begin with the ? character. Possible values are:

ask

Prompt in the minibuffer as the value is inserted.

field

Use the dictionary macro name as the inserted value, and place a field there. Matched fields change together.

Field editing mode is supported in newer versions of Emacs. You will not be prompted to fill in values while the template is inserted. Instead, short regions will be highlighted, and the cursor placed in a field. Typing in the field will then fill in the value. Several fields might be linked together. In that case, typing in one area will modify the other linked areas. Pressing TAB will move between editable fields in the template.

Once the cursor moves out of the are inserted by the template, all the fields are canceled.

NOTE: Some conveniences in templates, such as completion, or character restrictions are lost when using field editing mode.