Commit graph

66 commits

Author SHA1 Message Date
Charlie Gordon
28397f424f moved input_methods to QEmacsState
qe_register_binding takes ModeDef* and returns status
cosmetic changes in QEDisplay API
added int dpy_init(QEditScreen *s, QEDisplay *dpy, int w, int h);
  copies *dpy (or dummy_dpy if NULL) to QEditScreen and calls method
simplified dpy_init methods and calls
inlined 5 more methods
moved dummy_dpy to display.c and simplified
simplified to_hex
simplified qe_colors array handling
2008-01-11 11:29:28 +00:00
Charlie Gordon
de952df347 changed Makefile and ifdefs to link tiny version as tqe at all times
moved kmap code from input.c to new file kmap.c
updated TODO
2008-01-10 12:21:05 +00:00
Charlie Gordon
2681b68040 removed EditBuffer.yank_mark and QEmacsState.mark_yank_region
changed API for GetColorizedLineFunc: offset passed by address,
  updated to start of next line
added check_readonly(EditState *s)
added tentative code for unregistring bindings, cycling modes and charsets
experiment alternate method for region highlighting:
  added EditState.region_style and EditState.curline_style
  added QEmacsState.hilite_region
  added DisplayState.style
  added clear_color to reset style bits in unicode array
  display_char_bidir takes style from DisplayState, code point is bare.
  fixed problem in text_display where line_num was not computed in shell mode
  handle region coloring in text_display (tentative)
display line numbers and hex dump offsets as QE_STYLE_COMMENT
display hex dump as QE_STYLE_FUNCTION
2008-01-09 13:41:40 +00:00
Charlie Gordon
a5eae3ed92 bumped copyrights, some cosmetics 2008-01-08 16:37:54 +00:00
Charlie Gordon
98939ddcac changed API for completion functions:
- use CompleteState struct
- use complete_test for each potential match with simple prefix comparison
added new smart string compare function qe_collate to sort strings in
  lexicographical order but sort numeric portions in numerical order
use qe_collate in popup lists and dired
removed redundant alias "iso8859-2"
added strequal(a,b) as an alias for !strcmp(a,b)
  this function makes string collation with strcmp more explicit
  this even fixed a spurious bug in do_set_emulation
2008-01-08 03:42:53 +00:00
Charlie Gordon
ae163f897b fixed crash on charset_completion
renamed css_strtolower -> qe_strtolower
use offsetof for SAVED_DATA_SIZE macro (this stuff must go)
cosmetics in css_get_enum
remarks
fixed text-mode colorization bug: because of saved_data stuff,
  must reset colorization function after mode restore.  This saved data
  stuff is bogus and should be rewritten
smaller version of roman numeral converter
fixed alpha converter
smaller implementation of css_counter_str
fixed list_mode name: no longer generates extra mode completion entry
2008-01-07 16:25:22 +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
bef7b245a1 removed redundant object unihex.o
generate module initialization list automatically
2007-12-27 11:20:38 +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
1ddbbf66f4 fixed Cygwin compile:
- fixed clash on FWRITE redefinition
- fixed crash on do_toggle_control_h(NULL...)
- fixed some Makefile issues
2007-12-24 10:22:22 +00:00
Charlie Gordon
f6d34c25cf use bold flag for high intensity tty colors
use default PuTTY colors
2007-12-24 09:31:36 +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
aefd95484f added const void *memstr(const void *buf, int size, const char *str);
added line_len and total_size in ModeProbeData structure
extended SEARCH_LENGTH to 256, allowing upto 256 matches in incremental C-s
2007-12-21 14:27:11 +00:00
Charlie Gordon
658149e9f8 moved global variables to QEmacsState structure:
- first_mode, first_key, first_cmd,
 - first_completion, first_history
 - trace_buffer, trace_buffer_state,
 - backspace_is_control_h
2007-12-21 12:30:55 +00:00
Charlie Gordon
2ba4b76e20 fixed popup bug caused by readonly flag 2007-12-21 12:20:17 +00:00
Charlie Gordon
c0d551da2e use generic prompt system for write-file and simplify do_save_buffer
use INT_MAX instead of MAXINT
use INT_MIN for NO_ARG
2007-12-21 10:30:24 +00:00
Charlie Gordon
6754c5379d fixed configure and Makefile for tiny build
updated statistics in qe-doc (sadly, sizes have increased substantially)
2007-12-20 21:37:34 +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
bf17e23390 renamed css_isxxx and css_toxxx ctype alternatives to qe_* 2007-12-15 16:44:31 +00:00
Charlie Gordon
5768f42cd8 no longer use ctype.h macros and functions
- ctype.h has strong constraints on arguments
- ctype.h implements bogus irrelevant inefficient locale specific behaviour
- use replacement css_xxx functions
- all take int arguments: can be any value, yet only test ASCII subset
- all css_isxxx return true boolean (1 or 0)
- removed utoupper(int) -> css_toupper(int) has same functionality

resolved ffmpeg clash on string functions from cutils.c module
- added #defines to make them local
- renamed some strixxx functions to strxxxx (extended behaviour)
- moved case insensitive stuff to util.c

fixed bug in strtokey: C-M-x combinations were not recognized
improved eb_changecase
fixed C comment parsing in css parser
2007-12-15 16:02:47 +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
26ea3f69a0 added wrappers and utilities for safer memory allocation:
type *qe_malloc(type);
type *qe_mallocz(type);
type *qe_malloc_array(type, count);
type *qe_mallocz_array(type, count);
type *qe_malloc_hack(type, extra_bytes);
type *qe_mallocz_hack(type, extra_bytes);
void qe_free(&ptr);
void *qe_realloc(&ptr, new_size);
char *qe_strdup(const char *str);
void *qe_malloc_bytes(size_t size);
void *qe_mallocz_bytes(size_t size);
void *qe_malloc_dup(const void *src, size_t size);

pass pointer address to bmp_free()
2007-12-12 11:49:02 +00:00
Charlie Gordon
7817049123 cosmetics 2007-12-12 08:51:02 +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
0507ffacc3 fixed function key mapping issues in X11 and Wndz
fixed C lang colorizer for some multiline stuff, wide char/strings
use countof() macro
cosmetics
2007-12-10 13:28:07 +00:00
Charlie Gordon
3695abe5b6 added more Hebrew keymaps
support multiple output for input methods
colorize function calls in C mode
2007-12-09 23:31:38 +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
0446a52d21 added more charsets
simplified charset alias system
reorganized charset functions
groomed completion functions
2007-12-06 15:28:29 +00:00
Charlie Gordon
b82cea744d small simplifications, remarks
small fixes and extra info in code page files
2007-12-05 08:49:38 +00:00
Charlie Gordon
134ced6963 removed charset_table.c
added charsetjis.c and charsetjis.def
moved code from charsetmore.c to charset.c and charsetjis.c
improved cp parser cptoqe.c, make it generate charsetmore.c
small changes in QECharset structure: added eol_char and made aliases const
removed redundant QECharset declarations from qe.h
separate JIS table generation into jistoqe.c, make it generate charsetjis.def
updated Makefile, .cvsignore
improved fbftoqe.c
improved kmaptoqe.c, added --dump option
added argc, argv to QEmacsState
improved set_user_option: put runtime and user directories in front of res_path
added some missing file headings
2007-12-03 16:15:01 +00:00
Charlie Gordon
a0bfcd45bd fixed unsigned char issues
added TODOs
bumped version to 0.4.0dev
mention chqrlie in --version
cosmetics: reindented Makefile
2007-02-06 17:41:16 +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
494e9f7866 include cflags.mk for extra gcc warnings if present
utf8_encode now returns the number of characters copied,
  simplified code accordingly
made local functions static
tagged unused function arguments
fixed shadowing issues
added support for GCC attributes for unused arguments and format strings
use snprintf() instead of sprintf()
moved scattered declarations to qe.h
removed duplicate declarations in header files
eb_write() payload argument is now const
fixed crash bug: reset trace_buffer upon deletion
improved trace_buffer readability: trace all pseudo tty streams separately
added missing structure initializers
removed buffered string handling from cutils.h
added new buffered string API for statically allocated buffers (should unify)
small improvements in X11 initialization
improved consistency in tty.c (function names...)
  added STDIN and STDOUT streams in QEditScreen to stop using stdin and stdout
  use unlocked stream I/O if available (faster)
  changed and documented terminal setup and exit sequences
  improved charset handling
mode_line functions now return the character count (like snprintf)
2006-12-31 19:34:00 +00:00
Charlie Gordon
1c91b22914 moved charset_complete() to charset.c
added do_set_trace()
added mode_completion()
simplified command_completion()
simplified style_completion()
simplified buffer_completion()
fixed bogus terminal display for character ^? (DEL or 127)
2006-12-11 23:21:04 +00:00
Charlie Gordon
d447798717 added missing licence header
fixed typos
added constness
comments about potential problems
identified 64 bit portability problem
fixed small issue in get_default_path()
allow signed numbers in config file
added comments about old code for reference (tty.c, shell.c)
2006-12-09 19:47:20 +00:00
Charlie Gordon
b78ca68086 Display number of rows upon resize 2006-04-27 15:22:26 +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
ade489eba5 msg 2005-07-08 09:30:43 +00:00
Charlie Gordon
3f73242a38 fixed compilation warning. 2005-05-18 22:34:42 +00:00
Charlie Gordon
f6867f8b51 - Added font locking to fix crash bugs in html/css.
- select_font() now locks the font, which must be unlocked with
  release_font().  Extra locks can be added with lock_font().
- Added release_font() wherever needed.
- Added put_error() to store errors in *errors* system buffer.
- Make put_status() store messages in *messages* system buffer.
2005-05-13 10:05:23 +00:00
Charlie Gordon
65daffbd4f fixed filename buffer sizes (MAX_FILENAME_SIZE)
various cosmetics (spacing, untabify)
fixed some cursor bugs on long lines
commented on portability issues in command invokation
improved defaut_path_name on fileless buffers
added status with screen size upon screen resizing
2005-05-11 15:51:53 +00:00
Charlie Gordon
76fda12164 use splitpath instead of deprecated pathname in get_default_path 2005-05-10 20:56:42 +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
421067af0b added fake charset vt100 for shell buffer
use simpler utf8 terminal test, ie: compatible with shell buffer.
added terminal dependant escape sequences,
  with limited support for vt100 variants.
more precise escape sequence parser in shell buffer.
trace shell output in trace_buffer.
improved file_completion :
  fix buffer overflows,
  ignore . and .. and backup files
  ignore file_completion_ignore_extensions,
2005-05-09 06:21:49 +00:00
Charlie Gordon
c6fa69e7d4 added more shell buffer emulation stuff.
select charsets in vt100 tty.
2005-05-09 03:32:19 +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