Commit graph

10 commits

Author SHA1 Message Date
Charlie Gordon
e3c5bfd457
Remove references to global qe_state (#45)
* Remove references to global `qe_state`

Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`

Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`

Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`

Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`

Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`

Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
Charlie Gordon
a388a95305
Pass QEmacsState pointer to all module_init and module_exit functions (#24) 2024-05-19 19:15:08 +02:00
Charlie Gordon
3bbee69742 Multiple improvements
improve command and bindings registration:
- simplify command and binding registration APIs
- add bindings member in ModeDef structures
- rename qe_register_cmd_table() as qe_register_commands(), change API
- add qe_register_bindings() taking mode, command-name and bindings string
- rename qe_mode_set_key() as qe_register_command_binding()

improve buffer listing:
- add BF_SHELL buffer flag for shell buffers
- show current directory of shell buffers in bufed

improve dired:
- add dired-hide-details-mode on "("
- use details_mask to control long listing

improve trace doctor:
- add EB_TRACE_DEBUG trace flag for debugging traces
- add do_set_trace_flags()
- change do_start_trace_mode() to do_toggle_trace_mode() with arg

misc:
- fix make_user_path() for pathnames without a trailing slash
- use separate commands for prefix_argument handling
- improve strstart(), strend(), pstrcpy(), pstrncpy(), get_dirname()
- add strmatchword() like strstart with check for word boundary
- bumped version to 5.3.3d
2022-08-22 17:13:26 +02:00
Charlie Gordon
8061f9493a Change command definitions
- pass description as 3rd argument to CMDx() macros
- normalize argument specifications
- 'p' means point
- 'a' means argval
- 'A' means argval premultiplied by value
- pass argval before value to do_split_window(),
  do_isearch(), do_sort_span(), do_sort_region(), do_sort_buffer()
- add SF_SILENT flag to suppress messages in eb_sort_span()
- bumped version to 5.3.3
2022-08-19 12:13:52 +02:00
Charlie Gordon
a6db66f470 Add command descriptions
- improve command definitions
- add descriptions for most commands
- bumped version to 5.3.2b
2022-08-18 01:33:00 +02:00
Charlie Gordon
1ba2c2b0bb Simplify and clean up command definitions
- use standard bindings string to all CMDx() definitions
- remove CMDx() key and alt_key
- remove compact key macros: KEY_CTRLX, KEY_CTRLXRET,
  KEY_CTRLH, KEY_CTRLC
- removed qe_register_binding2,
- qe_register_cmd_table() takes array length
- remove CMD_DEF_END and CmdDef chaining
- add CmdDefArray to store commands in const arrays
- strtokeys() takes end pointer
- add C-@ as name for null control key
- removed many hacks in CmdDef handling
- merge electric key commands
- fix ~ minibuffer behavior
- bumped version to 5.3.2
2022-08-16 22:40:44 +02:00
Charlie Gordon
28128ae68c Improve command argument parsing
- add description placeholders to all CMDx definitions
- swap arguments to qe_split_window() and do_split_window()
- pass iteration count based on universal argument to
  do_up_down(), do_left_right(), do_word_right(), do_kill_word(),
  do_forward_paragraph(), do_kill_paragraph(), do_c_forward_conditional(),
  do_forward_block(), do_kill_block(),
- remove do_backward_paragraph()
- add int eb_prev_paragraph(EditBuffer *b, int offset);
- dont call command on 0 universal prefix
2020-11-01 19:03:33 +01:00
Charlie Gordon
592ab5ebc3 add some buffer APIs
* add buffer APIs for matching and inserting text:
  - eb_insert_str
  - eb_match_uchar
  - eb_match_str
  - eb_match_istr
* simplify eb_insert_utf8_buf: no longer accept -1 len
2014-01-11 14:38:30 +00:00
Charlie Gordon
deb6972ca3 better charset handling
* make eb_insert_buffer return the number of bytes inserted
* reset page bits upon charset change
* add eb_delete_nextc: delete one encoded character at offset
* add eb_insert_uchar: insert a unicode character with encoding
* add eb_insert_utf8_buf: insert a utf8 encoded buffer with conversion
* make eb_printf insert utf8 bytes with conversion
* add eb_insert_buffer_convert: copy chars between buffers with charset
  conversion
* handle charset conversion correctly in various places
* insert wide caracters from hex mode
* create most buffers as BF_UTF8 by default
* set kill-buffer charset to that of kill source
* convert charsets when yanking
* handle charsets in search/replace system
2014-01-06 09:40:20 +00:00
Charlie Gordon
e06c30b59e renamed plugins directory 2008-06-05 07:12:51 +00:00
Renamed from plugin-example/my_plugin.c (Browse further)