Commit graph

58 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
c5f56a0d5b Fix memory leaks and bad references detected by valgrind
* add free_font_cache()
* add css_free_colors()
* add unload_ligatures()
* add --free-all cmd line option to free memory upon exit for valgrind
* tty.c: fix off by 3 size in qe_realloc. Should be typed
* qe.c: fix invalid pointer reference upon destroying transient buffer
2014-01-24 00:46:26 +00:00
Charlie Gordon
e967914b5a improve consistency in new/delete methodology
* use qe_mallocz for all structures
* prevent spurious uses of malloc/free/realloc
* pass pointers to pointers to all deletion functions
* use consistent patterns for list deletions
* add more dependencies in Makefiles
2014-01-23 12:56:22 +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
5f12ffb390 prevent spurious cursor move when not found 2014-01-11 18:46:14 +00:00
Charlie Gordon
c91bd12b8f simplified editing modes
* added colorize_func in ModeDef struct
* removed mode_init functions for most language modes
* other small improvements in mode_probe functions
* no need for get_basename in mode_probe functions
2014-01-05 23:42:54 +00:00
Charlie Gordon
02dec8bf1a added generic utility function unicode_glyph_tty_width in charset.c
* moved and improved code from tty_term_glyph_width
2014-01-02 11:28:30 +00:00
Charlie Gordon
68b4ba44ab fix for C++ compile (needed for Haiku)
renamed private structure members to priv_data
added casts on assignents from void* (OK in C, not in C++)
2013-12-17 16:06:35 +00:00
Charlie Gordon
a10c10ecf1 hide local data 2008-04-23 15:30:33 +00:00
Charlie Gordon
3ac1bd5aa0 use proper format in fscanf 2008-04-20 11:55:49 +00:00
Charlie Gordon
58b5872c52 fixed OpenBSD compile issues:
- check OpenBSD as uname output
- no longer use strcpy, strcat, sprintf
- added CONFIG_PTSNAME to disable Unix98 API under BSD
- fixed crash bug in tty.c on empty window
2008-04-15 23:24:03 +00:00
Charlie Gordon
8a2ee13f81 further kludges for linedraw in cygwin 2008-04-14 00:42:32 +00:00
Charlie Gordon
08da1814c5 fixed some BSD build issues 2008-04-13 23:44:39 +00:00
Charlie Gordon
85d121989e fixed some more tty color issues.
use tty.term_flags for emulation flags
improved cygwin tests
do not use V220 escapes to reset bold and blink
reset char attributes in more places to avoid side effects
2008-04-12 19:26:05 +00:00
Charlie Gordon
fa7b29d311 use blink for high intensity background color 2008-04-12 12:40:23 +00:00
Charlie Gordon
7252dbb2da comment 2008-04-10 21:15:18 +00:00
Charlie Gordon
d3823e1bb1 fixed shell mode: use ptsname instead of ptsname_r
disabled 16 color modes in cygwin, some issues remain if shell is started
2008-04-09 16:51:30 +00:00
Charlie Gordon
0cb0552601 fixed 32/64 bit compilation issues 2008-04-09 16:27:15 +00:00
Charlie Gordon
7d088e15f9 handle upto 16 colors in console output and shell terminal
simulate xterm 256 colors in terminal
improved bold trick
2008-04-08 19:57:33 +00:00
Charlie Gordon
10c0e75827 improved and documented terminal synching with erase-to-end-of-line 2008-04-04 09:56:17 +00:00
Charlie Gordon
82ca364b60 made tty_term_glyph_width generic and faster
improved tty_term_flush:
 - separate handling of fgcolor and bgcolor changes
 - simplified line drawing kludge
 - cleaned up handling of missing glyph
2008-03-31 09:44:27 +00:00
Charlie Gordon
72e59be778 fixed crash bug on forward_block in text mode:
- renamed get_colorized_line() to generic_get_colorized_line
 - added get_non_colorized_line() for uncolored modes
 - renamed EditState::get_colorized_line_func to get_colorized_line
   make this function pointer always non NULL

fixed bug in global-set-key: current bindings could not be overloaded

better tty charset detection and handling:
 - always use utf8 when output is not a tty
 - allow override with -c CHARSET command line option
 - added state variable show-unicode to display non latin1 as \uXXXX
 - added command line argument -c CHARSET (--ttycharset) to specify the
   charset of the tty. tty charset is reported in *messages* buffer at startup
 - display unsupported glyphs as half-width or full-width question mark pairs

improved tty output: use kill_end_of_line escape sequence
2008-03-29 18:06:41 +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
a5eae3ed92 bumped copyrights, some cosmetics 2008-01-08 16:37:54 +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
6d3fed85ac cosmetics, comments 2007-12-26 11:09:34 +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
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
1a6fe3489e use INT_MAX instead of MAXINT
use INT_MIN for NO_ARG
2007-12-21 10:32:27 +00:00
Charlie Gordon
58f37aad91 adjust bogus window size 2007-12-20 20:40:55 +00:00
Charlie Gordon
3511cd2b4b cosmetics 2007-12-18 12:22:09 +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
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
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
6c65411200 added missing headings, cosmetics 2007-12-03 16:10:38 +00:00
Charlie Gordon
4dee871155 delayed terminal utf8 capability detection so qe no longer leaves 2 weird character on terminal upon leaving 2007-02-07 23:27:33 +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
b47f7998df allocate tty screen and shadow buffer in the same block
use various simple techniques to reduce tty refresh traffic
2006-12-12 01:03:03 +00:00
Charlie Gordon
0fe70595b6 simplified bogus utf-8 terminal test
fixed bogus tty_resize() : used to fill screen buffer attribute slots with
  invalid values, causing spurious ????? output on ^L
simplified tracing of tty input
improved term_flush(), further improvements pending.
2006-12-11 23:24:59 +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
ade489eba5 msg 2005-07-08 09:30:43 +00:00
Charlie Gordon
2f2959b3b7 applied patch by Guido Classen: removed spurious ';' in vt100 escape sequence. 2005-05-18 22:35:57 +00:00
Charlie Gordon
cd81b0f9f9 applied patch by Guido Classen: removed spurious 2005-05-18 22:35:14 +00:00
Charlie Gordon
c52d77ea70 cosmetics only (spacing, untabify) 2005-05-11 15:12:14 +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
ff7d6f4c34 another try for linedrawing chars using alternate charsets 2005-05-09 03:24:22 +00:00