Commit graph

44 commits

Author SHA1 Message Date
Charlie Gordon
48c14ba824 add support for combining marks (accents)
* add qe_isaccent() to test for combining marks
* add do_combine_char() command to insert or remove combining marks
* fix some display glitches involving combining marks
* add expand_ligature() and combine_accent() to handle simple ligatures
* change do_what_cursor_position() to display combining marks
2014-02-01 12:49:06 +00:00
Charlie Gordon
b953aaf811 improve consistency in buffer variables
* change tab-size to tab-width
* make tab-width a buffer variable
* add fill-column buffer variable
* add set-fill-column on C-x f
* add default-tab-width and default-fill-column global variables
* force indent-tabs-mode in makefile mode
* force tab-width to 8 in shell output buffers
2014-01-21 00:01:20 +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
f545ee779b add do_mark_region, do_mark_paragraph
* add do_mark_region to set hilighted region
* add command mark-paragraph on M-h
* make command mark-whole-buffer display hilighted region
2014-01-16 14:28:28 +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
c258955d08 improve undo system
* use bit 2 in b->save_log to suspend callbacks and logging during transient
  undo phase.
* dispatch callbacks before buffer modification (eb_delete)
* this fixes bugs in the undo system where some offsets were not properly
  updated, color buffer was shifted, cursor would get lost and sometimes
  crash would follow.
* buffer colors are not undone properly
* pass extra int argument to buffer callbacks
* make eb_offset_callback more generic: handle edge effect via extra arg.
  edge effect causes offset to move upon insertion at current value
* add new log variables log_last_char and last_log.
  use these to coalesce consecutive log records and make undo more efficient
* add new command "redo" on C-x C-_ and C-x r
* fix undo glitches in the process buffer, update cursor correctly upon redo
2014-01-14 03:29:36 +00:00
Charlie Gordon
4f5152024c add commands to insert combining accents
* add meta commands to insert combining accent code points:
  - M-`  insert-grave-accent
  - M-'  insert-acute-accent
  - M-^  insert-circumflex-accent
  - M-"  insert-diaeresis
* reordered some commands in qeconfig.h
2014-01-13 19:30:59 +00:00
Charlie Gordon
ab445e4bc1 improve overwrite-mode
* accept universal argument: NO_ARG: toggle, ==0 insert, !=0 overwrite
* added insert-mode command
2014-01-06 10:24:26 +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
Charlie Gordon
caf6950145 renamed CMD_ and CMDV to CMD2 and CMD3 for consistency 2008-04-25 10:46:58 +00:00
Charlie Gordon
174c5a38fd renamed universal argument as numeric argument 2008-04-22 09:28:33 +00:00
Charlie Gordon
0f862d64dd pass key to exec_command and call_func
added intrinsic command argument ki for last key pressed
simplified C electric keys: : ; { } invoke the same command c-electric-key
pass actual key to self-insert-command
handle M-d, M-DEL, M-p, M-n in shell mode
2008-04-08 09:25:16 +00:00
Charlie Gordon
1266c949ef added completion on style property names 2008-04-04 12:06:07 +00:00
Charlie Gordon
7868f2b05c added command find-file-other-window
added module extra.c for commands in full version
added command compare_windows
added command delete_horizontal_space
added command show_date_and_time
moved block navigation and kill commands from clang.c to extras.c
2008-03-31 20:35:31 +00:00
Charlie Gordon
cb8abc29fc added primitive Shell-script mode in module script.c
added extensions .idl .json .pcc for c-mode
match perl scripts on #!.*bin/perl.*
added DisplayState.space_width
added do_electric_filename on minibuf_mode / and ~
expand ~ syntax upon completing filename entry in minibuf
enable undo in minibuffer
2008-01-12 09:57:40 +00:00
Charlie Gordon
a5eae3ed92 bumped copyrights, some cosmetics 2008-01-08 16:37:54 +00:00
Charlie Gordon
26319c05a7 cosmetics: reformated command definitions 2008-01-04 23:04:11 +00:00
Charlie Gordon
f11cf4a207 eb_scratch takes buffer creation flags
added eb_find_new -> find a buffer by name, create one from flags if not found.
qe_register_cmd_table takes ModeDef* instead of mode name
do_global_set_key -> do_set_key with local/global flag
added local-set-key
reuse *bufed* buffer if one exists
bind increase/decrease-width commands from command definition
cosmetics, comments, remarks
renamed kill buffers from *yank* to *kill-%d*
save QErrorContext in parse_args, load_all_modules:
  improves readability in *messages* buffer
fixed qe_init to fall back from x11 display to terminal session upon failure
2008-01-04 22:24:37 +00:00
Charlie Gordon
a71b9efbb4 renamed do_set_mode -> edit_set_mode
use match_extension in mode probe functions
pass move indicator to do_return, removed do_open_line
renamed do_cmd_set_mode -> do_set_mode for consistency
separated strfind and strcasefind, optimized implementation
published register_input_method
unpublished input_methods
optimized KeyDef structure layout
changed eb_search arguments
used eb_delete_range
comments, remarks
better tests on fread failures
set buffer to read-only upon loading non writable file
do_insert_file tests for failure
  set mark at beginning of inserted block and offset at the end
fixed search for word boundary case
made raw_load_buffer1 return number of bytes read, of -1 on error
2008-01-03 18:31:24 +00:00
Charlie Gordon
4743fa1308 added remove_slash and append_slash path utilities
renamed canonize to canonicalize
added crude support for ~user -> /home/user
added win32 specific stuff in basename
added C-/ as an alias for C-_
some cosmetics, moved code
create files with mode 0644 in raw_save_buffer
untabified, removed redundant spaces
modified code generators to the same effect
2008-01-03 09:51:29 +00:00
Charlie Gordon
c556f52763 renamed set_buffer_name to eb_set_buffer_name
made log buffer more readable with log structure padding trick
renamed set_filename to eb_set_filename
added CmdSig enum and CmdProto union for signature based command dispatcher
changed CmdDef structure, val is now required to be an integer (24 bits)
intrinsic string argument ('S') is now passed as prompt with S{xxx} syntax
changed set-mode functions and do_define_kbd_macro accordingly
added signature in CMD_ and CMDV macros
renamed do_load to do_find_file
2007-12-27 10:04:09 +00:00
Charlie Gordon
79770ea8a8 renamed do_quit -> do_exit_qemacs, takes argval:
exits unconditionally if passed argument
do_not_modified takes argval: set modified status if passed argument
fixed argval passing to do_execute_command
M-- start argument with -4, or changes sign
protect against buffer overflow in qe_key_process (repeated C-u caused it)
bind search forward/backward to M-S and M-R
pass argval to do_replace_string, matches words if set
fixed word matching in search function
published search/replace functions as commands
published do_end_macro and do_cmd_set_mode
use name argval instead of argument for universal argument passed to command
2007-12-26 10:20:09 +00:00
Charlie Gordon
a0ea65c425 pass argument to do_char, do_tab, do_quote (fixes bug in C-u C-q a)
pass closure to quote_key
2007-12-25 07:54:00 +00:00
Charlie Gordon
8142f3a9e3 fixed eb_replace API
added capitalize-word (M-c) and capitalize-region (M-C-c)
fixed eb_changecase and added support for capitalization
simplified do_changecase_word and do_changecase_region
2007-12-21 22:34:31 +00:00
Charlie Gordon
8732586d6a reordered commands in qeconfig.h 2007-12-21 10:28:14 +00:00
Charlie Gordon
788461233d raw_save_buffer takes range and returns number of bytes written
added eb_write_buffer, returns number of bytes written
renamed save_buffer to eb_save_buffer, returns number of bytes written
added range in buffer_save method in EditBufferDataType
no longer reset undo log upon file saving
renamed do_save to do_save_buffer
added do_write_region (bound to C-X w)
renamed command execute-extended-command to execute-command
renamed command vc-toggle-read-only to toggle-read-only
fixed mark-whole-buffer to set point to start and mark to end of buffer
query-replace accept upper-case Y and N, and . for replace and quit.
shell passes universal argument to do_shell
bind next-error to C-X `
2007-12-20 16:27:21 +00:00
Charlie Gordon
c367d06f88 improved consistency
added remarks for commands that should take argval
2007-12-20 11:45:12 +00:00
Charlie Gordon
481248bc7b added and improved some buffer functions:
renamed eb_get_str to eb_get_contents
fixed buffer size issues in eb_get_line
fixed utf-8 issues in eb_get_strline
added eb_prev_line
added eb_goto_bol2: computes number of code points skipped
added eb_goto_eol
simplified code accordingly

added set_color1 inline function
renamed parse_config to do_load_config_file (invocable from A-x)
  changed command name from parse-config-file to load-config-file
  fixed bug when invoked with a filename
renamed center_cursor to do_center_cursor (invocable from A-x)
  made it invocable as center-cursor
2007-12-15 07:34:43 +00:00
Charlie Gordon
57c3461e0d simplified set_color API, made in inline
improved command parsing, refined argval handling, pass as optional arg
pass command arguments as an array of unions
use correct type in command dispatcher (upto 2 arguments)
merged do_goto_byte, do_goto_line, do_goto_char, extend syntax
fixed kill commands: kills are appended/prepended to kill buffer
added append_next_kill command
added do_kill_line (split from do_kill_region)
added do_kill_word (removed do_delete_word)
added do_kill_paragraph
pass argval to do_backspace and do_delete_char, fix kill behaviour
fixed kill-ring initial state bug
fixed do_yank: set mark and this_cmd_func
fixed do_yank_pop: test last_cmd_func, use eb_delete instead of do_undo
fixed do_yank_pop kill-ring bug
added clamp(int x, int min, int max);
added qs->this_cmd_func so commands can override qs->last_cmd_func
allow KEY_ESC + extended key as command binding
added do_c_forward_block, needs rewrite using colorization code
added do_c_kill_block
added insert-char command (argval repeats instead of forcing char value)
renamed delete-word to kill-word
renamed backward-delete-word to backward-kill-word
added kill-beginning-of-line
2007-12-12 02:51:05 +00:00
Charlie Gordon
d286b27756 made more local variables static
fixed bug in cfb32_fill_rectangle
use c99 syntax for new style struct initializers instead of gcc specific
simplified tolower unsigned char hacks
fixed various sparse warnings
2007-12-06 17:43:47 +00:00
Charlie Gordon
6c65411200 added missing headings, cosmetics 2007-12-03 16:10:38 +00:00
Charlie Gordon
eb3afbb862 renamed do_less_quit() to do_less_exit() for consistency with command name
fixed crash in do_less_exit() when invoking "less-exit" with A-x
fixed c auto-indenter to not move point unless within the indent space
fixed the electric-c mode
2007-01-12 15:06:16 +00:00
Charlie Gordon
685d35964f added set-trace command 2006-12-11 23:11:31 +00:00
Charlie Gordon
2fffd2ce7c allow multi-registering of command tables
added command do_minibuffer_get_binary (bound to minibuffer M-=)
  reads a word from the current buffer and display its value in decimal
  using CPU default endianness and long word size.  should take optional
  parameters to specify endianness, word size and destination.
2006-04-24 11:44:57 +00:00
Charlie Gordon
6dbffb4024 added '*' in command argument strings for commands that modify buffer contents
changed command definitions accordingly.
added C-x C-g binding for abort
added C-\ binding for call-last-kbd-macro
changed binding for switch-input-method to C-x C-\
added commands:
  not-modified on A-~ (reset buffer modified flag)
  load-file-from-path(file)
  mark-whole-buffer() on C-x h
  count-lines() on C-x l
  what-cursor-position on C-x =
allow key_grabber to quit and unget last key.
added splitpath() to dispatch directory and filename into separate buffers.
make separate functions for show_version and show_usage.
make separate function for parse_command_line.
added command line options:
  --help          -h   display help message and exit
  --no-init-file  -q   do not load config files
  --user          -u   load ~USER/.qe/config instead of your own
  --version       -V   display version information and exit
added -- as a marker for end of command line options.
allow most keys to be transmitted to shell process, including function keys.
improved shell buffer escape sequence parser.
added automatic detection of full screen shell applications and grab all keys
  try mc, Menuconfig, or even qemacs within qemacs !
improved *trace* buffer: do not trace keys when trace buffer is current,
  thus allowing navigation without side-effects
improved Makefile to not make html stuff if disabled
reduced CONFIG_TINY feature set
2005-05-09 09:10:37 +00:00
Charlie Gordon
811a16a0e3 changed do_line_numbers to do_toggle_line_numbers
changed do_line_truncate to do_toggle_truncate_lines
fixed define_kbd_macro string arguments mixup
added edit_find() to locate window with a given buffer
removed test kludge in term_flush()
various cosmetics.
2005-05-09 03:19:36 +00:00
Charlie Gordon
1f1df524cd added commands:
non-incremental search-forward, search-backward.
  unconditional replace-string
  set-visited-file-name with optional file rename
  set-emulation
  cd (change directory)
  set-mode
start in dired mode when invoked with no arguments
2005-05-09 02:42:07 +00:00
Charlie Gordon
8fac0ab42e reordered KEY_xxx definitions
added KEY_DEL=127 (formerly KEY_BACKSPACE)
added KEY_BS=8  C-H  to handle control-h as backspace on some ttys
fixed KEY_F6 thru KEY_F12 (were off by one)
added strtokeys() to convert a string with key names to a key buffer
added define-kbd-macro() from key string
added execute-macro-keys() to execute commands from a key string
improved qe_key_process().
changed method to update shell cursor : tty_update_cursor disabled
  shell_display_hook() used instead
greatly improved shell buffer behaviour, charset handling.
much improved tty input handling : support more key combinations and modes.
added missing charset declarations in qe.h
added borders_invalid and complete_refresh window flags
made C-L completely refresh display
moved window border display to separate function
changed edit_display() to allow complete redisplay even with popups
fixed window delete crash bugs by improving consistency with
  edit_attach and edit_detach.
2005-05-09 02:17:47 +00:00
Charlie Gordon
29242809bb allow window navigation with C-X n / C-X p /
C-X up / C-X down / C-X left and C-X right.
added completion on color names
2005-05-09 01:35:31 +00:00
Charlie Gordon
be58a93b28 test TERM variable for backspace key code detection (^H or DEL)
ansi, cygwin, vt -> ^H
  linux, xterm, ... -> DEL (unchanged)
changed set-backspace-is-control-h to toggle-control-h.
changed CMD() command definition macro to CMD_() with arg definition
  string at the end for improved readability.
removed obsolete CMDi and CMDss command definition macros.
dired.c hex.c image.c latex-mode.c qe.c qe.h qeconfig.h shell.c tty.c
2005-05-08 16:31:47 +00:00
Charlie Gordon
c525f403c2 added support for backspace key generating control-h :
do_set_backspace_is_control_h command and
  backspace_is_control_h variable.
added display_hook support in edit_display to allow windows to
  do mode specific stuff prior to display loop.
added BF_DIRED buffer flag.
fixed get_default_path for dired mode.
dont count popups in do_delete_window().
fixed more popup stuff in do_delete_window.
pass filename to parse_config.
added parse-config-file(filename) command.
2005-05-06 08:40:47 +00:00
Charlie Gordon
f4649fc080 added dummy_font so select_font never returns NULL
do not free system fonts
changed scroll command to support half window and one line modes
added commands to navigate window layout
2005-05-05 17:21:54 +00:00
Charlie Gordon
7752172d59 added color_define and completion primitives
added QASSERT macro
various comments and cosmetics
2005-05-05 11:36:28 +00:00
Charlie Gordon
3dd0f5660c Initial revision 2004-05-29 10:17:37 +00:00