Commit graph

89 commits

Author SHA1 Message Date
Charlie Gordon
699bdff915 Simplify mode probing
* add `filenames` specification in `ModeDef` structures
* generic mode probing can match a list of filenames
* remove unneeded mode_probe functions
* this enables diff coloring on Makefile
2026-06-05 18:42:56 -04:00
Charlie Gordon
c390f3fcfe block-navigation: refine methodology for comments and strings
* fix bug on character constants ('(' ...) when styles are disabled
* fix end of comment/regex detection when scanning strings
* handle double escapes: "\\\"" is a 2 character string
* stop scanning when reaching outer block boundary
* scan blocks of comments as a single entity
2026-06-04 13:22:10 +02:00
Charlie Gordon
7391eb26c5 Configure: reorganize the configure script and Makefile
Clarify tiny build options:
* distinguish `tiny` which controls whether the tiny version should be built
* and `tiny_only` which restricts the build to just the tiny version
* add `--disable-tiny` to set `tiny=no`
* add `--tiny-only` to only build the tiny version
* add js, json and c2 modes in tiny version
2026-05-19 00:08:53 +02:00
Charlie Gordon
5a37c1cbc3 occur: reuse the same buffer but clear contents
* use `BC_REUSE | BC_CLEAR` to avoid killing the `*occur*` buffer
* this ensures the `*occur*` buffer stays current in windows that show it
* modify the `BC_CLEAR` semantics to imply `BC_REUSE`
* simplify calls: remove redundant `BC_REUSE` flag
2026-05-11 19:16:05 +02:00
Charlie Gordon
3f9f332268 Mojo: fix string parsing
* simplify string parsing and state bits
* fix raw string parsing
* support template strings with recursive coloring
2026-05-11 00:20:33 +02:00
Charlie Gordon
b3433cf4f4 Lang: add colorizer for the Mojo language
* initial support for [Mojo](https://mojolang.org/), a high performance language
  with a Python-like syntax by Modular
2026-05-10 17:35:05 +02:00
huwwa
c6ea0d0d8c avoid mode name collision 2026-05-06 14:23:14 +02:00
Charlie Gordon
3e0fc4f2ab colorizer: update C2 language keyword list 2026-04-28 17:59:37 +02:00
Charlie Gordon
58174a7247 use FALLTHROUGH instead of fallthrough to avoid clash with x11 2026-03-14 21:55:25 +01:00
Charlie Gordon
f565f58c10 add c keywords in c2 mode 2026-03-14 21:25:10 +01:00
Charlie Gordon
89f6f9e4c3 add preliminary support for the Janet language 2026-03-14 21:24:10 +01:00
Charlie Gordon
60b709afdf add support for the Algol68 language 2026-02-06 13:02:09 +01:00
Charlie Gordon
70260726f6 Improve colorization for c2 and c3
* support multiline raw c2 strings
* update c3 keyword list
* retire macos-13 CI tests
2026-01-12 20:55:22 +01:00
Charlie Gordon
990b1fbeeb Improve colorization for c, c2 and tcl
* c: fix a glitch in number colorizer
* c2: add type `va_list`
* tcl: add keywords `break`, `continue`, `return`
2025-04-21 22:35:04 +02:00
Charlie Gordon
43b5851958 Update README.md, VERSION and copyrights
* VERSION bumped to 6.4.1
2025-02-10 07:51:29 +01:00
Charlie Gordon
af492d00b6 Improve tcl colorizer
* use complete list of internal commands
* use tcl specific word parser
* fix quoted and braced string parsers
* improve variable colorizer
* add custom cases in probe function
* add `ustr_match_str`
2025-02-09 12:54:27 +01:00
Charlie Gordon
0be0462674 Add Colorizer for Tcl/Tk 2025-02-07 20:40:18 +01:00
Charlie Gordon
6efd2c634f add colorizer for the Teal programming language 2025-02-05 08:47:55 +01:00
Charlie Gordon
ffb8aeb09e colorize yaml, c2 recipe, .gitignore, .clang-format fies 2024-12-22 00:08:01 +01:00
Charlie Gordon
e4fb8c8428
Improve language colorizers (#54)
* fix detection of javascript partial comments in diff output
* colorize python annotations
* add simplistic yaml colorizer
* colorize .gitignore files
* improve shell buffer diff output colorization
2024-12-14 23:56:54 +01:00
Charlie Gordon
13f0d3bec9
Improve C-like language colorizers (#53)
* add `CLANG_C_TYPES` flag for generic C types
* add `CLANG_C_KEYWORDS` flag for generic C keywords
* add `CLANG_T_TYPES` flag for generic `xxx_t` types
* more explicit regex testing
* support for `u`, `U` and `u64` encoding prefixes
* improve comment detection in diff output for js and c3
* change `get_c_identifier` API for consistency
* add `is_c_identifier_start()` and `is_c_identifier_part()`
* move `qe_haslower` to **util.c**
* update C2 language keyword and type lists
* improve Pike colorizer
2024-12-14 20:27:25 +01:00
Charlie Gordon
118d8f44c1
Add support for C3 language (#52) 2024-12-11 07:59:49 +01:00
Charlie Gordon
f674419e75
Fix put_status/put_error behavior (#47)
* Fix `put_status`/`put_error` behavior

- use `put_error` instead of `put_status` for command errors
- prevent status message output to console during initialization
- use `put_error` for side effects in command errors
- add `&` prefix in status messages to force screen flush
- flush screen in `qe_display()`, remove redundant calls to `dpy_flush`
- fix gcc compilation errors and warnings
- remove most references to `global_screen`
- free font cache before closing the screen
- prevent mouse handling upon focus detection

* drop CI on macos-12
2024-12-03 22:52:55 +01:00
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
34620b7ce8 add cljc extension for Clojure and more TODOs 2024-11-10 00:44:20 +01:00
Charlie Gordon
fcc70e87ce add C2x keywords and types 2024-11-10 00:44:20 +01:00
Charlie Gordon
a99e3d672d fix TAB in preview mode in do_c_indent 2024-11-10 00:44:20 +01:00
Charlie Gordon
ea7665dee9 New indenting commands
- rename `indent_size` window field as `indent_width` for consistency
- handle negative argval in `do_tabulate`
- fix reverse region in `indent-rigidly`
- only indent lines that start in the region, ie: lines whose beginning
  offset >= start and < end
- fix `do_backspace` to delete a TAB worth of white space after TAB.
  no longer use `undo` for this.
- fix `find_window` to locate window according to top-left corner of current
- add `unindent-region` on `M-C-|` to unindent current region
- add `unindent-buffer`
- redirect `S-RET` and `S-DEL` to their unshifted versions
- rename `c-indent-command` command as `c-indent-line-or-region`
2024-10-11 09:14:16 +02:00
Charlie Gordon
e9bcc3a963 user more standard styles in Perl mode 2024-09-25 01:02:14 +02:00
Charlie Gordon
52da57f60c fix partial comment detection 2024-09-07 18:40:44 +02:00
Charlie Gordon
454cf61a79 use C indenter for Perl 2024-09-07 18:40:44 +02:00
oguillaumin
2995c4d9b4 Add colorizer for SerenityOS Jakt language 2024-08-31 13:49:00 +02:00
oguillaumin
2c2a91043e Fix some indentation issues
* fix `replace_indent` in mixed TAB/SPC cases
* merge `get_indent_chars` into `make_indent`
* improve `normalize_indent`
2024-08-31 13:49:00 +02:00
oguillaumin
329204ab58 improve C comment colorization of diff output in shell buffer 2024-08-31 13:49:00 +02:00
oguillaumin
1d3cabeaa2 Improve indentation commands
* add `find_indent` and `make_indent` ancillary functions
* add `untabulate` on `S-TAB` to remove one indentation level
* rename `do_tab` as `do_tabulate` for consistency
* `tabulate` indents the region one level if visible
* add `indent-rigidly` commands: indent block interactively
2024-08-31 13:49:00 +02:00
oguillaumin
9fde8fd9b9 Add syntax mode for nanorc files 2024-08-31 13:49:00 +02:00
oguillaumin
6d4f13b9ea add preliminary syntax mode for the rye language 2024-08-31 13:49:00 +02:00
oguillaumin
ee2e3c767b Colorize lines up to 16 MB
- add `eb_get_line_length()`
- move `buf` and `sbuf` to `QEColorizeContext`
- reallocate line and style buffers on long lines
2024-08-31 13:49:00 +02:00
Charlie Gordon
7b803ace0e Improve syntax coloring APIs
* pass const `char32_t` array and `QETermStyle` array to `ColorizeFunc`
* add `cp_colorize_line()` wrapper to call colorizer function on null
  terminated buffer.
* remove unused `EditBuffer` colorize fields
* remove `EditState` field `colorize_func`: rely on `colorize_mode` only
* no longer combine style into codepoint buffer.
* remove `STYLE_BITS`, `STYLE_SHIFT`, `CHAR_MASK`
* rename `set_colorize_func` as `set_colorize_mode`
* rename `SET_COLOR` and `SET_COLOR1` as `SET_STYLE` and `SET_STYLE1`
* add documentation for buffer API functions
2024-07-28 00:00:03 +02:00
Charlie Gordon
ea123bb012 Simplifications
* use `cp_skip_blanks` in language colorizers
* simplify signature matching for here documents
2024-07-28 00:00:03 +02:00
Charlie Gordon
af64810cb4 Add documentation on utility functions
* add `int ustr_get_identifier_x(dest, size, c, str, i, n, c1)`
* add `int cp_skip_blanks(const char32_t *str, int i, int n)`
2024-07-28 00:00:03 +02:00
Charlie Gordon
131490e482 Improve ppl-mode 2024-07-28 00:00:03 +02:00
Charlie Gordon
d60df466d3 Improve ustr_get_identifier
* remove `get_salmon_identifier()`
* change `swift_parse_identifier()` for consistency
* change `wolfram_get_identifier()` for consistency
2024-07-28 00:00:03 +02:00
Charlie Gordon
6e2b6e24c2 Add eb_add_tag()
* add `eb_add_tag(b, offset, name)`:
  * check for duplicate definitions
  * duplicate string argument
* use `ab_add_tag()` instead of `eb_add_property()` from language colorizers
* fix `get_js_identifier()` for `c == 0` case.
2024-07-28 00:00:03 +02:00
Charlie Gordon
a345775998 Add PPL mode
Add colorizer for Christian Neumanns' Practical Programming Language
2024-07-28 00:00:03 +02:00
Charlie Gordon
78254429f4 Some simplifications in C modes
* add `cp_skip_blanks()`
* extend `get_js_identifier()` for `c == 0` case
* export `java_mode`
* add documentation
2024-07-28 00:00:03 +02:00
Charlie Gordon
e2116cbdae
Modify perl colorizer for consistency with other languages (#30) 2024-05-20 11:03:29 +02: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
3b271c9d2e
Select javascript mode on QuickJS scripts (#23) 2024-05-19 18:00:37 +02:00
Charlie Gordon
a9d4b1c0fa Add v8-torque support
- colorize decorators @xxx in js-mode
2024-03-10 12:15:59 +01:00