Commit graph

35 commits

Author SHA1 Message Date
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
3796d5d22e add BF_TRANSIENT buffer flag: buffer freed upon window close
* closing a window with a 'transient' buffer frees unless it is viewed in another window
2014-01-13 11:00:43 +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
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
7759a1467a simplified edit_set_mode API, display mode in bufed 2013-12-27 01:54:12 +00:00
Charlie Gordon
8b592ad49c typo, added argument tag 2008-04-25 10:54:50 +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
7bde58c799 renamed qe_collate -> qe_strcollate, cosmetics 2008-04-22 08:15:04 +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
597e4a48a0 renamed extension() to get_extension() for consistency
added safe cast functions s8(): u8* -> char * and const variant cs8()
strip # suffix in reduce_filename()
2008-04-09 16:15:45 +00:00
Charlie Gordon
2d0783cfd9 renames basename to get_basename to avoid conflicts 2008-04-08 06:54:44 +00:00
Charlie Gordon
90d65f6cfb added flag BF_UTF8 so set buffer charset to uft-8 at creation time
set utf8 charset for buffers:
  *bufed*, *dired*, *xml-error*, *messages, *errors*, *minibuf*, *Help*
remove BF_SYSTEM bit from buffers *messages*, *error*
added syntax for messages not stored in *messages*: start message with ~
2008-03-30 16:10:15 +00:00
Charlie Gordon
6417c70833 simplified some dired functions
fixed navigation bugs:
 - current file stays current on sort, dired, parent
 - default entry is first upon navigating to a subdirectory
2008-03-28 12:26:23 +00:00
Charlie Gordon
54b6f9c641 added reduce_filename to compute a stripped filename for mode probing
stripping VCS/backup prefixes and suffixes, fixing case.
added Lex (.l .lex) and .C files to C mode
fixed spurious error message at edit_set_mode_file
restored standard behaviour for extension() : return pointer to last extension
2008-03-26 08:03:55 +00:00
Charlie Gordon
1f75556248 fixed buffer read-only mode in dired_mark 2008-03-25 11:02:52 +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
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
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
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
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
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
7128c65b41 use 20% of width for dired/bufed modes 2006-12-11 23:08:50 +00:00
Charlie Gordon
3fa679698c cosmetics (untabify); fixed filename buffer sizes 2005-05-11 14:37:16 +00:00
Charlie Gordon
bcd278f8c4 added do_toggle_control_h() declaration
put message in do_quote(), do_set_mark(),
added find_window() to locate window in a given direction.
added do_previous_window() for window navigation.
do not split popup window in do_split_window().
allow window navigation with C-X n / C-X p /
  C-X up / C-X down / C-X left and C-X right.
2005-05-09 01:29:34 +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
a18ce8dcba improved bufed mode:
added BUFED_ALL_VISIBLE flag to include system buffers in list
  display buffer size
  added bufed_clear_modified, bufed_toggle_modified.
  added bufed_toggle_all_visible, navigation keys.
improved dired mode:
  store file details in separate structure
  added sorting options, marking options
2005-05-08 15:08:07 +00:00
Charlie Gordon
3dd0f5660c Initial revision 2004-05-29 10:17:37 +00:00