Commit graph

93 commits

Author SHA1 Message Date
Charlie Gordon
e00a3d0cfa Improve command consistency
- use `n` instead of `dir` or `delta` when passing premultiplied argval
- describe-xxx commands take `argval` to avoid repetition
- move paragraph functions to extras.c
- bumped version to 5.3.1k
2022-08-15 14:33:30 +02:00
Charlie Gordon
f7c1621ebb Improve paragraph handling
- simplify do_delete_blank_lines(), fix case of non blank line
- remove eb_start_paragraph()
- do_mark_paragraph() takes ARG_VAL, make emacs compatible
- simplify eb_prev_paragraph(), make emacs compatible
- improve fill_paragraph():
  compute actual indent size (handle TABs)
  compute actual word sizes (handle accents and double width glyphs)
- bumped version to 5.3.1j
2022-08-13 16:16:21 +02:00
Charlie Gordon
757a6112f1 Improve word handling
- word_right() and word_left() return s->offset
- minimize buffer changes in do_fill_paragraph()
- eb_changecase() takes input and output offset arguments
- bumped version to 5.3.1i
2022-08-12 17:28:21 +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
b72b1773db Fix gcc compilation
- be more careful about snprintf target arrays
- fix bug in qe_load_file(): was testing local array instead of argument
- remove unused indent variable in clang.c
- pass pointer to CSSFile in css_close()
2022-08-03 16:47:12 +02:00
Charlie Gordon
1418387ce8 Improve buffer contents sorting
* add progress indicator every 8K comparisons
* add 2 byte cache on line contents
* add chunk offset to skip columns and ignored bytes
  also used for SF_BASENAME
* add filter-matching-lines
* prevent man-mode on .doc files
* allow ^Z bytes in text files
* add extra column syntaxes for compilers error messages
2022-03-21 16:30:28 +01:00
Charlie Gordon
fcf9136fdb Improve naming consistency
- rename qe_skip_spaces() as eb_skip_spaces() and take EditBuffer
- rename skip_spaces() as qe_skip_spaces()
- use qe_skip_spaces() return value to simplify loops
2020-11-25 18:55:15 +01:00
Charlie Gordon
a3fac89268 Add standard bindings, improve consistency
- `C-g` invokes keyboard-quit
- bind `ESC ESC ESC` to keyboard-quit
- prevent ESC key combination in `combine_keys()` if not first
- rename `abort` as `keyboard-quit` and do_break() as do_keyboard_quit()
- rename do_combine_char() as do_combine_accent()
- rename do_word_right() as do_word_left_right()
- pass numeric argument to do_scroll_left_right()
- pass numeric argument to do_minibuffer_history()
2020-11-08 00:47:24 +01:00
Charlie Gordon
28128ae68c Improve command argument parsing
- add description placeholders to all CMDx definitions
- swap arguments to qe_split_window() and do_split_window()
- pass iteration count based on universal argument to
  do_up_down(), do_left_right(), do_word_right(), do_kill_word(),
  do_forward_paragraph(), do_kill_paragraph(), do_c_forward_conditional(),
  do_forward_block(), do_kill_block(),
- remove do_backward_paragraph()
- add int eb_prev_paragraph(EditBuffer *b, int offset);
- dont call command on 0 universal prefix
2020-11-01 19:03:33 +01:00
Charlie Gordon
e1cd76cc3c Improve command argument parsing
- add CmdArgSpec structure for parse_arg()
- add argument type prefixes for defautl values:
  'm' prefix for CMD_ARG_USE_MARK, 'p' for CMD_ARG_USE_POINT
  'z' for CMD_ARG_USE_ZERO and 'e' for CMD_ARG_USE_BSIZE,
- rename parse_args as parse_arguments to avoid confusion with parse_arg
- make tabify-region and tabify-buffer call do_tabify()
- make untabify-region and untabify-buffer call do_untabify()
- move command argument specification to CmdDef:spec, followed by description string
2020-10-31 21:47:30 +01:00
Charlie Gordon
6a50b76644 Improve file and buffer completion, fix some inconsistencies
- fix completion bug where highlighted region was not removed upon enter
- add file_print_entry() in dired.c to display file size in file completion popup
- add buffer_print_entry() to display filename in buffer completion popup
- small fixes
- rename many C functions to match corresponding command name:
  do_return -> do_newline, do_quote -> do_quoted_insert,
  do_start_macro -> do_start_kbd_macro, do_end_macro -> do_end_kbd_macro,
  do_call_macro -> do_call_last_kbd_macro,
  minibuf_complete_scroll_up_down -> do_minibuffer_scroll_up_down,
  do_shell_return -> do_shell_newline, do_compile_error -> do_next_error,
  do_incr_width -> do_increase_width
- add do_open_line as a separate function
- simplify hex and binary mode navigation functions
- do_overwrite_mode(arg) disables overwrite mode if arg <= 0
- fix universal argument parsing for M-0 to M-9 and other subtle details
2020-10-28 23:49:09 +01:00
Charlie Gordon
c6b3780622 Add command and variable descriptions:
- add command and variable description field
- add fuzzy completion on repeated TAB in minibuffer
- remove fuzzy_search variable
- add CompletionDef flags:
  - CF_FILENAME to use `/` as separator
  - CF_NO_FUZZY to prevent fuzzy matching on second TAB
  - CF_SPACE_OK to prevent SPC from completing entry
  - CF_NO_AUTO_SUBMIT to insert current match on ENTER
- fix invalid free on CommandDef structures
- improve symbol completion in eval-expression
- use symbol completion in apropos
- fix post increment and decrement evaluation
2020-10-24 12:44:23 +00:00
Charlie Gordon
063c98dcd7 Improve buffer sorting:
- add SF_PARAGRAPH to sort multiline paragraphs
- sort commands and variables in print_bindings(), apropos(), about_qemacs()
- split buffer sorting code from do_sort_span() to eb_sort_span()
2020-10-24 08:04:30 +00:00
Charlie Gordon
e13fcfb543 remove trailing blanks 2020-10-21 15:01:52 +00:00
Charlie Gordon
c8414744e0 sundries 2020-10-18 09:23:34 +00:00
Charlie Gordon
d0b9f3dad4 bumped copyrights on modified files 2020-10-17 21:09:49 +00:00
Charlie Gordon
6e0564d4ed Improve completion system
- pass CompleteState to print_entry() handler
- remove list_get_colorized_line()
- remove get_colorized_line() window handler
- add colorize_mode along with colorize_func
- add list_display_hook() to fix list mode navigation
- rename generic_get_colorized_line() as get_colorized_line()
- fix memory leak in eb_add_property()
- pretty print tags in tag_complete() and list_tags()
2020-10-17 20:55:47 +00:00
Charlie Gordon
9d967ad29c Improve completion system
- 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
2020-10-17 15:41:31 +00:00
Charlie Gordon
cf8f4e4c5a add column and basename sort options 2020-10-02 20:26:21 +00:00
Charlie Gordon
23d82af50c Small fixes
- support SF_NUMBER for buffer sort
- fix image scaling
- support ESC c and fix ESC [ J escape sequences
- add C-u C-x C-n to parse nest-error from current buffer offset
- increase MIN_MMAP_SIZE to 2MB
- add window caption for popup windows
- store completion name in MinibufState for popup window caption
- adjust htmlsrc-mode score:
  85 if both extension and contents match rules
  80 if just one of them matches
- refine c-mode probe function
- simplify print_bindings()
2018-12-19 11:45:39 +00:00
Charlie Gordon
a1f7acdc52 Small fixes
- support SF_NUMBER for buffer sort
- fix image scaling
- support ESC c and fix ESC [ J escape sequences
- add C-u C-x C-n to parse nest-error from current buffer offset
2018-02-11 11:44:18 +00:00
Charlie Gordon
ff1952f5a0 display: improve line wrap handling
- add WRAP_AUTO and WRAP_TERM (for terminal emulator)
  WRAP_AUTO wraps lines if the window is more than 3/4 of the screen width
  if window is narrower, lines are truncated.
  WRAP_TERM does not display the \ wrapping mark to simulate terminal behavior
- add default_wrap member in ModeDef structure
- delegate to view pane for man, ssh and compile commands
2017-04-25 17:41:27 +00:00
Charlie Gordon
5bb58a9c16 display: improve window splitting API
- add EditState *qe_split_window(EditState *s, int prop, int side_by_side);
  takes proportion and direction
- set-trace splits the current window 75/25
- add start-trace-mode
2017-04-25 17:15:03 +00:00
Charlie Gordon
c57a7c6233 display: small fixes for consistency
- 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
2017-04-18 09:14:55 +00:00
Charlie Gordon
3580b53452 syntax: improve minibuffer and popup handling
- remove static state for minibuffer handling, use mode specific state attached
  to the buffer.
- remove static pointer for the popup last active window.  Use new
  target_window member in EditState.
- remove EditState.minibuf, replaced by WF_MINIBUF flag in EditState.flags
- rename minibuffer commands for consistency
- remove unused global variable debug_flags
- prevent search from minibuffer
- fix toggle-full-screen refresh bug. C-x f is bound to toggle-full-screen
  and could be typed by mistake for C-x C-f, switching to full screen mode
  but with a refresh delay.  This caused confusing behavior interpreted as a
  layout bug.
- make charset_ucs2le, charset_ucs2be, charset_ucs4le, charset_ucs4be local
  in charset.c
- make edit_detach() and edit_attach() local in qe.c
- redraw status and diag messages in edit_display(). This caused display
  bugs in x11 as asynchronous messages were erased by minibuffer window
  refresh.
- display status messages in diag area (bottom right screen corner) if
  minibuffer is active.
- force put_status message update if message starts with !
- force complete_refresh if window was resized or layout was changed
2017-04-17 18:14:15 +00:00
Charlie Gordon
e08867b692 basic: reduce global variable clutter
- make more registered objects static
- document some non static global objects
- remove some global variables
2017-04-16 21:51:19 +00:00
Charlie Gordon
6c595c1f2c colors: extend color system
- add 8K color modes and 64-bit QETermStyle values
- add 64-bit buffer style support
- reduce colored character system used in syntax handlers to 8-bit style
  and 24-bit code point
- use QETermStyle type instead of int wherever a composite style is used
- force color system used by the terminal with environment variables:
  USE_16_COLORS=1, USE_256_COLORS=1 or USE_TRUE_COLORS=1
2017-04-12 07:33:20 +00:00
Charlie Gordon
799b1489bc display: full support for 256 color virtual terminal
- add various utilities for color escape sequence testing:
  tests/16colors.pl
  tests/256colors2.pl
  tests/color-spaces.pl
  tests/truecolors.sh
  tests/xterm-colortest.sh
  tests/xterm-colour-chart.py
- use colored code-points only for syntax highlighting
- use QETermStyle and QEStyleDef internally
- convert to TTYChar attributes only for text terminal output.
- remove most CHAR_MASK and STYLE_SHIFT handling
- pass QETermStyle array to get_colorized_line mode handlers
- pass QETermStyle array to isearch_colorize_matches
- remove combine_static_colorized_line
- move color matching functions to util.c
- rename get_tty_color as qe_map_color
- improve local variable naming consistency:
  DisplayState *ds, QEStyleDef *stp, QEStyleDef styledef.
2017-04-03 08:33:57 +00:00
Charlie Gordon
4104ab568b display: improve color and style handling
- add support for 256 and true color terminals
- fix color handling for defined styles
- fix bold, italic and underline handling for terminals
- use more explicit symbols for qe-term emulator in shell.c
- shell buffer terminal emulator still uses 16 colors
- display buffer style in C-X =
- bumped version to 0.5.0dev
2017-04-02 01:12:01 +00:00
Charlie Gordon
ebadabb17a extras: improve compare-windows
- move resync code to separate function
- try and resync on spacing changes and single word changes
2017-04-01 14:38:28 +00:00
Charlie Gordon
073fbc3439 tags: fix some bugs, extend system
- pass target window to completion functions
- fix tag completion at find-tag prompt
- add tag support in python mode
- set tag offset to the actual word instead of start of line
2017-03-31 15:33:02 +00:00
Charlie Gordon
35d2610146 clang: add primitive tag support
- add buffer properties with offset tracking
- use buffer properties for type, macro, function and object definitions.
- display current function or type name on mode line
- add list-tags command to show the tags detected for the current buffer
- add goto-tag on C-X , and M-F1 to jump to the definition of the current word
- add find-tag on C-X . to search for a given tag with completion
2017-03-31 07:51:56 +00:00
Charlie Gordon
5ad42a0dc3 shell-script-mode:
- renamed script-mode to shell-script-mode
- merged patch by Hadrien Lacour
- improve parsing, recognise names, keywords, meta-characters, substitutions...
- add flexibility in forward-block (M-C-f) and backward-block (M-C-b) to
  match block delimiters with non default styles
2017-03-28 06:33:29 +00:00
Charlie Gordon
d06fdbfd14 basic: changed API for popup windows
- pass current window to show_popup()
- remove show_ptr argument from new_help_buffer()
- call show_popup() unconditionally
- add int eb_vprintf(EditBuffer *b, const char *fmt, va_list ap);
2017-03-26 15:57:24 +00:00
Charlie Gordon
7a8065c5a8 extras: improved compare-windows
- add static int qe_skip_comments(EditState *s, int offset, int *offsetp);
- add static int qe_skip_spaces(EditState *s, int offset, int *offsetp);
- add state variable ignore-comments
- C-u A-= toggles ignore-spaces
- C-u C-u A-= toggles ignore-comments
- C-u 2 0 A-= toggles ignore-spaces and ignore-comments
- compare-windows status messages document ignored stuff
2017-03-19 13:20:34 +00:00
Charlie Gordon
0d630448db shell: handle C-t and M-t at shell prompt 2017-03-18 14:13:33 +00:00
Charlie Gordon
26fd39d9e0 unicode: improve support for wide and combining code points
- qe_isaccent() recognises all combining code points (to be refined)
- add computer generated width table unicode_width.h
- display difference in hex in compare-windows to distinguish
  space and nbsp, normal and combined form for accented letters.
- display multiple combining code points in what-cursor-position (C-x =)
- attach combining code points to preceeding space in display_char_bidir
- handle accents specificaaly in flush_fragment
- handle combining code-points in screen backstore via indirection table
  this transient table can be inspected via describe-screen
2017-03-16 09:16:31 +00:00
Charlie Gordon
ec07d5aec8 basic: charset improvements
- add QECharset.encode_table as a default for CharsetDecodeState.table
- make CharsetDecodeState.table const
- use static initializers for utf8 tables
- add al32utf8 charset name (used in Oracle for true utf-8 encoding)
- use direct pointers in unicode_glyph_range_index
- initialize unicode_glyph_range_index at run time
- rename unicode_glyph_tty_width as unicode_tty_glyph_width
- changed unihex display to space out single width characters
2017-03-15 23:42:23 +00:00
Charlie Gordon
38fdd559f5 display: improve display structure handling
- add QEDisplay.dpy_describe handler
- rename dpy_init as screen_init
- allocate TTYState instead of using static struct in tty.c
2017-03-15 07:24:31 +00:00
Charlie Gordon
1ee5b56846 updated TODO, dates 2017-03-06 12:54:49 +00:00
Charlie Gordon
4f9f90b269 extras: fix backward-level at end of comment 2017-02-25 19:38:38 +00:00
Charlie Gordon
ef6310eec1 config: fix haiku compilation
- move local variable definition to start of block (patch by Francois Revol)
2017-01-31 21:38:02 +00:00
Charlie Gordon
94464bd939 dired: add filelist mode
- add `WF_FILELIST` window flag for preview-mode tests
- add `argval` argument to `do_dired()`
- `dired_view_file()` displays message and returns preview pane
- `dired` command with argument selects filelist mode with navigation pane
  bound to C-u C-x C-d
- add `filelist` command
2016-12-31 11:12:16 +00:00
Charlie Gordon
5bc6133fb3 sorting: add support for dictionary order
- improved stability, works for reverse-sort
- simplified reverse sort handling
- select dictionary order via C-u 2 A-x sort-buffer
2016-12-26 15:01:58 +00:00
Charlie Gordon
bd5086c85c build: remove c99 specific constructions 2016-12-26 09:28:36 +00:00
Charlie Gordon
be9f03731e basic: use our own version of qsort_r
- add `qe_qsort_r()` because some platforms do not provide `qsort_r()`
  it uses a median of 3 pivot selection and falls back to insert sort
  for small chunks.
- use `qe_qsort_r()` in dired, remove `state` field in `DirEntry`
- use `qe_qsort_r()` in sort-buffer commands
- make buffer sorting algorithm stable
2016-12-25 10:51:14 +00:00
Charlie Gordon
ef3974ecdd buffer: improvements
- fixed `do_forward_block()` to handle very long lines gracefully
- simplified `to_transpose()`
- add `do_describe_window()` for `describe-window` command on C-h w
2016-12-23 20:12:05 +00:00
Charlie Gordon
79bf90c8d6 basic: simplifications
- remove `eb_nextc_style()`
- `eb_nextc()` does not modify `b->cur_style`
- add `eb_get_style()` to retrieve style for given offset in full-style buffers
- add `eb_next()` and `eb_prev()` to skip chars
- pass `offset` to `eb_get_line()` and `generic_get_colorized_line()`...
- use `eb_skip_chars()` in `do_delete_char()` and `text_write_char()`
- replaced `eb_get_strline()` with `eb_fgets()` with similar semantics
  except return value is number of bytes before the newline or end of line
- no longer pass end offset to `isearch_colorize_matches()`
- just pass number of code points to `combine_static_colorized_line()`
- no longer call `isearch_colorize_matches` from `generic_get_colorized_line`
2016-12-23 19:51:48 +00:00
Charlie Gordon
8124c44bc9 extras: added sorting commands:
- sort-buffer, reverse-sort-buffer, sort-region, reverse-sort-region
2016-12-13 13:29:31 +00:00
Charlie Gordon
7397760c8e fixed crash bug in do_forward_block for very long lines 2016-12-13 13:26:16 +00:00