* 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
* 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
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.
- 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.
* 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
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.
- 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)
- 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`
- 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
- 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()`
- 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
- 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
- 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 screen_top to avoid recomputing from buffer contents
- fix getline behavior on very long lines in shell buffer
- add LF bindings to run qemacs in lldb session
- qe_term_get_pos() returns screen start
- handle \t and wide chars inside shell buffers for xy positioning
- split qe_term_goto_pos() from qe_term_goto_xy()
- add flags in qe_term_goto_pos():
TG_RELATIVE_COL: column number is relative to offset position
TG_RELATIVE_ROW: row number is relative to offset position
TG_RELATIVE: column and/or row is relative
TG_NOCLIP: do not clip destx/desty coordinates
TG_NOEXTEND: do not modify buffer to reach destination
- add qe_term_fix_wrap() to break wrapping lines
- fix qe_term_goto_tab() behavior on long lines
- fix qe_term_skip_lines() to handle wrapping lines
- handle UTF-8 for lastc and repeat graphics character
- bump VERSION to 5.3.3e
- made some local objects static
- fix many const cast issues
- fix comma operator warnings
- add const correct strtol_c(), strtoll_c(), strtold_c()
- add unconst(t) to override const removal warnings
- comment VLAs and flexible arrays
- use get_basename_offset() to enable const correct
get_basename() and get_basename_nc()
- use get_extension_offset() to enable const correct
get_extension() and get_extension_nc()
- always include config.h
- use size_t for some size arguments:
umemmove(), umemcpy(), umemcmp(), qe_memicmp()
- add qe-doc.info and qe-doc.pdf targets
- fix shadowing bug in buf_write: used tor return 0 instead of byte count
- bumped version to 5.3.1e
- add QE_STYLE_BLANK_HILITE style for extra blanks at end of lines
- add MODEF_NO_TRAILING_BLANKS flag to control this feature on a mode basis
- add -nc (--no-crc) command line option du disable CRC based update cache
- add disable-crc global variable for the same purpose
- fix termios c_oflag flags in raw mode
- rename and extend CompletionEntry as CompletionDef
- create xxx_completion CompletionDef structures
- rename xxx_completion() functions to xxx_complete()
- register CompletionDef structs with qe_register_completion()
- add (start, end) range in CompleteState
- use eb_puts() and eb_putc() instead of eb_printf()
- simplify eb_delete_chars()
- ignore left pane in compare-windows()
- simplify qe_list_bindings()
- improve command and variable completion popup
- fix spurious crash bug on bad qesession file.
- make bold terminal text with colors 0-7 appear brighter
this makes black bold terminal test appear grey instead
of invisible
- add bitmap formats for 4BPP and BGR combinations
- add color palette in QEPicture
- add xfactor and yfactor in QEDisplay for preferred pixel granularity
yfactor is typically 2 for text mode display
- add dpy_draw_picture() device function
- add bitmap drawing functions:
qe_create_picture(int width, int height, QEBitmapFormat format, int flags);
int qe_picture_lock(QEPicture *ip);
void qe_picture_unlock(QEPicture *ip);
qe_free_picture(QEPicture **ipp);
QE_PAL_MODE(r, g, b, incr)
int qe_picture_set_palette(QEPicture *ip, int mode,
unsigned char *p, int count, int tcolor);
int qe_picture_copy(QEPicture *dst, int dst_x, int dst_y, int dst_w, int dst_h,
const QEPicture *src, int src_x, int src_y, int src_w, int src_h,
int flags);
int qe_draw_picture(QEditScreen *s, int dst_x, int dst_y, int dst_w, int dst_h,
const QEPicture *ip,
int src_x, int src_y, int src_w, int src_h,
int flags, QEColor col);
- add 3 compile time selectable image interfaces in flactal.c benchmark
terminal emulator:
- add EditState.cols and EditState.rows: window dimensions in characters
- pass target window to new_shell_buffer()
- use window size for shell terminal emulator initial screen size
- set COLUMNS and LINES environment variables for child processes
- factorize emulator character output
- increase number of CSI arguments
- simplify and improve CSI m argument processing including
multiple argument sequences
- minimal support for `:` as argument separator eg:
\033[38;5;128:128:128m
- support erase line vt100 command:
\033[K, \033[0K erase end of line
\033[1K erase beginning of line
\033[2K erase complete line
debugging:
- pass string argument to set-trace: on, off or list of trace indicators
- remove doctor command
- add QE_TRACE_EMULATE for emulator trace messages
- fix incorrect uses of eb_delete()
- add wrappers in display.h
- renamed tty dpy_xxx handlers for consistency
- separate tty_term_resize called on signal and tty_dpy_invalidate
- add dpy_xor_rectangle for software cursor, remove QECOLOR_XOR