Commit graph

82 commits

Author SHA1 Message Date
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
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
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
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
4cf9d7227b small fixes in terminal emulation 2014-01-14 03:53:56 +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
2c725986f8 add support for CTRL('c') as command prefix
* add KEY_CTRLC(x) as compressed key combination
* bind shell-interrupt to C-c C-c
2014-01-07 14:44:23 +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
f939ce7181 small improvements
* show new charset in set-buffer-file-coding-system
* do not use double negative if/else constructs
* ignore new extensions in file_completion
* pass filename to probe_mode, no longer need buffer reference
* fix support for line drawing characters in utf8 shell window
2014-01-05 12:51:41 +00:00
Charlie Gordon
f9fe5a2032 improved utf8 charset selection for shell buffer 2014-01-02 10:22:48 +00:00
Charlie Gordon
7759a1467a simplified edit_set_mode API, display mode in bufed 2013-12-27 01:54:12 +00:00
Charlie Gordon
a3286d64ba simplified shell process interface, added ssh command
* more generic new_shell_buffer API, takes cmd, caption, flags
* added ssh command to open ssh connections
2013-12-24 23:42:10 +00:00
Charlie Gordon
722f8b919c use shell commands for all subprocesses 2013-12-24 16:12:48 +00:00
Charlie Gordon
64ba634c2a shell.c: fixed shell buffer for Haiku
* moved setsid() call before open of pseudo terminal in child process
* increased buffer size to catch all output from child process
* catch stderr output from non interactive processes
2013-12-23 23:33:34 +00:00
Charlie Gordon
8027f3e0dd shell: cosmetic changes 2013-12-18 23:39:53 +00:00
Charlie Gordon
163f7b7d96 make shell output buffers unmodified upon process exit 2013-12-03 17:44:00 +00:00
Charlie Gordon
a0201f86bc - display error message on next-error / previous-error
- setting error position was off by one line
- fixed error source handling: use last shell or compile command
2013-11-30 14:18:57 +00:00
Charlie Gordon
b9a4189c39 improved man command:
- fixed bug on OS/X to force unlimited lines in shell output buffers
- added pager mode
- made output buffer read only, allow shell output to read only buffer

improved shell mode:
- set buffer encoding from LANG environment variable: utf8 or vt100
- special cased utf8 support for shell output
- handle charset in shell input
- enter / exit shell interactive mode with C-a and C-e (home and end)
- reset error offset upon enter key
2013-11-29 00:32:52 +00:00
Charlie Gordon
e493a2e99c fixed many problems with charset encodings
added charset methods for buffer line and position computations
added QECharset fields for char_size and variable_size indicator
use charset's eol_char to count lines in buffers: this should fix EBCDIC support
added support for ucs2 and ucs4 little and big endian encodings
charset's decode_func call no longer be NULL
eb_nextc and eb_prev now require non NULL third parameter
2008-05-02 16:04:09 +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
c158298f8a do not use %m, use strerror 2008-04-20 11:56:25 +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
ce6df0f885 fixed support for BS and M-BS in shell mode 2008-04-13 23:03:20 +00:00
Charlie Gordon
dc40af78a6 fake underline in shell terminal
improved V100 parsing, more comments, more compatible with putty
2008-04-13 17:31:46 +00:00
Charlie Gordon
fa7b29d311 use blink for high intensity background color 2008-04-12 12:40:23 +00:00
Charlie Gordon
851a541b6f fixed typo 2008-04-12 08:14:00 +00:00
Charlie Gordon
fbe133e213 no longer use non portable ptsname_r reentrant version of ptsname 2008-04-12 08:13:19 +00:00
Charlie Gordon
50d752b733 fixed terminal emulation for charset selection 2008-04-10 20:57:25 +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
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
f538848ffe simplified extended escape sequence handling 2008-04-08 09:33:18 +00:00
Charlie Gordon
34dc258c63 fixed pseudo-tty allocation using Unix98 API 2008-04-08 09:29:38 +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
446aa12e02 added crude support for terminal size in xterm buffer fixed spurious \n insertions in shell unlimited line xterm mode prevent tty input for non-interactive xterm buffers force TERM variable to xterm in process buffers reset PAGER to enable man colored output with default 'less' pager added 'make' command on C-x m added man command 2008-04-04 13:16:09 +00:00
Charlie Gordon
a929df2f41 remarks 2008-04-04 12:09:32 +00:00
Charlie Gordon
781f2e6af4 support set extended foreground/background escape sequences, with only 16 foreground colors and 8 background colors support set bright foreground / background (only 8 background colors) support SCO colors parse and ignore xterm define extended color command prevent crash bug on non colored shell buffers, such as compile output 2008-04-04 10:19:37 +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
a261e3e64d fixed color tracking in tty_csi_m 2008-03-25 11:04:59 +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
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
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
f6d34c25cf use bold flag for high intensity tty colors
use default PuTTY colors
2007-12-24 09:31:36 +00:00