Commit graph

93 commits

Author SHA1 Message Date
Charlie Gordon
6fb16e1cc2 Simplify and improve qe_check_buffer_file
* pass `QEmacsState` to key grab functions
* clear `grab_key_opaque` when freeing windows, buffers, mode_data
* add checks on window and buffer pointers in key grab functions
* this should fix a crash bug when deleting unsynched buffers from bufed
* fix `reload_buffer` to update buffer `file_size` and `mtime` fields
* check buffer file before invoking commands that modify the buffer
* check buffer file after command that changes the current window
  or the current window's buffer
2026-06-24 00:44:18 +02:00
Charlie Gordon
0cb68d2d74 Shell: improve current directory traking
* parse process output for shell prompts with current directory
* parse `make -w -C` output for temporary subdirectory excursions
* handle property type and flags separately
* add `QE_PROP_MARK` to prevent offset update at range boundary
* use `QE_PROP_DUP` to optimize buffer properties with single allocation
* use mask in `eb_delete_properties` to delete tags selectively
* fix `eb_find_property` range glitch
* fix offset tracking for CWD properties
* simplify default directory selection for shell commands
* fix compiler warnings on variable shadow definitions
* optimize `next_error()`: no lookback needed anymore
* display buffer properties in `describe-buffer`
* update TODO.md
2026-06-13 18:12:57 +02:00
Charlie Gordon
a0c8560e1e Fix previous-buffer cycling
* fix modulo arithmetics for negative values
* no special case of single buffer
2026-06-10 04:25:13 -04:00
Charlie Gordon
66eb50c39e Improve Makefile, github CI and TODO.md
* add generic target for host tools
* disable netbsd target in github CI (fails for unrelated reason)
* upgrade github CI to actions/checkout@v6
* clean and reorder TODO.md
2026-06-05 15:53:10 -04:00
huwwa
e79b7974bc popup-list: support M-n and M-p to move by 4 lines 2026-05-15 14:31:58 +02:00
Charlie Gordon
a599bc8503 Make important TODOs more obvious 2026-04-30 11:14:26 +02: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
0fcdc0f4c9 Add list-colors and list-styles commands 2025-02-10 00:00:14 +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
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
Charlie Gordon
ab86598e29 Automate modifyOtherKeys, mouse and clipboard support detection
- intialize `tty_mk`, `tty_mouse` and `tty_clipboard` to `-1` for automatic
- command line options force setting
- otherwise, configure support from environment variables (for now)
2024-10-11 09:14:16 +02:00
Charlie Gordon
4d5a5b001e use clipboard by default 2024-10-11 09:14:16 +02:00
Charlie Gordon
1df2fee78d more ideas 2024-10-11 09:14:16 +02:00
Charlie Gordon
ad69d01541 Add xterm clipbord support
- add `qe_encode64` and `qe_decode64` utility functions
- add command line option --clipboard to enable/disable tty clipboard support
- add `clipboard` trace option
2024-10-11 09:14:16 +02:00
Charlie Gordon
6a35bc268a Add xterm tty mouse support
- add command line option -m:X to configure mouse support
- add `mouse` trace option
2024-10-11 09:14:16 +02:00
Charlie Gordon
af1215ba24 Miscellaneous improvements
- add some missing emacs color names
- use `M-C-` prefix instead of `C-M-` in bindings, source and documentation
  but support both in `strtokey`
2024-09-25 01:02:14 +02:00
Charlie Gordon
0e90c18107 Add support for suspending qemacs
- add `suspend-qemacs` command
- add `dpy_suspend` QEDisplay method to handle suspending qemacs appropriately
- catch `SIGTSTP` and `SIGCONT` to adjust terminal state.
- add `qemacs-version` command
- bump VERSION to 6.3.2
2024-09-25 01:02:14 +02:00
Charlie Gordon
e566f23064 Fixed color handling
- bumped VERSION to 6.2.1
- add `css_get_color_name()` to get the name or hex spec for a color
- display style details in style completion window
- add `insert-color` command on `C-c #` to convert color names to hex strings
- fix missing intializers in `scale_cube6[]`
- improve grey/gray aliasing
- add color parser for XParseColor hex syntax rgb:rrrr/gggg/bbbb
- add `tests/reset-term-palette.sh` to reset the terminal color palette to
  default values.
2024-09-08 01:06:17 +02:00
Charlie Gordon
4dd72d26e1 Improve apropos display
* list extra commands separately (commands with matches in description only)
* colorize variable names
* fix tab-width computation to keep bindings aligned
2024-09-07 18:40:44 +02:00
oguillaumin
0450984ffd more ideas 2024-08-31 13:49:00 +02:00
oguillaumin
f05215c22c Add space deleting commands
* `delete-leading-space`: Delete any leading whitespace on the current line
* `delete-trailing-space`: Delete any trailing whitespace on the current line
* `delete-trailing-whitespace` Delete all the trailing whitespace across the current buffer.
These commands handle the region if highlighted
2024-08-31 13:49:00 +02:00
oguillaumin
1e691469a2 Add automatic block quoting on electric keys
* typing '"`<>()[]{} when a block is highlighted inserts matching delimiters
  around the block.
2024-08-31 13:49:00 +02:00
oguillaumin
2d9800662a Substantial dired rewrite
* add hierarchical view in dired left panel:
  - left on closed dir or file moves to parent dir
  - left on closed dir or file with no parent inserts the open parent dir at the top
  - right on closed dir opens the directory
  - right on open dir goes down to last visited item in this list or first if none
  - right on file skips to the right window in preview mode
  - space on directory expands or collapses it
* add `do_dired_path()`
* fix `qe_load_file()` for directories specified as relative paths
* fix `qe_load_file()` loading a directory into the dired left panel
* add dired sorting by fullname
* fix directory grouping for non alpha sort
* use direct array of `DiredItem` instead of `StringArray`
* add `dired_ignore_extensions[]`
* add `classify_fullnames()` to help with tree sorting
* add completion on `dired-sort` prompt
* add `dired-summary` on `?`
2024-08-31 13:49:00 +02:00
oguillaumin
667f18f774 more ideas 2024-08-31 13:49:00 +02:00
oguillaumin
d427acc62a Comments, ideas 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
e77e21bffd Select region on shifted cursor movement keys 2024-08-31 13:49:00 +02:00
Charlie Gordon
3852fb9c19 Update copyrights 2024-07-28 00:00:03 +02:00
Charlie Gordon
4be625f5c4 Improve macro handling
* add `macro-counter` variable
* add `QEState` fields `nb_macro_keys_run`, `macro_counter`, `macro_format`.
* add `int find_key_suffix(const char *str, char c)`
* pass `argval` to `do_call_last_kbd_macro` to handle early exit
* add `clear_macro`, `stop_macro`
* add `int check_format_string(const char *fmt, const char *template)`
* do not use `alloca` for `eb_vprintf`
* add `dbuf_str(db)`: null terminate the buffer and return a string pointer.
* add macro commands:
  `edit-last-kbd-macro`, `name-last-kbd-macro`, `insert-kbd-macro`,
  `read-kbd-macro`, `macro-add-counter`, `macro-set-counter`,
  `macro-insert-counter`, `macro-set-format`
* `start-keyboard-macro` restarts macro learning mode if learning already
* add documentation on macro commands
* stop macros upon errors (when ringing the bell)
* stop macros if prompting the user for confirmation
2024-07-28 00:00:03 +02:00
Charlie Gordon
492a8fc0ce Improve macro handling
* `C-x (` restarts macro learning mode if learning already
* add documentation on macro commands
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
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
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
6f34c65ef9
Use 1-based column numbers (#33)
- make `do-goto` accept a 1-based column number
- parse 1-based column numbers in filenames from the command line
- display 1-based column number in status lines
2024-05-21 15:14:55 +02:00
Charlie Gordon
b38d95345f
Add window-swap-states on C-x / to transpose windows (#29) 2024-05-20 00:29:23 +02:00
クエン酸
bed552a905 Add commands next-buffer / previous-buffer (#20)
* Bind `next-buffer` to `C-x C-right` and `previous-buffer` to `C-x left` just like GNU Emacs
* next-buffer & previous-buffer skip buffers with BF_SYSTEM flag.
* next-buffer & previous-buffer command is ignored from minibuffer and popups.
* fix compilation errors on linux
2024-05-19 17:06:04 +02:00
Charlie Gordon
a9d4b1c0fa Add v8-torque support
- colorize decorators @xxx in js-mode
2024-03-10 12:15:59 +01:00
Charlie Gordon
38e22bc211 Improve scripting language
- improve qs/js syntax highlighter
- improve markdown code block language detection
- fix binding for increase-width and decrease-width
- increase COLORED_MAX_LINE_SIZE to 16k
2023-07-08 22:54:49 +02:00
Charlie Gordon
7cf5878805 Add CSV mode
* add csv-mode with colorizer
* split lang/extra-modes.c to lang/emf.c and lang/sharp.c
* bump VERSION to 6.1.1c
2023-03-13 23:07:26 +01:00
Charlie Gordon
06b3d373bb Update number syntax for C23 and C++
* support quote as digit separator in C/C++ modes
  - this convention is horrible!
  - why not use _ which is compatible with the ppnumber syntax?
* bump VERSION to 6.1.1b
2023-03-09 12:57:59 +01:00
Charlie Gordon
d9633d761a Sundries
* update README.md and TODO.md
* study alternative key mapping scheme
* some constifications
2023-03-09 12:38:45 +01:00
Charlie Gordon
909f097165 Sundries
* should add auto-indent visual display for minified XML, JS, JSON files
2023-03-05 19:42:12 +01:00
Charlie Gordon
fcf4c46321 Add regex support for search and replace
* import libunicode and libregexp from QuickJS
* add utility functions:
  min/max_uint32, min/max_int64 clz/ctz/32/64
  bswap12/32/64
* add packed get and put inline functions
* add DynBuf package (dbuf_xxx)
* add unicode_to/from_utf8()
* add regex support in eb_search
* add partial regex support in query_replace: no subexpressions support
* bumped VERSION to 6.1.0
2023-03-05 13:34:19 +01:00
Charlie Gordon
bf0c938d19 Sundries
* bind `eval-region` to `M-C-z`
* fix configure and Makefile for arm64 target
* output selected target in configure

* bump version to 5.4.1f
2023-02-21 15:04:55 +01:00