Commit graph

1,356 commits

Author SHA1 Message Date
Charlie Gordon
6409d7eeb1 build: fix missing prototype warning
* fix clang warning [-Wmissing-prototype]:
  non static functions must be declared prior to definition
2026-04-30 16:38:52 +02:00
4g4
ded51b934f
feature: Add back-to-indentation command (#98)
Move point to the first non-whitespace character on this line.
2026-04-30 15:43:28 +02:00
4g4
202f599e99 Revert "fix bottom right corner refresh"
This reverts commit e593c24afbfec00137bc47a8b89790b295d3db3c.
2026-04-30 15:38:40 +02:00
4g4
5526233480 fix bottom right corner refresh
This hack is only needed in old terminals. In modern terminals we do not
need this. Besides, removing this hack will refresh the bottom right
corner.
2026-04-30 15:38:40 +02:00
Charlie Gordon
a599bc8503 Make important TODOs more obvious 2026-04-30 11:14:26 +02:00
popflag
9bfd8328ca fix #14: handle wrap mode when window is narrow 2026-04-30 09:42:56 +02:00
4g4
6cd79d45df bugfix: fix coredump when resizing terminal window
In the signal handler for the signal SIGWINCH tty_term_resize, we call
tty_dpy_invalidate function. In this function, we change the screen_size
and other critical fields.

While the process is executing the function tty_dpy_flush, and another
SIGWINCH occurs, then the screen_size is changed. And tty_dpy_flush will
access invalid memory which leads to coredump.

In the signal hander of SIGWINCH, we only need to set the flag
complete_refresh.
2026-04-30 08:41:26 +02:00
4g4
7303a8b693 docfix: fix LICENCE file name in README.md
- The filename is LICENSE, not LICENCE.
- There is no BUGS file in the repo.
2026-04-28 18:25:12 +02:00
Charlie Gordon
ebd1363764 CI: disable linux-s390x target
* `linux-s390x` continuous integration target takes too much time (>10mn)
2026-04-28 18:06:49 +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
93fe952ab8 fix clang 17 compilation warnings 2026-03-14 21:33:53 +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
d2db97217c disable transient bindings on next-error and previous-error 2026-02-06 13:02:09 +01:00
Charlie Gordon
60b709afdf add support for the Algol68 language 2026-02-06 13:02:09 +01:00
huwwa
9186032c64 use S_IXUSR instead of S_IEXEC 2026-02-06 12:45:28 +01:00
huwwa
93539ead18 replace depricated getdtablesize with sysconf 2026-02-06 12:45:28 +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
0fcdc0f4c9 Add list-colors and list-styles commands 2025-02-10 00:00:14 +01:00
Charlie Gordon
6f8eb7577b Fix crash bug in libqhtml
* fix crash on "https://support.apple.com/kb/HT208050"
* add missing initializer (stupid oversight)
* fix bogus overflow test (another nasty bug waiting to bite)
We desperately need warnings or idioms against such stupid errors.
Using constructors for all locally defined structures seems advidsable,
2025-02-09 14:52:51 +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
9547555fa8 Improve yank behavior in minibuf
* kill minibuffer contents when yanking an absolute path
  when prompted for a filename or directory
2025-02-07 20:40:50 +01:00
Charlie Gordon
0be0462674 Add Colorizer for Tcl/Tk 2025-02-07 20:40:18 +01:00
Mohammed Musharaf
4722694a9e x11 fullscreen: removed and added stubs to keep it simple 2025-02-06 17:47:22 +01:00
Mohammed Musharaf
099fb6a934 typo fix 2025-02-06 11:56:36 +01:00
Mohammed Musharaf
698e69d252 x11 fullscreen fixes and some memory cleanup 2025-02-05 21:02:58 +01:00
Charlie Gordon
4964b9fded Fix memory leaks
* fix bug in `eb_free` where log and style buffers were not freed
* free minibuffer history list
* free css symbols when finalizing the graphics html viewer
2025-02-05 17:47:32 +01:00
Charlie Gordon
6efd2c634f add colorizer for the Teal programming language 2025-02-05 08:47:55 +01:00
Mohammed Musharaf
120ffa9b34 x11:window bordering fix 2025-02-05 08:46:52 +01:00
Mohammed Musharaf
fb2285b2af x11 borderless fullscreen 2025-02-05 00:23:18 +01:00
Charlie Gordon
4d72f4ed05 cosmetics: remove trailing spaces, add trailing newline 2025-02-05 00:21:24 +01:00
Mohammed Musharaf
7bba7dc10c memory cleanup: x11 2025-02-04 09:19:11 +01:00
Mohammed Musharaf
2e87324590 Fix crash bug on qe_load_all_modules 2025-02-04 09:19:11 +01:00
Charlie Gordon
54248e1a29 fix crash bug on fill-paragraph 2024-12-22 00:08:01 +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
2f9dfb38ca Fix ASAN crash bug: allocate extra byte for null terminator in dbuf_str 2024-12-09 03:20:35 +01:00
Charlie Gordon
b2891d0cff show timing message to screen in qe_redisplay 2024-12-09 03:20:35 +01:00
Charlie Gordon
e0ba872d77
Improve error reporting (#50)
- rename `edit_new` as `qe_new_window`
- report error in `qe_new_buffer` and `qe_new_window` upon failure
- rename `qe_find_buffer_file` as `qe_find_buffer_filename`
- rename `read_charset` as `qe_parse_charset`
- reset yank buffer references in `eb_clear()`
- make `qe_init()` return error code and abort upon error
2024-12-08 19:43:26 +01:00
Charlie Gordon
57c46f97bc
Fix asan crash bug (#49)
- add debug info in asan, msan and ubsan builds
- avoid function call in `qe_unaccent` for ASCII chars
- fix `find_ligature` return type to detect simple ligatures with a simple test
- fix crash bug in `expand_ligature`, behavior was bogus anyway.
2024-12-05 12:04:58 +01:00
Charlie Gordon
d5200a06e6
Fix clipboard handling in Apple Terminal (#48)
- add clipboard handling method `2` using `pbcopy` and `pbpaste` on macOS
- use this method by default when running under macOS from the Apple
  Terminal. The last kill is copied to the system clipboard upon losing
  focus and the clipboard contents is retrieved and copied to a new kill
  buffer upon gaining focus.
2024-12-04 09:40:17 +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
d447da9ce0 Improve mouse support
Mouse:
- add `shift` state in all mouse events
- pass `QEmacsState *qs` to `qe_mouse_event`
- support non drag mouse events with `-m:2` command line option
- dragging beyond window borders generates scrolling events
  (should autorepeat, should have menu line at the top for scrolling up)
- cancel active search on mouse_goto
- do not mouse activate window if current active window is modal (popup or
  minibuf)
- handle double and triple click: select by words or lines
- handle shift click: extend selection
- add `EditState::mouse_down_offset` for initial dragging buffer offset
- pass `QEEvent *ev` to `mouse_goto()` handlers

events:
- add synthetic key events: QUIT CLOSE EXIT
- use synthetic events for GUI interaction (no longer simulate keystrokes)

tty:
- fix large OSC sequence support for terminal clipboard retrieval

Multicursor:
- use new `QECursor` for multicursor local states
- reallocate `multi_cursor` array in chunks

misc:
- add `eb_peekc(EditBuffer *b, int offset)`
- boolean cmdline options no longer require an argument, true if none provided
- int cmdline options either require an argument (CMD_LINE_INT_ARG) or take an
  optional argument, value is incremented if argument is not provided.
2024-11-10 00:44:20 +01:00
Charlie Gordon
34620b7ce8 add cljc extension for Clojure and more TODOs 2024-11-10 00:44:20 +01:00