Commit graph

35 commits

Author SHA1 Message Date
Charlie Gordon
5e0256ead3 use buf_t in get_mode_line functions, add compute_percent
* add compute_percent to compute percentages safely and correctly
* changed get_mode_line API
* simplify code
2014-01-16 14:00:28 +00:00
Charlie Gordon
51477bbc8b fix bugs in mode initializations
* mode initializers should call text-mode-init to register ccallback
  for s->offset and s->top_offset, and other generic stuff.
* this is error prone, should simplify this with base_mode property and
  keep unmapped windows lingering to get rid of ModeSavedData handlers
2014-01-15 15:54:27 +00:00
Charlie Gordon
37b3edf206 improve unihex-mode
* determine hex dump width from max char value in buffer
* display byte offset in margin instead of char offset
* accept 0x1f in text-mode
* no longer output octal char value if not ASCII
2014-01-12 01:39:10 +00:00
Charlie Gordon
deb6972ca3 better charset handling
* make eb_insert_buffer return the number of bytes inserted
* reset page bits upon charset change
* add eb_delete_nextc: delete one encoded character at offset
* add eb_insert_uchar: insert a unicode character with encoding
* add eb_insert_utf8_buf: insert a utf8 encoded buffer with conversion
* make eb_printf insert utf8 bytes with conversion
* add eb_insert_buffer_convert: copy chars between buffers with charset
  conversion
* handle charset conversion correctly in various places
* insert wide caracters from hex mode
* create most buffers as BF_UTF8 by default
* set kill-buffer charset to that of kill source
* convert charsets when yanking
* handle charsets in search/replace system
2014-01-06 09:40:20 +00:00
Charlie Gordon
a9006eff40 improve hex/binary file detection
* accept shiftin (^N) and shiftout (^O) ASCII control chars in text files
* faster scan in detect_binary
2014-01-05 23:23:09 +00:00
Charlie Gordon
b3a709013a improve mode selection, cleanup
* pass ModeDef pointer to mode_probe functions
* add extensions field to mode structure
* rename ascii mode to binary mode
* rename mode variables and fields to more specific names
2014-01-04 17:26:30 +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
85df972754 default ascii/binary mode to overtype 2008-04-22 09:15:00 +00:00
Charlie Gordon
9739f9a271 fixed issues in hex and unihex modes:
- default to overtype mode
- fixed "cursor not found" bug at end of file
- simplified hex dump code
- display both glyph offset and byte offset in unihex mode
2008-04-22 09:04:20 +00:00
Charlie Gordon
04ebeb7606 better separation of function pointers and void*
use CmdFunc typedef for generic command function pointers
no longer use \e for escape use \033 instead
use memcpy trick to prevent gcc warning on dlsym in -pedantic mode
2008-04-20 12:01:34 +00:00
Charlie Gordon
2301b82aeb fixed mingw compilation 2008-04-05 18:16:30 +00:00
Charlie Gordon
e483a5bc9c added buffer variable EditBuffer::tab_size
added buffer variable EditBuffer::offset
added more tests for CONFIG_XV
added test on GCC version for forward reference on hex_mode
2008-03-25 10:13:37 +00:00
Charlie Gordon
b2122f442a fixed cygwin compile 2008-01-24 14:05:03 +00:00
Charlie Gordon
9516917f97 added variables.h and variables.c for configurable state and window properties
cleaned up Makefile
renamed ModeDef::mode_line function pointer to get_mode_line
fixed some sparse warnings
use c99 syntax in video.c and image.c
added EditBuffer::offset for buffer parsing
added state variables QEmacsState::it, QEmacsState::ignore_spaces,
   QEmacsState::mmap_threshold
support variables in config file, strings can be delimited with ' and "
2008-01-18 17:03:35 +00:00
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
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
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
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
6d3fed85ac cosmetics, comments 2007-12-26 11:09:34 +00:00
Charlie Gordon
69b5b1f40e comments 2007-12-20 20:39:18 +00:00
Charlie Gordon
f99b132ebe display ISO-latin1 chars as graphics in ascii dump
default display width to a multiple of 16 in ascii dump
hex mode probe returns non 0 on text files
2007-12-18 12:17:10 +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
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
3551c36226 fixed typos, comments 2006-12-09 19:02:07 +00:00
Charlie Gordon
040a0add4a added binding: hex-mode M-g goto-byte
created separated command tables for hex and ascii modes
2006-04-24 11:32:29 +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
c52d77ea70 cosmetics only (spacing, untabify) 2005-05-11 15:12:14 +00:00
Charlie Gordon
8d2cbbb4cc no longer infer binary file on form feed character 2005-05-09 01:37:13 +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
3dd0f5660c Initial revision 2004-05-29 10:17:37 +00:00