Commit graph

15 commits

Author SHA1 Message Date
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
d0b9f3dad4 bumped copyrights on modified files 2020-10-17 21:09:49 +00:00
Charlie Gordon
2aaabb719c scripting issues:
- always pass universal argument as last argument
- change do_compile_error() accordingly
- pass universal argument to do_eval_expression()
2020-10-13 07:14:17 +00:00
Charlie Gordon
49a1c1275b style and color fixes:
- document default styles
- skip_blanks() returns the next character
- simplify minimal parser
- handle multiline comments in config files
2020-10-09 00:00:55 +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
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
c5a3bb8ecb updated heading 2017-03-25 18:14:59 +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
24fb2ba964 parser: small fixes and comments in simplistic parser 2015-09-14 19:05:53 +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
b0d01a50ed config script: added new commands
- add eval-expression(expression) on M-:
- add eval-buffer()
- add eval-region()
- add +load <file> command line option to load a script file
- add +eval <expression> command line option to execute commands
  This can be used to benchmark load time:
  time qe `find . -name "*.[ch]"` +eval 'exit_qemacs(0)'
2015-08-11 22:15:38 +00:00
Charlie Gordon
6b0e73b689 compile parser.c separately
* publish parse_config_file() and parse_arg()
* change Makefile to compile objects for tiny version separately
2014-02-03 20:03:07 +00:00
Charlie Gordon
29b51f0457 split parser.c from qe.c
* store config parser as separate source file parser.c
2014-02-02 14:29:36 +00:00