Commit graph

94 commits

Author SHA1 Message Date
Charlie Gordon
2dad1fed8d clear mode_name in modes derived from text_mode 2014-08-09 17:42:15 +00:00
Charlie Gordon
611e44403d prepare mode separation (view / syntax / data)
* add fields in EditBuffer struct
* pass buffer and flags to mode_init functions
* add default_mode_init function to avoid tests
2014-06-01 13:54:58 +00:00
Charlie Gordon
569401da15 simplify mode init/close
* always regsister callbacks on s->top and s->top_offset
* handle saved_data generically, remove window callback
  this will be replaced with view history mecanism.
2014-05-29 10:26:13 +00:00
Charlie Gordon
f527a58e18 add mode flags to specify different types of modes
* add  mode_flags as extra argument to qe_register_mode
* change all mode registration calls accordingly
2014-05-27 12:05:52 +00:00
Charlie Gordon
6cf7cf24f3 fix problems with shell buffers
* create styles for existing buffers passed to new_shell_buffer
* preserve unmodified status for read-only shell output buffers
2014-04-17 17:14:09 +00:00
Charlie Gordon
ee690b2895 add support for web protocols: ftp, http, https
* add wget-mode to retrieve web contents via find-file
* add shell flags for buffer mode change upon download completion
* fix do_electric_filename to keep http:// prefix and such
2014-03-19 19:42:30 +00:00
Charlie Gordon
2841a9dc96 fix tab behaviour
* add eb_insert_spaces(b, offset, count)
* add qe_mode_set_key(m, keystr, cmdname)
* removed duplicated pager_commands, register bindings instead
* use undo to remove spaces inserted by tab if !indent_tabs_mode
* change do_tab to insert indentation with spaces depending on
  indent_tabs_mode and indent_size
2014-03-15 22:52:51 +00:00
Charlie Gordon
325be8d5a6 fix missing close on pseudo tty 2014-03-04 00:36:58 +00:00
Charlie Gordon
bfcb396455 Fix inconsistencies in shell mode
* clear interactive window flag upon mode change
* enable interactive mode upon vertical cursor movement
* add more checks for private data consistency
* free shell data upon process exit in non interactive shell buffers
* added shell-command command on M-!
* make kill_buffer_noconfirm() public to remove buffer safely
2014-03-03 23:35:46 +00:00
Charlie Gordon
9eb5944588 Improve mode selection and mode specific command safety
* add set-auto-mode() to (re)select best mode for buffer
* add set-next-mode() on M-m to cycle appropriate buffer modes
* add set-previous-mode()
* add default_mode and saved_mode in buffers to improve mode switching
* add dired mode probing and store st_mode in buffer to detect directories
* add charset, eol_type and buffer in ModeProbeData
* clean mode selection and window buffer attachment (needs more work)
* compute sorted list of appropriate modes in probe_mode
* convert charset and eol_type in mode_probe
* add signatures in buffer priv_data to perform save casts
* move BufedState to b->priv_data, protect mode specific functions
  add bufed_mode_probe function, cycling through modes comes back to bufed mode
* move DiredState to b->priv_data, protect mode specific functions
  add dired_mode_probe function, cycling through modes comes back to dired mode
* add heading line in dired buffer with directory spec
* protect shell-mode specific functions.
* restart shell in shell() command if exited
* some cosmetics changes (remove useless __unused__, missing messages ...)
2014-02-10 21:21:39 +00:00
Charlie Gordon
a7853b3dff add support for end of line types
* support 3 types of end of line: Unix, Dos and old style Mac
* detect eol type automatically in detect_charset
* set buffer eol_type together with charset
* transparently convert eol sequence to \n upon reading buffers
  characters in eb_nextc().
* transparently convert \n to eol sequence in eb_encode_uchar()
* handle eol types in convert-file-buffer-coding-system: either preserve
  current value or force it via charset suffix -unix, -doc and -mac
* change read_charset() to accept eol_type suffix
* add eol_type and eol_char to CharsetDecodeState
* change charset methods to take CharsetDecodeState instead of charset pointers
* display eol_type in mode line if not unix
2014-02-05 00:56:48 +00:00
Charlie Gordon
d0c2e1d3e6 replace unicode_to_charset with eb_encode_uchar
* prepare support for eol_type support by making char encoding buffer specific
* fix small bugs and unsafe cases.
* fix bug in eb_goto_pos for EBCDIC charsets
2014-02-04 22:47:31 +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
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