* factorize evaluation result handling
* make QEValue.type signed to handle TOK_ERR and TOK_EOF
* extract buffer contents as UTF-8
* eval-region and eval-buffer take universal argument to insert expression
result instead of showing as message
* 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
* use memcpy and other value casts to avoid strict aliasing violations.
gcc 12.2 was wrongly assuming that utf8_decode(&p) did not modify p
because *pp was never explicitly set, albeit *(const u8 **)pp = p; was
storing te updated value of p into it and the code generated for that
was produced. The code generator was miscompiling strtokey1 because
the compiler relied on bogus code analysis at the call site.
The gcc team is wasting many hours of valuable debugging time.
They should at least issue a warning about aliasing rules violations.
* fix compiler warning on missing Xvideo header
* fix compiler warning on missing fallthrough
* bump version to 5.4.1c
* 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
* add search modes:
copy-matching-lines, kill-matching-lines, list-matching-lines
- add enum for search modes
* add search flag support in all search functions:
search_forward, search_backward, count-matches, delete-matching-lines,
delete-non-matching-lines, copy-matching-lines, kill-matching-lines,
list-matching-lines, query-replace, replace-string
- highlight matches during search string input
- add search flag toggle functions in minibuffer_edit
same code and bindings as for incremental search
- add handlers in CompletionDef for minibuffer_edit session start and end
- use generic search tag system to store flags in search string
* misc improvements and bug fixes:
- test and set append-next-kill on kill-region
- split `do_copy_region` from `do_kill_region`
- remove argument in `do_kill_region` for `kill-region`
- change immediate string argument code letter from 'S' to '@'
- exit popup with do_popup_exit() in do_keyboard_quit
remove popup_mode binding
- add ESiii and ESsii command calling conventions
- pass key and argval to:
minibuffer_complete, do_minibuffer_complete_space,
do_minibuffer_electric_key
* add default bindings:
`next-error` on `M-g n`, `M-g M-n`
`previous-error` on `M-g p`, `M-g M-p`
`goto-line` on `M-g g`, `M-g M-g`, `C-x g`
`goto-char` on `M-g c`
* bump version to 5.4.1a
* add wctoupper() and wctolower()
* add qe_unaccent(c);
* use ligature functions for the above
* handle accents in qe_toupper() and qe_tolower()
* add convert_entry() method in CompletionDef
* pass CompletionDef pointer to minibuffer_edit callback
- 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
- remove redundant include files
- no longer include qe.h in charset.c, libqhtml
- add unicode_join.h for bidir definitions
- move QASSERT, MAX_WORD_SIZE, MAX_FILENAME_SIZE from qe.h to util.h
- move CompleteState and CompleteFunc to util.h
- bump VERSION to 5.3.4z
- fix warnings in tools/cptoqe.c
- fix signed char issue in tools/kmaptoqe.c
- fix optional argument parsing in tools/unicode_gen.c
- generate qe_bidir_get_type() and qe_bidir_get_type_test()
functions for bidir_tables target
- rename unicode_tty_glyph_width() as qe_wcwidth()
- compute tables for qe_wcwidth() with tools/unicode_gen.c
from the latest Unicode version
- add qe_wcwidth_variant() to determine if terminal may use
incorrect width for a given glyph.
- reposition TTY cursor for glyphs with ambiguous width
- remove unicode_width.h
- add wcwidth.h and wcwidth.c generated by tools/unicode_gen.c
- update tools/unicode_gen.c and tools/unitable.c
- determine Unicode version support at start time
displayed by describe-screen command
- display code point width and variant in what-cursor-position command (C-x ?)
- bumped VERSION to 5.3.4x
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
- add charset.h
- add tools/unitable.c to compute unicode_width.h
- add tools/unicode_gen.c to compute more unicode tables
- use Unicode 15.0.0
- add rules to compute width tables from Unicode tables and TTY
- move basic definitions from util.h to cutils.h
- use CONFIG_SESSION for session support (undefined if CONFIG_TINY)
- define CompleteFunc and CT_xxx flags for completion functions
- pass CompleteFunc to xxx_complete() functions
this allows more generic implemetation, without including qe.h
- rename fill_border() as fill_window_slack() for readability
- add QELEVEL environment variable to detect recursive invocation
- use stricter parser for load_ligatures()
- bump VERSION to 5.3.4u
- split color/css functions from util.c into color.c
- add util.h and color.h for declarations
- util.c no longer includes qe.h
- move get_clock_ms() and get_clock_usec() to unix.c
- remove unused QString functions
- bump VERSION to 5.3.4s
- remove opaque argument in exec_command()
- remove CMD_ISS and CMD_ISSi command signatures
- pass window pointer to isearch_xxx() functions
- isearch-exit() takes key, sets mark where search started;
used for exiting incremental search on other commands.
- isearch-cancel() takes point back where search started;
used for isearch-abort()
- handle prefix argument in query-replace (word match)
- add query_replace_help() on '?', C-h, f1
- remove dead code
- bump VERSION to 5.3.4q
- remove opaque argument in exec_command()
- remove CMD_ISS and CMD_ISSi command signatures
- pass window pointer to isearch_xxx() functions
- isearch-exit() takes key, sets mark where search started;
used for exiting incremental search on other commands.
- isearch-cancel() takes point back where search started;
used for isearch-abort()
- handle prefix argument in query-replace (word match)
- add query_replace_help() on '?', C-h, f1
- remove dead code
- bump VERSION to 5.3.4q
- 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
- fix has_linum_mode(), was reporting incorrect value
- put_error() messages are also reported as status messages
- qe_parse_script() reports parsing errors with put_error()
- prevent potential infinite loop in shell_mode_free()
- bump VERSION to 5.3.4o
Change the settings controlling the display of line and column numbers
to mimic the behavior of emacs linum-mode:
- add global states:
- line-number-mode: control the display of line number in mode lines
- column-number-mode: control the display of column number in mode lines
- global-linum-mode: control the display of line numbers in the gutter
space for all regular buffers.
- add a buffer state:
- linum-mode: control the display of line numbers in the gutter space for
this buffer (overrides global-linum-mode when set).
- add commands to toggle or set these states:
- line-number-mode
- column-number-mode
- global-linum-mode
- linum-mode
- rename filter-matching-lines as delete-non-matching-lines (emacs name)
- bump VERSION to 5.3.4n
- improve operator lexer: produce token and precedence on 1 step
- merge parser.c and qescript.c
Fix other bugs
- close display before freeing memory in --free-all
- free TTYState in tty_dpy_close()
- free VarDef memory in --free-all
- fix crash bug on --free-all due to duplicating ModeDef structures
Improve variable handling:
- move do_describe_variable() to variable.c
- add var_alloc and str_alloc flags in VarDef to fix `end` hack
- remove ugly kludge to detect allocated strings
- type variables retrieved from environment
- free variable data on --free-all
- bump VERSION to 5.3.4m
- add QEValue utility functions:
void qe_cfg_swap(QEValue *sp, QEValue *sp1);
void qe_cfg_move(QEValue *sp, QEValue *sp1);
- add ds->start_line to restart parsing with correct line numbers
- add ds->newline_seen to handle automatic semicolon insertion
- implement skipping in qe_cfg_expr() and qe_cfg_stmt()
- implement comma and ternary operators
- upgrade tqe parser to token based
- fix lexer for multi character operators
- add qe_set_variable_offset() to control setting point and mark
- bump VERSION to 5.3.4l
- add utility function:
char *file_load(const char *filename, int max_size, int *sizep);
- publish QEValue, selected TOK_xxx and value setters in qe.h
- add more common functions in parser.c
qe_cfg_init(), qe_cfg_release()
- add generic argument parser qe_cfg_get_args()
- add conversion functions in qescript.c:
char(v), int(v), string(v)
- add delim argument in qe_cfg_parse_string() in parse.c
- pass QEmacsDataSource pointer to has_token(), expect_token()
- bump VERSION to 5.3.4j
- 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
Extend command dispatch system:
- add CMD_ARG_OPAQUE argument type
- add ISS and ISSi command signatures for ISearchState
- add CMDx() macro for disabled and future commands
- restrict command set in parsers
- add opaque argument for exec_command()
- add sort-region command, same as sort-lines
Extend binding system:
- move do_unset_key() from extras.c to qe.c
- accept bindings lists in unset-key commands
- add exact argument for qe_find_binding()
- reorder xxx_bindings arrays
Improve emulation functions:
- improve set-emulation command:
- add xxx_bindings arrays for emulations
- add register_emulation_bindings()
Search system:
- use exec_command to dispatch isearch functions
this allows easy redefinition of bindings, especially
useful for emacs flavor emulations
- add isearch_commands[] with bindings and command descriptions
- bumped version to 5.3.4g
- 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