|
ze
|

Files | |
| file | plugins.c |
| Guile/Scheme plugin and keybinding implementation. | |
Functions | |
| void | initKeyBindings (void) |
| Initialize the in-memory key binding table. | |
| void | loadPlugins (void) |
| Load Scheme plugins from "$HOME/.ze/plugins" (all .scm files). | |
| SCM | scmBindKey (SCM keySpec, SCM proc) |
| Bind a key specification to a Scheme procedure. | |
| int | pluginsHandleKey (unsigned char code) |
| If a Scheme binding exists for the key, invoke it. | |
| void | editorExec (void) |
| Prompt for and evaluate a single Scheme expression (mini-REPL). | |
| SCM | scmBufferToString (void) |
| Return the entire buffer as a Scheme string. | |
| SCM | scmBufferLineCount (void) |
| Get the number of lines in the current buffer. | |
| SCM | scmGetLine (SCM idx_scm) |
| Get the contents of a line by index. | |
| SCM | scmSetLine (SCM idx_scm, SCM str_scm) |
| Replace the contents of a line. | |
| SCM | scmInsertLine (SCM idx_scm, SCM str_scm) |
| Insert a new line at index. | |
| SCM | scmAppendLine (SCM str_scm) |
| Append a new line at the end of the buffer. | |
| SCM | scmDeleteLine (SCM idx_scm) |
| Delete a line by index. | |
| SCM | scmInsertText (SCM str_scm) |
| Insert text at the cursor position, interpreting newlines. | |
| SCM | scmInsertChar (SCM ch_scm) |
| Insert a single character at the cursor. | |
| SCM | scmInsertNewline (void) |
| Insert a newline at the cursor position. | |
| SCM | scmDeleteChar (void) |
| Delete the character to the left of the cursor (backspace). | |
| SCM | scmGetCursor (void) |
| Get current cursor position. | |
| SCM | scmSetCursor (SCM x_scm, SCM y_scm) |
| Set cursor position, clamped to the current buffer. | |
| SCM | scmMoveCursor (SCM dir_scm) |
| Move the cursor in a direction. | |
| SCM | scmScreenSize (void) |
| Get the editor screen size in rows and columns. | |
| SCM | scmOpenFile (SCM path_scm) |
| Open a file into the editor. | |
| SCM | scmSaveFile (void) |
| Save the current buffer to disk. | |
| SCM | scmGetFilename (void) |
| Get the current filename, if any. | |
| SCM | scmSetFilename (SCM path_scm) |
| Set the current filename and reselect syntax highlighting. | |
| SCM | scmPrompt (SCM msg_scm) |
| Prompt the user and return their input. | |
| SCM | scmRefreshScreen (void) |
| Force a screen refresh. | |
| SCM | scmSearchForward (SCM query_scm) |
| Search forward for a substring and jump to the next match. | |
| SCM | scmSelectSyntaxForFilename (SCM path_scm) |
| Select syntax based on a filename, without opening the file. | |
| SCM | scmGetFiletype (void) |
| Get the current filetype name from syntax highlighting. | |
| SCM | scmUnbindKey (SCM keySpec) |
| Remove a key binding. | |
| SCM | scmListBindings (void) |
| List all key bindings. | |
| SCM | scmBufferDirty (void) |
| Check whether the current buffer has unsaved changes. | |
| SCM | scmSetBufferDirty (SCM bool_scm) |
| Mark the current buffer dirty/clean. | |
| SCM | scmCloneTemplate (void) |
| Clone a template into the current buffer (interactive selection). | |
| SCM | pluginsGetHook (const char *name) |
| Fetch a registered hook by name. | |
| void editorExec | ( | void | ) |
Prompt for and evaluate a single Scheme expression (mini-REPL).
| void initKeyBindings | ( | void | ) |
Initialize the in-memory key binding table.
| void loadPlugins | ( | void | ) |
Load Scheme plugins from "$HOME/.ze/plugins" (all .scm files).
| SCM pluginsGetHook | ( | const char * | name | ) |
Fetch a registered hook by name.
Recognized names: "preDirOpenHook", "postDirOpenHook", "preFileOpenHook", "postFileOpenHook", "preSaveHook", "postSaveHook".
| name | C string name of the hook. |
SCM_BOOL_F if unset/unknown. | int pluginsHandleKey | ( | unsigned char | code | ) |
If a Scheme binding exists for the key, invoke it.
| code | Key code. |
| SCM scmAppendLine | ( | SCM | str_scm | ) |
Append a new line at the end of the buffer.
| str_scm | Scheme string new line text. |
SCM_BOOL_T. | SCM scmBindKey | ( | SCM | keySpec, |
| SCM | proc | ||
| ) |
Bind a key specification to a Scheme procedure.
| keySpec | Scheme string like "C-x", "C-s", or "a". |
| proc | Scheme procedure to call when the key is pressed. |
SCM_BOOL_T on success, SCM_BOOL_F on failure. | SCM scmBufferDirty | ( | void | ) |
Check whether the current buffer has unsaved changes.
| SCM scmBufferLineCount | ( | void | ) |
Get the number of lines in the current buffer.
| SCM scmBufferToString | ( | void | ) |
Return the entire buffer as a Scheme string.
| SCM scmCloneTemplate | ( | void | ) |
Clone a template into the current buffer (interactive selection).
SCM_BOOL_T. | SCM scmDeleteChar | ( | void | ) |
Delete the character to the left of the cursor (backspace).
SCM_BOOL_T. | SCM scmDeleteLine | ( | SCM | idx_scm | ) |
Delete a line by index.
| idx_scm | Scheme integer line index (0-based). |
SCM_BOOL_T on success, SCM_BOOL_F if out of range. | SCM scmGetCursor | ( | void | ) |
Get current cursor position.
| SCM scmGetFilename | ( | void | ) |
Get the current filename, if any.
SCM_BOOL_F if unnamed. | SCM scmGetFiletype | ( | void | ) |
Get the current filetype name from syntax highlighting.
SCM_BOOL_F if none. | SCM scmGetLine | ( | SCM | idx_scm | ) |
Get the contents of a line by index.
| idx_scm | Scheme integer line index (0-based). |
SCM_BOOL_F if out of range. | SCM scmInsertChar | ( | SCM | ch_scm | ) |
Insert a single character at the cursor.
| ch_scm | Either a Scheme integer char code or a one-char string. |
SCM_BOOL_T. | SCM scmInsertLine | ( | SCM | idx_scm, |
| SCM | str_scm | ||
| ) |
Insert a new line at index.
| idx_scm | Scheme integer index (clamped to [0, line-count]). |
| str_scm | Scheme string new line text (without trailing newline). |
SCM_BOOL_T. | SCM scmInsertNewline | ( | void | ) |
Insert a newline at the cursor position.
SCM_BOOL_T. | SCM scmInsertText | ( | SCM | str_scm | ) |
Insert text at the cursor position, interpreting newlines.
| str_scm | Scheme string text (may contain newlines). |
SCM_BOOL_T. | SCM scmListBindings | ( | void | ) |
List all key bindings.
| SCM scmMoveCursor | ( | SCM | dir_scm | ) |
Move the cursor in a direction.
| dir_scm | Scheme string: "left", "right", "up", or "down". |
SCM_BOOL_T. | SCM scmOpenFile | ( | SCM | path_scm | ) |
Open a file into the editor.
| path_scm | Scheme string path. |
SCM_BOOL_T. | SCM scmPrompt | ( | SCM | msg_scm | ) |
Prompt the user and return their input.
| msg_scm | Scheme string prompt message (printf-style not supported). |
SCM_BOOL_F on cancel. | SCM scmRefreshScreen | ( | void | ) |
Force a screen refresh.
SCM_BOOL_T. | SCM scmSaveFile | ( | void | ) |
Save the current buffer to disk.
SCM_BOOL_T. | SCM scmScreenSize | ( | void | ) |
Get the editor screen size in rows and columns.
| SCM scmSearchForward | ( | SCM | query_scm | ) |
Search forward for a substring and jump to the next match.
| query_scm | Scheme string to search for. |
SCM_BOOL_F if not found. | SCM scmSelectSyntaxForFilename | ( | SCM | path_scm | ) |
Select syntax based on a filename, without opening the file.
| path_scm | Scheme string path whose extension drives syntax. |
SCM_BOOL_T. | SCM scmSetBufferDirty | ( | SCM | bool_scm | ) |
Mark the current buffer dirty/clean.
| bool_scm | Scheme boolean. |
SCM_BOOL_T. | SCM scmSetCursor | ( | SCM | x_scm, |
| SCM | y_scm | ||
| ) |
Set cursor position, clamped to the current buffer.
| x_scm | Scheme integer column. |
| y_scm | Scheme integer line. |
SCM_BOOL_T. | SCM scmSetFilename | ( | SCM | path_scm | ) |
Set the current filename and reselect syntax highlighting.
| path_scm | Scheme string path. |
SCM_BOOL_T. | SCM scmSetLine | ( | SCM | idx_scm, |
| SCM | str_scm | ||
| ) |
Replace the contents of a line.
| idx_scm | Scheme integer line index (0-based). |
| str_scm | Scheme string new contents. |
SCM_BOOL_T on success, SCM_BOOL_F if index is out of range. | SCM scmUnbindKey | ( | SCM | keySpec | ) |
Remove a key binding.
| keySpec | Scheme string key specification (e.g., "C-x", "a"). |
SCM_BOOL_T.