Commit graph

168 commits

Author SHA1 Message Date
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
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
Charlie Gordon
7391eb26c5 Configure: reorganize the configure script and Makefile
Clarify tiny build options:
* distinguish `tiny` which controls whether the tiny version should be built
* and `tiny_only` which restricts the build to just the tiny version
* add `--disable-tiny` to set `tiny=no`
* add `--tiny-only` to only build the tiny version
* add js, json and c2 modes in tiny version
2026-05-19 00:08:53 +02:00
Charlie Gordon
60b709afdf add support for the Algol68 language 2026-02-06 13:02:09 +01: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
0be0462674 Add Colorizer for Tcl/Tk 2025-02-07 20:40:18 +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
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
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
oguillaumin
9fde8fd9b9 Add syntax mode for nanorc files 2024-08-31 13:49:00 +02:00
oguillaumin
a2ddad9aba Merge qeconfig.h into qe.c
- remove qeconfig.h
- insert `basic_commands` definition table in main module qe.c
2024-08-31 13:49:00 +02:00
oguillaumin
6d4f13b9ea add preliminary syntax mode for the rye language 2024-08-31 13:49:00 +02:00
François Revol
0935cb4894
Atari port fixes (#35)
* Do not use CFLAGS for host tools when cross-compiling.
* Add a missing $(EXE). Maybe we should have a HOST_EXE but at least we can build.
* set target OS & CPU
  Not really used, only for cosmetics.
  Also, m68k is big endian. (Do we use this anywhere yet?)
* Force GNU-C99 standard for LLONG_MIN
* work around missing d_type in dirent struct
2024-07-28 00:04:20 +02:00
Charlie Gordon
e0d9a641d3
Add repeat-mode (#34)
- 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
2024-05-25 23:37:05 +02:00
Charlie Gordon
ea6a70963e
Improve documentation, configure and CI(#31)
- update **scandoc** tool
- start manual framework in qe-manual.c
- build qe-manual.md as a default target
- add more targets: linux-32bits, linux-390x, NetBSD, OpenBSD
- fix FreeBSD target: define `host_cc` 
- test for `bwapxx` macros
- test for `clang` / `gcc` / `tcc` compiler presence
- handle non standard `which` utility
2024-05-20 19:43:01 +02:00
Charlie Gordon
a388a95305
Pass QEmacsState pointer to all module_init and module_exit functions (#24) 2024-05-19 19:15:08 +02:00
Charlie Gordon
b5ef5511ca Add Crystal language colorizer (work in progress) 2024-02-10 20:01:33 +01: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
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
oguillaumin
f36144d6a8 Change license to MIT
* bumped VERSION to 6.0.0
2023-03-05 02:04:02 +01:00
oguillaumin
cb5fbbce4e Merge qfribidi into unicode_join
* remove qfribidi.h and qfribidi.c
* simplify get_mirror_char(), use table from Unicode 15.0
* improve bidir_get_type(), compact_list()
* use combined type tests for 3, 4 and 6 types
* bumped VERSION to 5.4.2
2023-03-05 01:12:14 +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
Charlie Gordon
d0f7b7a904 Various improvements for consistency
* add -Wno-packed compiler option
* add CONFIG_REGEX flag, undefined for tiny build
* disable regex commands in tiny build
* add documentation for some search commands and APIs
* reorder search tags for readability
* add isearch_yank_char
* use emacs names for:
  isearch-repeat-backward, isearch-repeat-forward,
  isearch-ring-advance, isearch-ring-retreat,
  isearch-yank-word-or-char
* add occur alias for list-matching-lines
* add char32_to_utf8()
* restored some macros in cutils.h:
  likely(x), unlikely(x), __maybe_unused, BOOL, FALSE, TRUE
* remove max(), min(), maxp(), minp(), clampp()
* add typed arithmetic functions:
   min_int(), max_int(), clamp_int(), min3_int(), max3_int()
   min_offset(), max_offset(), clamp_offset()
* use typed functions everywhere

* bump version to 5.4.1d
2022-11-21 00:20:18 +01:00
Charlie Gordon
138be0a3ca Improvements in search functions
* 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
2022-11-11 15:45:49 +01:00
Charlie Gordon
0099f138c9 Move UTF-8 utility functions to util.c
- simplify utf8_decode()
- simplify longest common prefix code in do_minibuffer_complete
- remove redundant include files
2022-10-17 18:38:21 +02:00
Charlie Gordon
c561a42273 Reduce header file dependencies
- 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
2022-10-15 19:32:59 +02:00
Charlie Gordon
1beb610d76 Update glyph width methodology
- 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
2022-09-27 22:30:05 +02:00
Charlie Gordon
bd50376780 Various improvements
- 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
2022-09-19 15:16:59 +02:00
Charlie Gordon
b8f81236cd Split util module
- 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
2022-09-15 11:28:34 +02:00
Charlie Gordon
a402c88341 Start a Quick Emacs Manual
- add tools/scandoc utility to extract doc comments from source code
- add qe-manual.c documentation framework
- add qe-manual.md target for convenient repository documentation
- document some utility functions
- add strtod_c(str, endp) for const strings
- add Makefile target qe-manual.md
- bump VERSION to 5.3.4r
2022-09-13 15:29:40 +02:00
Charlie Gordon
e7c7a14400 Improve qescript parser and evaluator
- 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
2022-09-05 20:27:48 +02:00
Charlie Gordon
e1b513d5a8 Default to is_player mode: qe starts dired when invoked with no arguments
- add is-player global variable. Default to dired when invoked with no arguments
  Set to 0 in ~/.qe/config to prevent this and show *scratch*
- merge modes/list.c into qe.c
- bumped version to 5.3.4a
2022-08-28 00:40:58 +02:00
Charlie Gordon
f85805f683 Improved VT100 emulation in shell buffers
- 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
2022-08-26 12:30:29 +02:00
Charlie Gordon
8df349aeb3 Reduce tiny build
- remove command description strings in tiny build
- reorder clang submodes
- bumped version to 5.3.3c
2022-08-19 22:38:38 +02:00
Charlie Gordon
475b50458d Remove CONFIG_INIT_CALLS hack
- use portable init_all_modules() on all architectures
- remove initcalls options in configure
- output Qemacs VERSION and CC version in configure
- remove qeend.c
- bumped version to 5.3.2a
2022-08-17 22:04:02 +02:00
Charlie Gordon
9e6c81d65e Improve build process
* remove modules.txt hack
* generate target specific xxx_modules.c source file in OBJS directory
* use same OBJS directory for terminal and X11 object files
* no longer recompile qe.c when any other source file changes
* bumped version to 5.3.1h
2022-08-12 11:37:02 +02:00
Charlie Gordon
ec01d90a76 Makefile: only create object and binary file directory if making targets 2022-08-11 12:43:35 +02:00
Charlie Gordon
d052ab31ff Fix many compilation warnings for clang -Weverything
- 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
2022-08-10 18:50:19 +02:00
Charlie Gordon
87bfb0d046 Fix packaging issues
- remove FILES variable in Makefile: no longer invoke git implicitly in make
- bumped version to 5.3.1
2022-08-04 12:29:16 +02:00
Charlie Gordon
fda88cdb42 Miscellaneous fixes, add Salmon mode
* more todos
* add Salmon programming language
* disable -Wno-unused-result on OpenBSD
2021-04-18 21:03:45 +02:00
Charlie Gordon
2450fae550 echo config flags in terse output 2021-02-01 20:41:00 +01:00
Charlie Gordon
da22ee7f3b Improve build process
- factorize target rules,
- use recursion for different targets
- make debug versions for all targets
- add help target
2021-02-01 20:38:29 +01:00
Charlie Gordon
e8fc3b130d tidy up module list 2021-01-26 09:39:32 +01:00
Charlie Gordon
1af2af7d31 fix splint target 2020-11-23 00:00:49 +01:00
Charlie Gordon
9d3c15e85a fix splint target 2020-11-22 23:53:07 +01:00
Charlie Gordon
02f647d02a Fix t1qe target rules 2020-11-21 13:17:39 +01:00
Charlie Gordon
cbe325b000 Split more languages from lang/extra-mode.c:
- add asm inifile postscript modes as separate modules
2020-11-20 23:44:36 +01:00
Charlie Gordon
0212e35f05 Split more languages from lang/extra-mode.c:
- add agena coffee elixir erlang julia ocaml modes as separate modules
2020-11-19 23:54:59 +01:00
Charlie Gordon
3b4f3c9f48 Split more languages from lang/extra-mode.c:
- add ada basic fortran haskell lua pascal python ruby smalltalk sql
  vimscript modes as separate modules
2020-11-18 23:20:57 +01:00