Commit graph

1,476 commits

Author SHA1 Message Date
huwwa
44dfd66a5c minibuf: resolve bindings redefinition
* enable search bindings on `search_completion` entry and disable them
  on exit.
2026-07-16 10:42:22 +02:00
huwwa
97a59b25fd Mouse: fix bug on a single click
* reset the number of mouse clicks to zero after scrolling
  to prevent unintentional entire buffer marking.
2026-07-15 18:04:59 +02:00
huwwa
6dffbc37c3 Popups: fix bug on CF_NO_AUTO_SUBMIT 2026-07-15 18:04:17 +02:00
Charlie Gordon
576c2f5493 makefile-mode: select mode on makefile.in 2026-07-10 22:49:21 +02:00
Charlie Gordon
825b666574 C2 mode: add countof keyword and improve declaration detection 2026-07-10 13:30:22 +02:00
Charlie Gordon
1d8a9a15e4 shell-mode: fix shell prompt analyser glitch
* add sanity check in `shell_check_curpath` to prevent grep output
  from causing erroneous matches in the rudimentary shell prompt analyser
2026-07-08 13:52:50 +02:00
Charlie Gordon
cf296d29e9 Improve compare-files
* simplify parent file path construction
* load the parent file first so buffer name is filename if possible
2026-07-08 13:45:42 +02:00
Charlie Gordon
8a44e89a49 Simplify qe_set_user_option
* add `qe_add_resource_path`
* only add a resource directory if path fits completely
* clarify `qe_set_user_option` code
* add caveat in initialization code
2026-07-08 10:52:43 +02:00
Charlie Gordon
7338ea284d Simplify path constructions'
* add `append_filename`
* avoid using `makepath` when `append_filename` suffices
2026-07-08 10:44:54 +02:00
Charlie Gordon
abadf132f4 Improve directory handling
* add `get_path_offset` to skip drive/protocol, serveur name and root dir.
* add `get_parent_offset` to get the parent of path component
* add `get_curdir` to hide OS dependencies and test `getcwd` failures
* add `get_homedir` for current or specified user
* simplify `make_user_path`, `canonicalize_absolute_buffer_path`,
  `qe_set_user_option`
2026-07-08 09:51:55 +02:00
Charlie Gordon
9079f85034 Improve find_file_next and next-error
* no longer scan directory in `file_file_next` if pattern lacks wildcards
* patterns without wildcards can have subdirectory
* `next-error`: if file is not found in the current buffer directory, try
  and locate it in subdirectories
2026-07-06 20:41:55 +02:00
Charlie Gordon
4722d0ceff Improve c-mode colorizer
* make `countof` a C keyword
* improve type detection: identifier followed by optional stars and
  another identifier are assumed to be a typename in certain places
2026-07-06 13:32:16 +02:00
Charlie Gordon
3db56caebb Improve style buffer function consistency
* add `eb_style_putc` and `eb_style_puts`
* rename `eb_print_style` as `eb_style_printf`
2026-07-06 12:43:23 +02:00
Charlie Gordon
634d84f41d Improve style handling
* reorganize style attribute bits in `QEStyleDef`
* support more `text-decoration` bits (overline, line-through and box)
* add `css_get_enum_bits` to support `text-decoration` combinations
* fix sorting color issue: move newline with its style in `eb_sort_span`
* add completion handlers for style attributes, style and color names
* add `check_default_style` to prevent invalid default style
* improve style output in `list-styles` and style completion
* add `modify-style` command
2026-07-05 20:42:10 +02:00
Charlie Gordon
0952b42300 Fix display bug when killing active shell buffer
* add sanity check in `parse_arguments` to avoid printing
  to `stderr` if `s` has been deleted by command. Any command
  exiting the minibuffer causes it to be deleted, hence
  `qe_check_window(qs, &s)` clears `s`.  This caused a bug
  when killing an active shell buffer from bufed.
2026-06-30 09:27:48 +02:00
Charlie Gordon
b18e0d4308 Fix bug in mode probing logic
* use generic matcher if mode has `filenames` field
2026-06-29 10:23:35 +02:00
Charlie Gordon
9f1a43cf76 Improve asynchronous I/O handlers
* group urlio data into an `URLState` structure
* allocate `URLState` in `url_init()` and store it into the `QEmacsState`
* pass the `URLState` pointer to all `url_xxx` APIs
* add `tail_cb` for redisplay requests
* remove global variables
* simplify `qe_init()` call sequence
* add `QE_LIST_INIT` to initialize a linux doubly linked list
2026-06-29 00:21:54 +02:00
huwwa
d43d8ebd61 commands: add generic modified buffer examination approach
* add `qe_save_buffers` to handle synchronous/asynchronous
  modified buffer examination.
* refactor asynchronous modified buffer examination into command
  execution, allowing commands to suspend execution to save modified
  buffers and resume once the examination completes.
2026-06-28 23:54:04 +02:00
Charlie Gordon
b4c077180b Improve shell color handling
* add `eol_style` in `DisplayState`
* use style of newline character for end of line
* use style of last character if any for end of buffer style
* use current style for TAB expansion
* accept OSC escape sequences for default color redefinition
* fix `css_get_color` parser for `rgb:xx/xx/xx` format
* force complete refresh upon default terminal color updates
2026-06-27 15:50:01 +02:00
Charlie Gordon
820b640c14 Improve color handling
Vastly improve window style handling:
* fix status and minibuf style handling
* add inactive window styles (window, border and mode-line)
* add commands: `set-foreground-color`, `set-background-color`
  `set-default-style`
* add styles for `window`, `window-inactive`, `window-border-inactive`,
  `mode-line-inactive`, `terminal`
* use custom colors for COLOR_TRANSPARENT and terminal *original pair*
* terminal background color is default background color
* change `get_style` argument types and order
* add `qe_styledef_parse` to construct full styles from text
* rename `qe_term_get_style` -> `qe_term_style_parse`
* pass 2 styles and extra flags to `print_at_bytes` to handle
  alignment correctly
2026-06-26 23:36:00 +02:00
Charlie Gordon
4cb39bfd4d Improve window nagivation, fix crash bug
* pass prefix argument to `do_other_window`
* remove `do_previous_window`
* fix crash bug in `parse_arguments`: was crashing if window gets
  deleted by command invoked by `call_func` (eg: `C-x C-f C-u C-g`)
2026-06-26 23:17:32 +02:00
huwwa
6bd8a5a094 split-window: fix split width clamping range
* use the original window width when clamping
* fix typo
2026-06-24 00:46:20 +02:00
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
eda70b4576 Fix compilation warning 2026-06-23 10:14:28 +02:00
huwwa
f71fc6f25b shell: improve shell mode
* add `BF_ERROR` to identify error source buffers and use it with `next-error`.
* show `HELP` and `ERROR` buffer flags in `describe-buffer`.

* add a dedicated compilation mode with the following bindings:
  * `next-error` on `n`, `M-n`
  * `previous-error` on `p`, `M-p`
  * `scroll-up` on `SPC`
  * `scroll-down` on `DEL`
  * `search-forward` on `/`

  and the following new commands:
  * `goto-error` on `RET`, `LF`
  * `kill-compilation` on `C-c C-k`

* use `compilation` mode instead of `pager` mode for
  `do-compile`, and switch interactive shell buffers to
  `compilation` mode when the shell exits (if `shell_buffer_read_only` is set)

* refine popup/sidepane closing in `next-error`:
  * remove unnecessary popup check, as the command cannot
    be invoked if a popup window is present.
  * use `do_delete_window` to close side pane to avoid
    screen gap bug with `edit_close`.
2026-06-23 09:12:37 +02:00
huwwa
807339b3c8 Popups: fix stacking order of subsequent popups
* keep new popups on top by correcting boundaries when `next` is NULL
2026-06-23 08:53:39 +02:00
Charlie Gordon
863ae1736d split-window: fix window ordering in emacs emulation 2026-06-22 00:44:33 +02:00
Charlie Gordon
77a60060a4 split-window: improve split window logic
* add `split-window-left`, `split-window-right`, `split-window-above`
  and `split-window-below` to specify how to split window portably.
* improve split-window proportion handling, avoid tiny windows
* reduce minimum window size to 4x1 characters + modeline and borders
2026-06-21 23:30:37 +02:00
Charlie Gordon
be75d12772 Bindings: improve key binding handling
* fix dictionary sort to no longer ignore digits
* sort bindings in natural order
* improve `wall-chart` command: show overridden bindings with style
* add `describe-prefix-bindings` for a list of bindings with a common prefix
* add `describe-C-h`, `describe-C-c`, `describe-C-x`...
2026-06-20 11:06:11 +02:00
Charlie Gordon
8e3f3175a9 describe-screen: fix small issues in popup window
* fix layout and colors
* make hex values more explicit
2026-06-19 09:06:44 +02:00
Charlie Gordon
227c3dc5e8 Help: improve describe-xxx functions and help popups
* 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
2026-06-18 23:30:17 +02:00
Charlie Gordon
00ca728646 Keys: fix bug on control shift bindings
* `get_modified_key` used to ignore `KEY_STATE_SHIFT` if `KEY_STATE_CONTROL`
  was also passed, preventing proper parsing of `C-S-xxx` bindings
2026-06-18 23:30:00 +02:00
Charlie Gordon
b1613a8754 Display: fix popup display bug on bufed 2026-06-17 20:44:26 +02:00
huwwa
9f598197c7 Fix windows invalidation bug 2026-06-16 14:52:21 +02:00
Charlie Gordon
f61b6454ec Popups: fix display hacks
* force periodic redisplay for shell buffers even with active popups
* fix redisplay of overlapping popups
* fix stacked popup position and size
2026-06-16 12:17:43 +02:00
Charlie Gordon
24433f1e75 Fix compilation warning 2026-06-15 14:00:49 +02:00
Charlie Gordon
0dd79822e7 Variables: extend variable handling
* improve formating of variable values
* add `show-all-variables`
* add `long_format` in `eb_variable_print_entry`
* fix variable name completion
2026-06-15 13:53:34 +02:00
Charlie Gordon
18755e7e09 Popup handling: add generic approach to disable commands
* add `#` at the beginning of the comand argument description
  to disable command when current window is a popup or the minibuf
* update command definitions
2026-06-14 23:30:50 +02:00
Charlie Gordon
09fccc8508 Allow stacked popup windows
* `show-popup` now always allows popup windows. It is shown on top of an
  existing one and shifted down and right.
* fix redisplay in `do_popup_exit()`
2026-06-14 23:07:57 +02:00
Charlie Gordon
b56a8b9b44 buffer-navigation: simplify command dispatch
* use `p` and `q` to dispatch signed command argument
2026-06-14 22:31:17 +02:00
Charlie Gordon
abdf6a70c7 X11 display: fix frame redraw bug
* draw popup frames completely
* make frame borders 4 pixels thick by default
2026-06-14 01:35:15 +02:00
huwwa
c5e09df466 fix target window selection logic for next-error 2026-06-13 23:46:28 +02:00
huwwa
6facf1db3a fix infinite loop bug 2026-06-13 23:46:28 +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
huwwa
4f3c4dcd60 improve colors and styles
* add error-location style and colorize error locations.
2026-06-12 15:41:07 +02:00
huwwa
6e647fd6cb Add documentation for OSC 7 support 2026-06-12 15:41:07 +02:00
huwwa
f8a0b51d20 shell: improve current directory handling
* track the shell's current working directory using OSC 7.
* add `QE_PROP_CWD` buffer property, associate it with shell's cwd.
2026-06-12 15:41:07 +02:00
huwwa
32ecc2c050 shell: improve next-error
* remove popups, sidepanes, helppanes.
* verify file existence before opening.
* refine error/source windows:
    * find window showing the error source buffer,
      split a new one if none are found.
    * if current window is showing error source buffer,
      find file in next window, split a new one if none are found.
    * center cursor after going to error.
* show error line on window's first line.
* center cursor after going to error.
2026-06-12 15:41:07 +02:00
huwwa
073f6c005b shell: follow caption message on interactive shell
* remove unnecessary check.
* minor cosmetics.
2026-06-12 15:41:07 +02:00
huwwa
68d50fc88d shell: avoid silent exit for commands starting in popup/minibuf 2026-06-12 15:41:07 +02:00