Commit graph

253 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
063801372c file: improve qe_load_file API
- pass flags as bit mask for:
  kill_buffer, load_resource, cwd_relative, split_window
- fix bug with multiple files on command line from different directories
2017-03-15 07:32:48 +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
8573982c12 basic: improve goto-line and goto-char and next-mode
- handle size suffixes kmg and KMG
- split qe_find_target_window() for next-mode and find-file
  from a dired left pane
2017-03-02 15:21:16 +00:00
Charlie Gordon
983bef5bcc basic: show error message if load-resource-file fails 2017-02-25 19:39:49 +00:00
Charlie Gordon
56a0b95bc4 config: fix window context for .qerc files fix code fragment coloring
- save and restore qs->active_window around .qerc config file parsing
  and set qs->active_window to target window for attribute setting.
2017-01-31 20:22:13 +00:00
Charlie Gordon
5e8c4b023d shell: colorize file fragments from compilation and grep
- add `offset` member in `QEColorizeContext` structure
- add `ModeDef *qe_find_mode_filename(const char *filename, int flags);`
- make `combine_static_colorized_line` public
- add public function `shell_colorize_line`:
  detect file fragments with filename followed by `:` without space at bol
  special case clang errors that display the file contents after the line
- special case `shell_colorize_line` for static color combination scheme
2017-01-01 15:40:46 +00:00
Charlie Gordon
23bfd2ea69 basic: C-l twice recenters the window 2017-01-01 12:51:22 +00:00
Charlie Gordon
0f1d2244e7 basic: improve config file handling
- add `add-resource-path(string)` to add a new resource directory
- bind `load-file-from-path` on C-c C-f
2016-12-31 18:45:08 +00:00
Charlie Gordon
dee4908fe8 display: disable broken bidir display 2016-12-31 11:28:41 +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
87a151fd95 comments 2016-12-27 12:31:36 +00:00
Charlie Gordon
f41235695f display: some fixes, simplifiations
- add `gutter_width` in `DisplayState` for line number column
- add `int get_glyph_width(QEditScreen *screen,
                           EditState *s, int style_index, int c);`
  and `int get_line_height(QEditScreen *screen,
                           EditState *s, int style_index);`
  to compute font dimensions from style index and window
- compute borders more accurately in `display_window_borders()`
- clip text drawing, use window relative coordinates in `flush_line()`
- fix width computation for diagnostic status display in X11
- use QE_STYLE_DEFAULT and remove redundant e->default_style references
2016-12-27 10:13:46 +00:00
Charlie Gordon
8587dd62a2 display: improve handling of very long lines
- simplify the code
- fix display of continuation lines when line numbers are visible
2016-12-26 13:57:36 +00:00
Charlie Gordon
bd5086c85c build: remove c99 specific constructions 2016-12-26 09:28:36 +00:00
Charlie Gordon
7969fbb276 build: use separate object directory for x11 build
- configure no longer defines CONFIG_X11 in C
- generate modules.txt in each target directory
2016-12-25 23:32:48 +00:00
Charlie Gordon
f9ebd10d55 display: simplifications and comments
- add remarks about tricky display internal states
- display `x_disp[]` on mode-line
2016-12-23 22:51:47 +00:00
Charlie Gordon
4e1cb3cf37 display: improvements
- pass `cursor_func` and `cursor_opaque` to `display_init()`
- add dummy `display_close()`
- add `DISP_NONE` display mode
- fix timing message display, trim *messages* buffer
2016-12-23 20:28:56 +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
374b514528 display: small improvements
- rename method dispatcher `text_display` as `display_line`
  rename corresponding mode based handlers as `xxx_display_name`
- rename method dispatcher `text_backward_offset` as `backward_offset`
- add default text handlers for `move_bof` and `move_eof` in
  hex, binary and unihex modes
- handle utf-8 in window prompt (ex: default buffer name for C-x b)
- add various TODOs
2016-12-23 15:51:51 +00:00
Charlie Gordon
9c99730239 display: cursor handling
- merge do_center_cursor and do_center_cursor_maybe:
  do_center_cursor takes an `int force` argument
- add set-window-style command to change `e->default_style`
- change argument sign for do_scroll_left_right() for consistency
  scroll window by increments of space_width
  toggle WRAP_LINE, WRAP_WORD and WRAP_TRUNCATE in do_scroll_left_right()
- do not force WRAP_TRUNCATE in dired view pane to avoid problems on files
  with extremely long lines
2016-12-23 13:00:55 +00:00
Charlie Gordon
71ab83a208 display: optimize low level buffer content read functions
- remove style handling from eb_nextc()
- add eb_nextc_style()
2016-12-13 17:20:51 +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
e0961c3a4e completion: improve popup window handling
- fix completion popup current selection display
- TAB toggles completion popup open/close if there are matches
- SPC opens the completion popup and pages down through matches
- add non ambiguous completion as highlighted region in mini-nbuffer
- adding more characters with popup active rescans and filters list
- remove completion popup as more typing occurs without a match
2016-07-29 11:20:08 +00:00
Charlie Gordon
cb3f1a1f61 edit: delete or kill the highlighted region automatically
- typing now first deletes the highlighted region
- delete-char and backward-delete-char delete the highlighted region if any.
- kill-line kills the highlighted region if any.
- yank first deletes the highlighted region
2016-07-29 11:04:31 +00:00
Charlie Gordon
a4247a878f dired: improve current directory support
- pass EditPane to canonicalize_absolute_path() to make current directory
  context based.
- use shell buffer context based directory for next-error.  Should actually
  use more context such as current position to compute current directory.
- move canonicalize_absolute_path() and is_abs_path() from util.c to qe.c
2016-06-26 08:35:25 +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
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
4e653889ab dired: load directories in dired pane 2016-06-07 06:50:44 +00:00
Charlie Gordon
64149adc97 shell: improve current directory handling
- add get_default_path mode function
- move dired specific code to dired_get_default_path()
- add shell_get_default_path(), gets directory from prompt on current line
2016-05-27 18:20:30 +00:00
Charlie Gordon
2b55531e13 shell: improve interactive mode switching
- beginning of buffer (M-<) and end-of-buffer (M->) indirect through mode
- switch in and out of interactive mode on beginning- and end-of-buffer
- improve other cursor movement handling in shell buffer.
- add shell-intr(), shell-delete-char(), shell-delete-word(),
  shell-backspace(), shell-kill-line(), shell-yank(), shell-tabulate()...
2016-05-21 16:13:41 +00:00
Charlie Gordon
9ddd52a7ac basic: made force-tty a global setting and user accessible variable 2016-03-07 10:35:22 +00:00
Charlie Gordon
b962e33ade updated copyrights 2016-03-06 19:53:06 +00:00
Charlie Gordon
482ea06c1b basic: improved timing feature
- accept non breaking space in qe_isspace() and qe_isblank()
- added cmd_start_time for timings
- added cache qs->diag_shadow for diag/timing messages
- use global state for cmd_start_time to display the innermost timings
- display timings at the bottom right with put_status(s, "|diag");
- prevent qe_register_cmd_line_options from registering the same table twice
- added dummy option `-nw` so non graphics qemacs does complain
2016-03-06 17:59:22 +00:00
Charlie Gordon
afabce40f1 build: improve portability
- detect X11 configuration in configure script, no longer
  assume directories in Makefile
- added CONFIG_XSHM and check for XShm availability
- added TARGET_OS and TARGET_ARCH to make specific object dirs
- no longer redefine qe_module_init in qe.c
- added tqe.c: combined source version of tiny version
- added target xqe to build it, but it currently generates an
  executable significantly larger than tqe.
  This oddity is under investigation.
2015-10-14 09:31:20 +00:00
Charlie Gordon
1f5a77a784 portability: stop defining symbols starting with __ 2015-09-16 22:18:22 +00:00
Charlie Gordon
16aa2940f6 fix cpp compilation: fix enum values and types 2015-09-16 21:45:27 +00:00
Charlie Gordon
6dfb503d62 fixed do_set_visited_file_name if no file associated 2015-09-16 21:42:18 +00:00
Charlie Gordon
630c3ab063 fix compilation issues
- keyword order for inline functions
- track qs->active_window at load time
2015-09-16 12:40:58 +00:00
Charlie Gordon
9b433ae687 sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
  on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
  * qe_load_session() is invoked before parsing the command line if
    use_session_file is set, via the config file or command line option (-s)
  * do_save_session() is invoked just before closing qemacs.  It can also
    be invoked as a command and shows a popup window with the contents of
    the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
  spurious crashes when invoking commands from script files. This affected:
  find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
  load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
Charlie Gordon
f0aa3a4bd8 cosmetics: untabify, remove trailing spaces 2015-08-27 23:03:39 +00:00
Charlie Gordon
581eef3b5d buffers: fix improbable bugs
- make kill buffers system buffers (not displayed in buffer-list)
- only create *scratch* buffer in qe_kill_buffer() if needed
- prevent crash if killing style, log or kill buffers
- display \n as ^J in minibuf
2015-08-27 22:51:56 +00:00
Charlie Gordon
9331372a54 modes: upgrade mode selection and handling
- separate buffer and window specific mode data management, new API:
   QEModeData *qe_create_buffer_mode_data(EditBuffer *b, ModeDef *m);
   void *qe_get_buffer_mode_data(EditBuffer *b, ModeDef *m, EditState *e);
   QEModeData *qe_create_window_mode_data(EditState *s, ModeDef *m);
   void *qe_get_window_mode_data(EditState *e, ModeDef *m, int status);
   int qe_free_mode_data(QEModeData *md);
- make a list of buffer specific mode data areas so multiple major modes
  can co-exist in different windows for the same buffer
- add mode.mode_free callback to release buffer specific resources
- remove buffer.close callback
- shell state is now buffer specific shell_mode data
- clean up compress and archive mode
- show more buffer modes in buffer-list
- simplify edit_set_mode(), display error message on failure
2015-08-27 15:31:59 +00:00
Charlie Gordon
03db9d420a modes: simplified mode setting and saving
- get rid of ModeSavedData structures
- save window data upon buffer change and mode setting
- make generic_mode_close() and generic_mode_init() local
- simplify edit_set_mode() and switch_to_buffer()
- reset w.insert, w.hex_mode, w.hex_nibble, w.unihex_mode, w.wrap
  to mode specific default values upon mode change.
- split do_set_next_mode() command into qe_set_next_mode() lower level
  function with an extra status parameter report new mode.
2015-08-26 22:51:24 +00:00
Charlie Gordon
f408a15503 buffers: misc improvements
- renamed kill_buffer_noconfirm(b) to qe_kill_buffer(b)
- pass extra argument to do_kill_buffer(b, force)
- add buffer name cache to quicken eb_find()
- always make buffer names unique with simpler naming scheme
- small improvement in new_yank_buffer()
2015-08-26 00:53:23 +00:00
Charlie Gordon
bc874d74b7 buffers: improved tracing function
- add EB_TRACE_COMMAND
- change the format of the *trace* buffer
2015-08-26 00:24:14 +00:00
Charlie Gordon
9014b3de79 buffers: clean up, add data_type_name
- rename raw_buffer_load1() to eb_raw_buffer_load1()
- rename log_reset() to eb_free_log_buffer()
- add buffer.data_type_name to display proper handler on modeline
2015-08-25 16:19:42 +00:00
Charlie Gordon
dff0947665 search: show search matches, fix bugs
- fix bug with word-match incremental search
- pass max offset to eb_search
- simplify search code, keep separate u32 and flag arrays
- add ISearchState* to EditWindow to display current or last matches
- add style for search matches
2015-08-19 20:33:01 +00:00
Charlie Gordon
91284c13a6 modes: fix bug in probe_mode, buffer was not NUL terminated 2015-08-19 19:54:29 +00:00