Commit graph

57 commits

Author SHA1 Message Date
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
Charlie Gordon
214d02c67b improve current directory handling for shell mode
- get_default_path() takes buffer and offset instead of window
- mode specific handler returns NULL is current directory cannot be determined
- set EditBuffer->default_mode upon creating buffer_mode_data
- add ShellState->curpath to hold shell buffer current directory
- add shell_get_curpath to parse shell output for current directory
  in shell prompt, check if dir actually exists.
- update shell directory upon enter key.
  should instead keep a list with validity ranges
2016-11-26 11:30:29 +00:00
Charlie Gordon
8bd15ce4aa dired: support file patterns, improve current directory support
- add `is_filepattern` utility function to check for wildcards
- add `get_default_path` public function to retrieve the context specific
  current directory associated with a window.
- explore directories and file patterns in dired window
- compare-files determines parent file from current directory
- accept file patterns for dired listing
2016-06-13 17:12:35 +00:00
Charlie Gordon
d5e10dfe77 update copyrights, TODO list 2016-06-09 16:24:10 +00:00
Charlie Gordon
31f4362ce2 shell: improve shell editing, yank kill buffer at shell prompt
- add mode specific `delete_bytes()` method
- reorder `write_char()` and `mouse_goto()` mode methods
- pass `keep` argument to `do_kill()`
- pass `argval` to `do_kill_line()`
- add `do_kill_beginning_of_line()` command
- allow kill commands in read-only buffers, copies contents to kill-ring and
  moves point.
- change `do_kill_line()` semantics when invoked with numeric argument
- add `cur_prompt` and `last_char` in ShellState to track start of
  shell input line
- C-a moves to start of shell input, exits interactive mode if there already
- force interactive mode on shell-end-of-line and shell-end-of-buffer
- simplify shell_write_char(), remove hard coded dispatcher
- add `shell_delete_bytes()` to delete contents in shell input line
- change shell-kill-word and shell-kill-line to not rely on mode specific
  cursor movement commands because of asynchronous behavior.  This is also
  a problem for macros
- make shell-yank insert data via shell input.
- pause for 1ms after each CR sent to the process
2016-06-07 08:56:39 +00:00
Charlie Gordon
18734f7b08 extras: add compare_files
- add function and command compare-files() to compare a file
  with a modified version in the parent directory.
- improve compare-windows to fix ignore-spaces setting and improve resync
- fix show-date-and-time handling of universal argument
2016-05-21 15:45:19 +00:00
Charlie Gordon
1f5a77a784 portability: stop defining symbols starting with __ 2015-09-16 22:18:22 +00:00
Charlie Gordon
f0aa3a4bd8 cosmetics: untabify, remove trailing spaces 2015-08-27 23:03:39 +00:00
Charlie Gordon
c506fbc39f buffers: added extra information on page layout in describe-buffer 2015-08-22 20:37:49 +00:00
Charlie Gordon
a884c1514c use buf_puts for simple strings 2015-08-11 17:23:23 +00:00
Charlie Gordon
611e44403d prepare mode separation (view / syntax / data)
* add fields in EditBuffer struct
* pass buffer and flags to mode_init functions
* add default_mode_init function to avoid tests
2014-06-01 13:54:58 +00:00
Charlie Gordon
bbee33c57b improve key binding handling
* add fallback mode to share key bindings
* simplify key binding lookup method
2014-05-30 22:57:34 +00:00
Charlie Gordon
d46fa4a060 improve describe-buffer
* display all modes
* clump char / word / line counts
2014-05-29 11:35:17 +00:00
Charlie Gordon
ebc8f89a82 prevent strict warnings 2014-05-27 22:59:48 +00:00
Charlie Gordon
061b18655c clean up header, rename some fields 2014-05-26 14:35:37 +00:00
Charlie Gordon
55ebbc0d84 fixed max level for skipping deeply nested blocks 2014-05-18 10:49:58 +00:00
Charlie Gordon
00df0a88dc improve describe-buffer
* fix line number for files with an imcomplete last line
* display word count
* align byte stats for large files
2014-05-14 16:15:00 +00:00
Charlie Gordon
88c82885f8 prevent buffer overflow on very long lines 2014-04-29 22:25:49 +00:00
Charlie Gordon
90971b9861 improve c-mode
* add indent_func method in ModeDef
* make c-indent-region more general as indent-region
* add c-forward-conditional on M-]
* add c-backward-conditional on M-[
* add c-list-conditionals on M-i
* use trick to disambiguate M-[ and CSI sequences
* add eb_is_in_indentation(b, offset)
* fix c-mode indentation of case and default lines
2014-03-23 01:11:34 +00:00
Charlie Gordon
0e9fbc96a1 add tabify / untabify support
* add tabify-buffer and tabify-region
* add untabify-buffer and untabify-region
* make eb_delete and eb_delete_range return actual number of bytes removed
* simplify some deletions with better use of eb_delete_xxx functions
2014-03-21 20:49:30 +00:00
Charlie Gordon
3246605e1b improve colorizer for long lines
* use COLORED_MAX_LINE_SIZE for line buffers
* incomplete fix for "ERROR: cursor not found" bugs
2014-03-18 08:20:04 +00:00
Charlie Gordon
aa8304c43d fix show-bindings for redefined bindings
* merge find_binding and find_binding1, export as qe_find_binding
* check if binding is rebound to another command
2014-03-12 05:50:23 +00:00
Charlie Gordon
7ac0ecec24 fix describe-buffer byte stats table 2014-03-10 01:56:16 +00:00
Charlie Gordon
9eb5944588 Improve mode selection and mode specific command safety
* add set-auto-mode() to (re)select best mode for buffer
* add set-next-mode() on M-m to cycle appropriate buffer modes
* add set-previous-mode()
* add default_mode and saved_mode in buffers to improve mode switching
* add dired mode probing and store st_mode in buffer to detect directories
* add charset, eol_type and buffer in ModeProbeData
* clean mode selection and window buffer attachment (needs more work)
* compute sorted list of appropriate modes in probe_mode
* convert charset and eol_type in mode_probe
* add signatures in buffer priv_data to perform save casts
* move BufedState to b->priv_data, protect mode specific functions
  add bufed_mode_probe function, cycling through modes comes back to bufed mode
* move DiredState to b->priv_data, protect mode specific functions
  add dired_mode_probe function, cycling through modes comes back to dired mode
* add heading line in dired buffer with directory spec
* protect shell-mode specific functions.
* restart shell in shell() command if exited
* some cosmetics changes (remove useless __unused__, missing messages ...)
2014-02-10 21:21:39 +00:00
Charlie Gordon
559d7506bb Add describe-buffer
* add do_describe_buffer to enumerate all buffer attributes in a popup
* analyze buffer contents and show map of bytes present in buffer
* this eases debugging when non ASCII bytes are hard to see
2014-02-10 20:33:01 +00:00
Charlie Gordon
a7853b3dff add support for end of line types
* support 3 types of end of line: Unix, Dos and old style Mac
* detect eol type automatically in detect_charset
* set buffer eol_type together with charset
* transparently convert eol sequence to \n upon reading buffers
  characters in eb_nextc().
* transparently convert \n to eol sequence in eb_encode_uchar()
* handle eol types in convert-file-buffer-coding-system: either preserve
  current value or force it via charset suffix -unix, -doc and -mac
* change read_charset() to accept eol_type suffix
* add eol_type and eol_char to CharsetDecodeState
* change charset methods to take CharsetDecodeState instead of charset pointers
* display eol_type in mode line if not unix
2014-02-05 00:56:48 +00:00
Charlie Gordon
645b9c1aeb cosmetic changes
* report lack of undo information in do_undo and do_redo
* make region command remove region highlight
2014-01-31 14:50:13 +00:00
Charlie Gordon
e967914b5a improve consistency in new/delete methodology
* use qe_mallocz for all structures
* prevent spurious uses of malloc/free/realloc
* pass pointers to pointers to all deletion functions
* use consistent patterns for list deletions
* add more dependencies in Makefiles
2014-01-23 12:56:22 +00:00
Charlie Gordon
c0b4323ef9 merge eb_is_blank_line and eb_is_empty_line, simplify paragraph commands
* simplify eb_is_blank_line
* remove eb_is_empty_linek
* simplify paragraph commands with eb_is_blank_line
2014-01-19 17:25:02 +00:00
Charlie Gordon
2d61c2c0e1 add delete-horizontal-lines on C-x C-o
* add command delete-horizontal-lines in extras.c
* simplify do_delete_horizontal_space
* bind backward-paragraph and forward-paragraph to M-[ and M-]
* M-[ binding is not effective in terminal because it clashes with ansi
  escape sequences
* comment some key bindings for compatibility
2014-01-19 15:33:56 +00:00
Charlie Gordon
17b2c69145 fix problems with do_transpose and compute_crc
* improve compute_crc: no longer fail on simple 1 character transposition
* remove limitations on block size in do_transpose
* preserve styles in do_transpose
2014-01-17 13:19:14 +00:00
Charlie Gordon
2f98140860 add buf_put_key, buf_put_keys, use buf_t more consistently
* changed keytostr to buf_put_key using buf_t structure
* changed keys_to_str tp buf_put_keys using buf_t structure
* add buf_attach to initialize buf_t with non empty buffer
* simplify qe_list_bindings with inherit argument
2014-01-16 14:24:03 +00:00
Charlie Gordon
02da1bb7a1 add generic styles buffer from shell color mode
* styles_buffer hold static style info for each character in the buffer
* new buffer flags to create styles buffers with 1, 2 or 4 bytes per char
* copy static styles to the kill_ring and pasted them style enabled buffers
* preserve static styles in convert-buffer-file-coding-system
* display style bytes in bufed list
* add commands set-region-color, set-region-style, drop-styles
2014-01-15 19:44:24 +00:00
Charlie Gordon
62ee618b0d - added compile time test for qe_free argument type: must be pointer to pointer
- fixed crash bug in qe_unregister_binding1, missing indirection in qe_free argument
- added Darwin specific definition for 'end' (this is an ugly patch, to be removed)
- fixed crash bug in qe_set_variable, missing indirection in qe_free argument
2013-11-22 20:50:20 +00:00
Charlie Gordon
056c5330bb fixed cygwin compile 2008-05-02 17:11:19 +00:00
Charlie Gordon
9af558752e added about-qemacs command on C-H ? and f1
improved list-variables
2008-04-30 07:18:34 +00:00
Charlie Gordon
b82a15d4e4 added extra help functions:
added command apropos(string)
added command show-bindings(cmd_name)
moved describe-bindings to extras.c
added qe_get_prototype(CmdDef *d, char *buf, int size);
added an extra argument to qe_get_variable() to produce value as source
fixed typo on window variable window-height
fixed type mismatch on mode variable mode-name
added var_domain string array
added strquote conversion function with simplistic implementation
added history tags for all commands
2008-04-29 18:55:14 +00:00