* 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
* rename and pass flags to byte quoting functions:
`byte_quote` -> `strquote_byte`
* add `eb_print_style` to output data to a buffer in a given style
* add `eb_print_field` to output a field name and value using styles
* use styles in describe commands
* improve byte stats and page layout output in `describe-buffer`
* add `wall-chart` command (sorted list of bindings)
* add `describe-help` command
* 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
* add command to compare buffer with its file in a popup
* add [d] for diff when prompting for buffer/file synching
* add default behavior for buffer/file synching
* add CONFIG_LINUX, CONFIG_FREEBSD, CONFIG_OPENBSD, CONFIG_NETBSD
* add diff styles
* keep track of original file size and time in buffer data
* check for file changes upon window change, buffer modification and save
* prompt for reloading buffer contents and other options
* keep track of buffer creation, modification and access times
* add buffer sorting methods (buffer times, pathname, basename)
* always sort systems buffers last in alpha order
* small touch up in modeline
* improve block skipping:
- if starting inside a string or a comment, skip to the end of the
string or comment while balancing blocks
- otherwise skip string and comments when balancing blocks
- fix behavior on very long lines, eg: **highlight.pack.js**
* if a nesting error occurs, point and mark are set around the mismatched
delimiters. use C-x C-x to skip between them
* simplify `get_colorized_line()`
* add `cp_get_line()` to factorize code
* add `eb_peek_prevc()` to get previous codepoint without end offset
* improve documentation conciseness
* 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
* 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
- 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
* 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
- add `QETraceDef qe_trace_defs[]` and `qe_trace_defs_count` to enumerate
flags and flag names
- use this for all trace commands instead of explicit tests
- add traces for mouse and clipboard events
- fix `buf_put_key()` for control keys
- add command line argument -mk=X for xterm modifyOtherKeys setting (0,1,2)
- improve argument parsing to avoid seg fault on bogus arg spec
- report command line argument errors in popup window
- improve escape sequence handling in tty.c
- support bogus iTerm2 encoding of option/command/control key combinations
- add `swap_int()`
- add commands for multi-line cursor:
* `start-multi-cursor` on `C-x <`
set the mark for a region with a cursor on each line
* `end-multi-cursor` on `C-x >`
end recording the multi-line cursor region and start editing
cancel the multi-line cursor with `C-g`
* `add-multi-cursor` on `C-x #`
add an extra cursor at point. Activate multi-line cursor editing
with `C-x \`
* `activate-multi-cursor` on `C-x \`
start multi-line cursor editing. Stop with C-g.
- UX is tentative, more work needed based on usage.
- replace `qe_malloc_dup()` with `qe_malloc_dup_bytes()` and `qe_malloc_dup_array()`
- replace `qe_realloc()` with `qe_realloc_bytes()` and `qe_realloc_array()`
- pass numbers of objects to `qe_malloc_dup_array` and `qe_realloc_array`
- add `qe_strndup()`
* 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
- add `repeat` command on `C-x z`
- add `repeat-mode`, always enabled
- cycle all matching tags in current file on `goto-tag` and `find-tag`
- set up `repeat-mode` for these commands:
- `undo` on `C-x u` (`u` repeats `undo`, `r` performs `redo`)
- `undo` on `C-x r` (`r` repeats `redo`, `u` performs `undo`)
- `find-window-left`, `find-window-right`, `find-window-up`, `find-window-dow`
repeat navigation on `up`, `down`, `left`, `right`
- `next-error`, `previous-error`: `M-n` and `M-p` repeat in corresponding direction
- `next-buffer`, `previous-buffer: repeat buffers nagivation with `left` and `right`
- `enlarge-window` / `shrink-window`: repeat resizing on `^`, `v`, `{`, `}`
and cursor movement keys
- `goto-tag` on `C-x ,` goto next tag with `,` and `.`
- `call-last-kbd-macro` on `C-x e`: repeat macro on `e`
- add `eb_count_buffers` and `eb_get_buffer_from_index` for safe buffer navigation
- add transient bindings, known as repeat maps in GNU emacs
- pass `KeyDef **lp` (aka key maps) instead of mode for binding commands
- replace `do_next_buffer` and `do_prevous_buffer` with repeatable command
`do_buffer_navigation`
- fix `bufed_select` crash bug when selecting buffer from a regular window
*equivalents* are strings that should compare equal in a `compare-windows`
session. You can define such strings in a **.qerc** file in the directory of
one of the files being compared. This helps ignoring known changes such as
type of function renaming... Here is an example to help compare files between
the `bellard/quickjs` and the `quickjs-ng/quickjs` repositories:
```
define_equivalent("JS_DupValue(ctx, ", "js_dup(");
define_equivalent("JSValue", "JSValueConst");
define_equivalent("JS_NewInt32(ctx, ", "js_int32(");
define_equivalent("JS_NewInt32(ctx,\n", "js_int32(");
define_equivalent("JS_NewUint32(ctx, ", "js_uint32(");
define_equivalent("JS_NewUint32(ctx,\n", "js_uint32(");
define_equivalent("JS_NewBool(ctx, ", "js_bool(");
define_equivalent("JS_NewFloat64(ctx, ", "js_float64(");
define_equivalent("JS_EXTERN ", "");
define_equivalent("JS_EXTERN JS", "JS");
define_equivalent("JS_EXTERN JS_", "JS_");
ignore_equivalent = 1;
```
Other changes were necessary for proper utf8 skipping:
- add `utf8_prefix_len(str1, str2)` to compute the length of a common initial
prefix not falling inside UTF-8 encoded codepoints.
- add `utf8_decode_prev` to get the previous codepoint
- add `eb_match_str_utf8_reverse`
* add multi-line strings with """ syntax and escaped newlines
* call commands with allocated string arguments instead of local arena
* improve triple quoted string support in C like colorizers
* increase SEARCH_LENGTH to 2K (should use allocated arrays)
* fix kill-matching-lines definition
* fix utf8_to_char32 implementation inconsistency for empty destination
* fix buffering errors in eb_insert_utf8_buf() and eb_insert_char32_buf()
* bump version to 5.4.1e
* eb_get_region_contents and eb_get_contents take an extra argument
encode_null to encode embedded null bytes as "\xC0\x80"
* use steps instead of flags for isearch state array:
max 256 code points, 512 steps and 768 search bytes
* add remove_string() to remove a string from a StringArray and pack the array
* rename get_history() as qe_get_history() and make it public
* prevent multiple registration of command tables in qe_register_commands()
* silence compiler warning on array size in charname_complete()
* remove last_search_u32 data, use search history list instead
* restrict search commands to the current region if highlighted
* bump version to 5.4.1b
- char32_t is defined in cutils.h but may conflict with <uchar.h>
- all qe_isxxx functions take a char32_t
- add etf8x encoding for full range of char32_t type
- add utf8_decode_strict()
- add ustr_match_keyword()
- utf8_encode() / utf8_decode() handle up to 32 bits
- improve detect_charset():
- detect utf8 and utf8x
- avoid failure on partial utf8 sequence at end of buffer
- detect overlong utf8 sequences
- fix display bugs for code points beyond MAX_UNICODE_DISPLAY
- simplify do_compare_windows(), avoid magic char values.
- rename functions:
eb_encode_uchar -> eb_encode_char32
eb_insert_uchar -> eb_insert_char32
eb_insert_uchars -> eb_insert_char32_n
eb_match_uchar -> eb_match_char32
eb_delete_uchar -> eb_delete_char32
eb_replace_uchar -> eb_replace_char32
utf8_to_unicode -> utf8_to_char32
- use char32_t for all variables and arrays holding code-points
- fix some language syntax parsers.
- fix detect_eol_type_32bit(), used uint16_t instead of uint32_t
- bump VERSION to 5.4.0
After spending a few hours debugging a stupid memcpy size error, I
decided to use a typed version of memcpy, memcmp and memmove wherever
the array type size is greater than 1.
- add blockcmp(p1, p2, n), blockcpy(p1, p2, n), blockmove(p1, p2, n)
for operation on typed arrays
- add max_uint() and min_uint()
- bumped VERSION to 5.3.4w
- fix prefix argument handling for describe-key
- echo prefix keys after "Describe key: " prompt
- move session commands to qe.c, remove them from tqe
- use byte_quote() in do_describe_buffer()
- use b->offset to track insertions in describe-xxx commands
- eb_putc(), eb_puts() and eb_printf() insert at `b->offset` instead of `b->total_size`
- do not use eb_write() in eb_trace_bytes()
- bump VERSION to 5.3.4p
- add byte_guote() to encode a single byte
- encode non ASCII bytes in strquote()
- split function call parse and evaluation into qe_cfg_call() in tqe's parser.c
- use has_token() in full parser
- fix bogus function name in config file parsing errors
- bump VERSION to 5.3.4i
- move code to do_prefix_argument()
- more qe_ungrab_keys() to isearch_key()
ungrabing should be based on grab function return value
- an explicit 0 prefix argument prevents command execution
unless the command explicitly receives the prefix argument
- use code_letter in exec_command(), qe_get_prototype()
- bump VERSION to 5.3.4h
- rename s->insert as s->overwrite with opposite semantics
- fix overwrite mode behavior:
TABs are filled, then removed
TABs and newlines are always inserted
backspace removes TABS and newlines
backspace overwrite previous glyph with 1 or 2 spaces except at EOL
backspace only replaces with spaces before a TAB to preserve layout
quoted-insert always inserts
- quoted-insert inserts special key as escape sequences
- make KEY_UNKNOWN and KEY_NONE special keys matched by KEY_IS_SPECIAL()
- eb_replace() returns the number of bytes written
- add text_screen_width() to compute the actual screen column
- add convenient bindings for laptops with limited special keys:
- overwrite-mode: C-c o
- insert-mode: C-c i
- toggle-read-only: C-c %
- not-modified: C-c ~
- document set-visited-file-name
- remove filename if set-visited-file-name with an empty string
- simplify eb_insert_uchars()
- bumped version to 5.3.4e
- add qe_iswide()
- add eb_next_glyph() / eb_prev_glyph()
- use a larger unicode_glyph_range_index[] array
- add s->cur_offset_hack to track when current position is in
the middle of a wide glyph
- pass w to qe_term_overwrite(): erasing 1 or 2 positions
- erase partially overwritten wide glyphs
- remove qe_term_put_char()
- bumped version to 5.3.4d
- add eb_skip_accents(), eb_skip_glyphs(), eb_delete_glyphs()
- overwriting a character with accents replaces it completely
- C-d deletes characters along with subsequent accents
- handle wide characters and accents in shell console
- handle repeated wide characters
- use Hex in trace_buffer for non-ASCII bytes
- bumped version to 5.3.4c