Commit graph

1,454 commits

Author SHA1 Message Date
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
Charlie Gordon
a0c8560e1e Fix previous-buffer cycling
* fix modulo arithmetics for negative values
* no special case of single buffer
2026-06-10 04:25:13 -04:00
Charlie Gordon
77e57d11c7 Colorization: improve colorization of diff and process output
* improve color combining code for diff/patch output: preserve code
  syntax coloring on red or green background.
* improve `curline_style` handling (needs more work)
* add `QETermStyle` transparent color handling in `apply_style`
* highlight trailing blanks in a single place
* transpose `qe_term_get_style()` arguments for consistency
* add `qe_term_style_string()` and `qe_styledef_string()`
* extend style string parser to accept missing foreground color
2026-06-09 14:19:28 -04:00
Charlie Gordon
d34d0680d5 compare-windows: improve resync on single line changes
* when subsequent lines match, try and skip changes on current line
2026-06-08 18:21:52 +02:00
huwwa
ce4ac13d48 Invalidate diag message on refresh and erase it on input 2026-06-07 13:48:53 +02:00
huwwa
ee2a886348 buffer/file fix some bugs
* fix crash bug on `C-X C-B C-X C-F xxx RET`.
* add check for `S_ISREG` as file name might contain a directory
  (e.g. *dired* buffer when starting qe with a directory), which
  caused a bug whenever that directory was modified asynchronously.
* increment pos after insertion.
2026-06-07 13:46:21 +02:00
Charlie Gordon
699bdff915 Simplify mode probing
* 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
2026-06-05 18:42:56 -04: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
9135840c67 X11: fix crash bug
* add null pointer tests for xim and xic to avoid crash
  if `X_HAVE_UTF8_STRING`.
* release resources upon closing display
2026-06-05 06:36:23 -04:00
Charlie Gordon
3da74c964b Buffer/file: add diff-buffer-file
* 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
2026-06-04 15:08:24 +02:00
Charlie Gordon
eff66d1e8c Buffer/File: check for file changes
* 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
2026-06-04 15:08:24 +02:00
Charlie Gordon
4d8fedb4c3 compare-windows: improve resync algorithm
* resync on current line if non trivial match at end of line
* try and find common block of identical lines by adding or deleting
  up to 60 lines
2026-06-04 13:22:34 +02:00
Charlie Gordon
c390f3fcfe block-navigation: refine methodology for comments and strings
* fix bug on character constants ('(' ...) when styles are disabled
* fix end of comment/regex detection when scanning strings
* handle double escapes: "\\\"" is a 2 character string
* stop scanning when reaching outer block boundary
* scan blocks of comments as a single entity
2026-06-04 13:22:10 +02:00
Charlie Gordon
7e2e2b5e7f improve colors and styles
* improve curline_style handling
* add completion for variable values
2026-06-04 13:21:46 +02:00
Charlie Gordon
7ccb4f4ae7 fixes in compare-windows and variable completion popup
* `compare-windows` used to toggle all ignore flags if invoked without
   an argument. This was bogus.
* when reading a variable name (eg: `eval-expression`), improve alignment
  of variable descriptions in popup window
2026-06-04 13:20:57 +02:00
Charlie Gordon
d852856f0d Fix compiler warning on ambiguous operator combination 2026-06-04 09:51:11 +02:00
huwwa
52417f1ec1 navigation: improve forward-block / backward-block
- ensure stopping at the precise boundary between adjacent strings/comments
separated by spaces.
- bypass bracket balancing inside strings or comments.
- prioritize bracket skipping inside comment/string when starting at a bracket.
- prioritize string skipping when starting at a quote.
2026-05-27 09:09:24 +02:00
Charlie Gordon
c702bd012f Bufed: fix sorting order for system buffers 2026-05-27 01:43:40 +02:00
Charlie Gordon
8977efa8a4 Shell: small improvements
* use `closefrom` if available
* use recommended approach to update tty winsize
2026-05-26 10:36:48 +02:00
huwwa
f91d04168b shell: refine non-interactive commands
* replace pty usage with pipes for non-interactive commands.
* remove `SF_INFINITE` flag.
2026-05-26 09:34:58 +02:00
Charlie Gordon
897b7555d2 bufed: improve sorting method
* 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
2026-05-23 22:34:28 +02:00
huwwa
832662b4a5 popup: prevent accidental window closure on keyboard-quit 2026-05-21 09:47:46 +02:00
huwwa
71963ca4c2 input: add select-input-method command 2026-05-20 20:35:56 +02:00