2001-05-31 08:56:32 +00:00
|
|
|
|
/* Terminal control module for terminals described by TERMCAP
|
2019-01-01 00:59:58 +00:00
|
|
|
|
Copyright (C) 1985-1987, 1993-1995, 1998, 2000-2019 Free Software
|
2013-01-01 09:11:05 +00:00
|
|
|
|
Foundation, Inc.
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
|
|
|
|
This file is part of GNU Emacs.
|
|
|
|
|
|
2008-05-14 07:50:26 +00:00
|
|
|
|
GNU Emacs is free software: you can redistribute it and/or modify
|
1991-05-09 10:29:44 +00:00
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2016-03-10 15:34:52 +00:00
|
|
|
|
the Free Software Foundation, either version 3 of the License, or (at
|
|
|
|
|
your option) any later version.
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
|
|
|
|
GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2017-09-13 22:52:52 +00:00
|
|
|
|
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2001-05-31 08:56:32 +00:00
|
|
|
|
/* New redisplay, TTY faces by Gerd Moellmann <gerd@gnu.org>. */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
1994-06-15 03:54:06 +00:00
|
|
|
|
#include <config.h>
|
2006-03-26 16:05:17 +00:00
|
|
|
|
#include <errno.h>
|
Assume POSIX 1003.1-1988 or later for fcntl.h.
* admin/CPP-DEFINES (O_RDONLY, O_RDWR, HAVE_FCNTL_H): Remove.
* admin/merge-gnulib (GNULIB_MODULES): Add fcntl-h.
* configure.ac: Do not check for fcntl.h.
* lib/gnulib.mk: Regenerate.
* lib-src/movemail.c, lib-src/update-game-score.c: Assume <fcntl.h> exists.
* nt/inc/sys/socket.h (O_NONBLOCK): Rename from O_NDELAY, since the
POSIX name for this flag is O_NONBLOCK. All uses changed.
* nt/inc/unistd.h (O_RDWR, O_NOCTTY): New macros. Like AT_FDCWD etc.
these really should be moved to a replacement <fcntl.h> if and
when that gets implemented. In the meantime, include <fcntl.h>
to make sure we don't override its definitions.
* src/callproc.c (relocate_fd): Assume F_DUPFD.
* src/emacs.c, src/term.c (O_RDWR): Remove.
* src/keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
O_NDELAY, since O_NONBLOCK is the standard name for this flag.
* src/nsterm.m: Assume <fcntl.h> exists.
* src/process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
(create_pty, Fmake_network_process, server_accept_connection)
(wait_reading_process_output, init_process_emacs):
Assume O_NONBLOCK.
(wait_reading_process_output): Put in a special case for WINDOWSNT
to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
It's not clear this is needed, but it's a more-conservative change.
(create_process): Assume FD_CLOEXEC.
(create_process, create_pty): Assume O_NOCTTY.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
(reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
Omit if not DOS_NT, since F_GETFL is not defined there.
(serial_open): Assume O_NONBLOCK and O_NOCTTY.
* src/term.c: Include <fcntl.h>, for flags like O_NOCTTY.
(O_NOCTTY): Remove.
(init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
lack it, since gnulib guarantees this.
* src/w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
Fixes: debbugs:12881
2012-11-17 22:12:47 +00:00
|
|
|
|
#include <fcntl.h>
|
Limit <config.h>’s includes
This follows up on recent problems with the fact that config.h
includes stdlib.h etc.; some files need to include stdlib.h later.
config.h generally should limit itself to includes that are
universally safe; outside of MS-Windows, only stdbool.h makes
the cut among the files currently included. So, move the
other includes to just the files that need them (Bug#24506).
* configure.ac (config_opsysfile): Remove, as this generic hook
is no longer needed.
* lib-src/etags.c, src/unexmacosx.c, src/w32.c, src/w32notify.c:
* src/w32proc.c (_GNU_SOURCE):
Remove, as it’s OK for config.h to do this now.
* src/conf_post.h: Include <ms-w32.h>, instead of the generic
config_opsysfile, for simplicity as this old way of configuring is
now done only for the MS-Windows port. Do not include <ms-w32.h>
if DEFER_MS_W32_H, for the benefit of the few files that want its
effects later. Do not include <alloca.h>, <string.h>, or
<stdlib.h>. Other files modified to include these headers as
needed, or to not include headers that are no longer needed.
* src/lisp.h: Include <alloca.h> and <string.h> here, since
some of the inline functions need them.
* src/regex.c: Include <alloca.h> if not emacs. (If emacs,
we can rely on SAFE_ALLOCA.) There is no longer any need to
worry about HAVE_ALLOCA_H.
* src/unexmacosx.c: Rely on config.h not including stdlib.h.
* src/w32.c, src/w32notify.c, src/w32proc.c (DEFER_MS_W32_H):
Define before including <config.h> first, and include <ms-w32.h>
after the troublesome headers.
2016-09-30 19:14:04 +00:00
|
|
|
|
#include <stdlib.h>
|
Implemented multiple tty support.
README.multi-tty: New file.
src/termchar.h (struct terminal): Renamed to struct tty_output. Added name, type,
input, output, termscript, old_tty, term_initted, old_tty_valid,
background_pixel, foreground_pixel, next fields.
(TERMINAL_*): Renamed to TTY_* for brevity.
(CURRENT_TERMINAL): Renamed to CURTTY for brevity.
(tty_list): New variable.
(TERMINAL_PTR): Removed.
(FRAME_TTY): New function.
(TTY_NAME, TTY_TYPE): New macros.
src/term.c (current_terminal): Removed. (_current_terminal): Removed. (tty_list):
New variable. (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
parameter. (set_terminal_modes): Added tty parameter. (reset_terminal_modes):
Added tty parameter. (cursor_to, raw_cursor_to): Updated cmgoto() calls.
(clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
cmcheckmagic() calls. (get_named_tty): New function. (term_dummy_init): New
function. (term_init): Added name parameter, added tty_output return value.
Changed algorithm to update tty_list. Call init_sys_modes() to set up tty
mode on the newly opened terminal device.
(get_current_tty): New function, intended for debugging.
src/termhooks.h (termscript): Removed.
src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
definition.
src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
(current_tty): New variable, for cmputc().
(cmcheckmagic, cmputc, cmgoto): Added prototypes.
src/cm.c (current_tty): New variable, for cmputc().
(cmputc): Use it.
(cmcheckmagic): Added tty parameter, look up terminal streams there.
(calccost): Added tty parameter. Use emacs_tputs() instead of tputs().
(cmgoto): Added tty parameter. Pass it on to calccost(). Use emacs_tputs()
instead of tputs().
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
(term_init): Added name parameter (the filename of the terminal device). Added
return value (struct tty_output).
src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
(termscript): Moved to struct tty_output.
(terminal_type): Removed.
src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
during init_display().
(shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
src/frame.c (Qtty, Qtty_type): New variables.
(syms_of_frame): Initialize them.
(tty_display): Removed.
(make_terminal_frame): New parameters (tty filename and type).
Initialize output_data.tty field instead of output_data.x. Use term_init() to
find the right tty_output. (Use term_dummy_init() during bootstrap.)
(Fmake_terminal_frame): Get device filename and type from frame parameters.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
if the frame is a tty.
(struct frame): New member in output_data: tty.
(make_terminal_frame): Updated of prototype.
src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
reset_sys_modes(). Ditto with init_sys_modes().
src/lisp.h (tty_output): Added forward declaration.
(init_sys_modes, reset_sys_modes): Updated prototype.
(init_all_sys_modes, reset_all_sys_modes): New prototypes.
src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
(init_all_sys_modes): New function.
(init_sys_modes): Added tty_output parameter. Use it.
(reset_all_sys_modes): New function.
(reset_sys_modes): Added tty_output parameter. Use it.
src/Makefile.in: Update dependencies.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
2003-12-25 06:59:31 +00:00
|
|
|
|
#include <sys/file.h>
|
2012-06-22 21:17:42 +00:00
|
|
|
|
#include <sys/time.h>
|
2007-07-11 15:22:11 +00:00
|
|
|
|
#include <unistd.h>
|
2004-02-02 22:09:56 +00:00
|
|
|
|
|
lib-src/emacsclient.c: Implemented --here option (open a new Emacs tty). Needs more work.
(here): New variable.
(decode_options): Use it.
(ec_get_tty, ec_set_tty, init_tty, window_change, hang_up_signal): New functions.
(window_change_signal, init_signals, reset_tty, init_pty, copy_from_to): Ditto.
(pty_conversation): Ditto.
(main): Use them.
(master, pty_name, old_tty, tty, old_tty_valid, tty_erase_char): New variables.
(flow_control, meta_key, _sobuf, in_conversation, quit_conversation): Ditto.
lisp/server.el (server-process-filter): Added support for opening a new terminal frame.
dispextern.h (get_frame_size): Renamed to get_tty_size, added tty_output parameter.
dispnew.c (Fredraw_frame): fflush the current terminal instead of stdout.
(direct_output_for_insert, direct_output_forward_char, update_frame_1): Ditto.
(Fding, bitch_at_user): Ditto.
(update_frame_1): Count pending output for current terminal instead of stdout.
(window_change_signal): Resize all terminals.
(change_frame_size): Don't resize all terminals to the same size.
frame.c (Vterminal_frame): Removed.
(syms_of_frame): Removed declaration of Vterminal_frame.
(make_terminal_frame): Set the top frame of the terminal to the new frame.
(Fmake_terminal_frame): Get a new frame size from get_tty_size, don't copy it.
(do_switch_frame): Handle terminal frame visibility.
(next_frame, prev_frame): Skip over frames on different terminals.
frame.h (Vterminal_frame): Removed.
keyboard.c (input_fd): Removed.
(read_avail_input): Removed first argument from read_socket_hook.
Try to read from each available tty, until one succeeds.
(Fsuspend_emacs): Don't suspend if there are multiple terminals.
lisp.h (get_frame_size): Removed superflous declaration.
xterm.c (Xtread_socket): Removed first parameter.
macterm.h (XTread_socket): Ditto.
w32inevt.c (w32_console_read_socket): Ditto.
w32term.c (w32_read_socket): Ditto.
sysdep.c (input_fd): Removed.
(change_input_fd): Removed.
(discard_tty_input): Discard pending input on _all_ input descriptors.
(stuff_char, tabs_safe_p): Use current terminal instead of input_fd.
(init_baud_rate, request_sigio, unrequest_sigio): Ditto.
(init_sys_modes, reset_sys_modes): Ditto.
(narrow_foreground_group, widen_foreground_group): Use stdin.
(init_sys_modes, reset_sys_modes): otty parameter renamed to tty_out.
(get_frame_size): Renamed to get_tty_size, added tty_out parameter.
term.c (read_socket_hook): Removed first parameter.
(clear_end_of_line): Use updating_frame, if possible.
(write_glyphs, insert_glyphs, ins_del_lines): Ditto.
(term_init): Renamed get_frame_size to get_tty_size.
termchar.h (struct tty_output): New entries: top_frame,
previous_terminal_frame.
termhooks.h (read_socket_hook): Removed first parameter.
window.c (init_window_once): Removed reference to Vterminal_frame.
xdisp.c (previous_terminal_frame): Moved to struct tty_output.
(redisplay_internal): Updated to use previous_terminal_frame in tty_output.
Allow for simultaneous refresh of multiple ttys.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-5
2003-12-26 04:24:54 +00:00
|
|
|
|
#include "lisp.h"
|
1991-05-09 10:29:44 +00:00
|
|
|
|
#include "termchar.h"
|
* tparam.h: New file.
* term.c, tparam.h: Include it.
* deps.mk (term.o, tparam.o): Depend on tparam.h.
* term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
Move these decls to tparam.h, and make them agree with what
is actually in tparam.c. The previous trick of using incompatible
decls in different modules does not conform to the C standard.
All callers of tparam changed to use tparam's actual API.
* tparam.c (tparam1, tparam, tgoto):
Use const pointers where appropriate.
2011-03-08 18:26:34 +00:00
|
|
|
|
#include "tparam.h"
|
2002-03-01 01:48:37 +00:00
|
|
|
|
#include "character.h"
|
2012-06-16 12:24:15 +00:00
|
|
|
|
#include "buffer.h"
|
1997-02-20 06:57:21 +00:00
|
|
|
|
#include "charset.h"
|
|
|
|
|
#include "coding.h"
|
2006-10-26 12:00:50 +00:00
|
|
|
|
#include "composite.h"
|
2000-08-22 22:41:00 +00:00
|
|
|
|
#include "keyboard.h"
|
1992-07-13 20:53:59 +00:00
|
|
|
|
#include "frame.h"
|
1991-05-09 10:29:44 +00:00
|
|
|
|
#include "disptab.h"
|
|
|
|
|
#include "termhooks.h"
|
1998-04-14 12:25:56 +00:00
|
|
|
|
#include "dispextern.h"
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
#include "window.h"
|
2001-10-08 11:39:52 +00:00
|
|
|
|
#include "keymap.h"
|
2007-03-20 08:51:20 +00:00
|
|
|
|
#include "blockinput.h"
|
2004-03-28 06:17:38 +00:00
|
|
|
|
#include "syssignal.h"
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
#include "sysstdio.h"
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#ifdef MSDOS
|
|
|
|
|
#include "msdos.h"
|
|
|
|
|
static int been_here = -1;
|
|
|
|
|
#endif
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2013-10-08 19:06:40 +00:00
|
|
|
|
#ifdef USE_X_TOOLKIT
|
|
|
|
|
#include "../lwlib/lwlib.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
1998-04-29 04:34:52 +00:00
|
|
|
|
#include "cm.h"
|
2012-06-02 14:57:51 +00:00
|
|
|
|
#include "menu.h"
|
2004-04-16 12:51:06 +00:00
|
|
|
|
|
2007-09-22 12:41:29 +00:00
|
|
|
|
/* The name of the default console device. */
|
|
|
|
|
#ifdef WINDOWSNT
|
Fix warnings when compiling on MS-Windows with -std=gnu99.
src/makefile.w32-in ($(BLD)/w32.$(O)):
($(BLD)/vm-limit.$(O)):
($(BLD)/term.$(O)):
($(BLD)/unexw32.$(O)):
($(BLD)/fileio.$(O)):
($(BLD)/dispnew.$(O)): Update dependencies.
src/w32term.h (w32_initialize_display_info, initialize_w32_display):
Add prototypes.
src/w32proc.c: Include ctype.h.
src/w32.h (init_environment, check_windows_init_file)
(syms_of_ntproc, syms_of_ntterm, dostounix_filename)
(unixtodos_filename, init_winsock, srandom, random, sys_pipe)
(set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
(sys_link): Add prototypes.
src/w32.c: Include w32select.h.
(sys_access, e_malloc, sys_select): Add prototypes.
(emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
src/vm-limit.c [WINDOWSNT]: Include w32heap.h.
src/unexw32.c: Include lisp.h and w32.h.
src/term.c [WINDOWSNT]: Include w32term.h.
src/process.c [WINDOWSNT]: Add prototype of sys_select.
src/fileio.c [WINDOWSNT]: Include w32.h.
src/dispnew.c [WINDOWSNT]: Include w32.h.
nt/inc/pwd.h (getuid, geteuid): Add prototypes.
nt/inc/ms-w32.h (sys_wait, _getpid, gmtgime_r, localtime_r)
(signal_handler, sys_signal, sigemptyset, sigfillset, sigprocmask)
(pthread_sigmask, sigismember, setpgrp, sigaction, alarm)
(sys_kill, getpagesize): Add prototypes for emulated functions.
nt/inc/grp.h (getgid, getegid): Add prototypes.
nt/gmake.defs (DEBUG_CFLAGS) [NOOPT]: Add -std=gnu99.
nt/configure.bat (chkapiN): Avoid compiler warning in junk.c when
compiling with -std=gnu99.
nt/config.nt (CHECK_LISP_OBJECT_TYPE): Don't undef, so that it
could be used via --cflags switch to configure.bat.
2012-10-17 19:02:44 +00:00
|
|
|
|
#include "w32term.h"
|
2007-09-22 12:41:29 +00:00
|
|
|
|
#endif
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2010-07-02 12:19:53 +00:00
|
|
|
|
static void tty_set_scroll_region (struct frame *f, int start, int stop);
|
|
|
|
|
static void turn_on_face (struct frame *, int face_id);
|
|
|
|
|
static void turn_off_face (struct frame *, int face_id);
|
2011-04-14 02:52:33 +00:00
|
|
|
|
static void tty_turn_off_highlight (struct tty_display_info *);
|
2010-07-02 12:19:53 +00:00
|
|
|
|
static void tty_show_cursor (struct tty_display_info *);
|
|
|
|
|
static void tty_hide_cursor (struct tty_display_info *);
|
|
|
|
|
static void tty_background_highlight (struct tty_display_info *tty);
|
|
|
|
|
static void clear_tty_hooks (struct terminal *terminal);
|
|
|
|
|
static void set_tty_hooks (struct terminal *terminal);
|
|
|
|
|
static void dissociate_if_controlling_tty (int fd);
|
|
|
|
|
static void delete_tty (struct terminal *);
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
static _Noreturn void maybe_fatal (bool, struct terminal *,
|
|
|
|
|
const char *, const char *, ...)
|
2012-06-24 17:39:14 +00:00
|
|
|
|
ATTRIBUTE_FORMAT_PRINTF (3, 5) ATTRIBUTE_FORMAT_PRINTF (4, 5);
|
|
|
|
|
static _Noreturn void vfatal (const char *str, va_list ap)
|
|
|
|
|
ATTRIBUTE_FORMAT_PRINTF (1, 0);
|
2010-07-13 04:47:45 +00:00
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
#define OUTPUT(tty, a) \
|
|
|
|
|
emacs_tputs ((tty), a, \
|
2014-08-10 08:26:28 +00:00
|
|
|
|
FRAME_TOTAL_LINES (XFRAME (selected_frame)) - curY (tty), \
|
2003-12-27 01:12:57 +00:00
|
|
|
|
cmputc)
|
|
|
|
|
|
Implemented multiple tty support.
README.multi-tty: New file.
src/termchar.h (struct terminal): Renamed to struct tty_output. Added name, type,
input, output, termscript, old_tty, term_initted, old_tty_valid,
background_pixel, foreground_pixel, next fields.
(TERMINAL_*): Renamed to TTY_* for brevity.
(CURRENT_TERMINAL): Renamed to CURTTY for brevity.
(tty_list): New variable.
(TERMINAL_PTR): Removed.
(FRAME_TTY): New function.
(TTY_NAME, TTY_TYPE): New macros.
src/term.c (current_terminal): Removed. (_current_terminal): Removed. (tty_list):
New variable. (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
parameter. (set_terminal_modes): Added tty parameter. (reset_terminal_modes):
Added tty parameter. (cursor_to, raw_cursor_to): Updated cmgoto() calls.
(clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
cmcheckmagic() calls. (get_named_tty): New function. (term_dummy_init): New
function. (term_init): Added name parameter, added tty_output return value.
Changed algorithm to update tty_list. Call init_sys_modes() to set up tty
mode on the newly opened terminal device.
(get_current_tty): New function, intended for debugging.
src/termhooks.h (termscript): Removed.
src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
definition.
src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
(current_tty): New variable, for cmputc().
(cmcheckmagic, cmputc, cmgoto): Added prototypes.
src/cm.c (current_tty): New variable, for cmputc().
(cmputc): Use it.
(cmcheckmagic): Added tty parameter, look up terminal streams there.
(calccost): Added tty parameter. Use emacs_tputs() instead of tputs().
(cmgoto): Added tty parameter. Pass it on to calccost(). Use emacs_tputs()
instead of tputs().
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
(term_init): Added name parameter (the filename of the terminal device). Added
return value (struct tty_output).
src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
(termscript): Moved to struct tty_output.
(terminal_type): Removed.
src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
during init_display().
(shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
src/frame.c (Qtty, Qtty_type): New variables.
(syms_of_frame): Initialize them.
(tty_display): Removed.
(make_terminal_frame): New parameters (tty filename and type).
Initialize output_data.tty field instead of output_data.x. Use term_init() to
find the right tty_output. (Use term_dummy_init() during bootstrap.)
(Fmake_terminal_frame): Get device filename and type from frame parameters.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
if the frame is a tty.
(struct frame): New member in output_data: tty.
(make_terminal_frame): Updated of prototype.
src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
reset_sys_modes(). Ditto with init_sys_modes().
src/lisp.h (tty_output): Added forward declaration.
(init_sys_modes, reset_sys_modes): Updated prototype.
(init_all_sys_modes, reset_all_sys_modes): New prototypes.
src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
(init_all_sys_modes): New function.
(init_sys_modes): Added tty_output parameter. Use it.
(reset_all_sys_modes): New function.
(reset_sys_modes): Added tty_output parameter. Use it.
src/Makefile.in: Update dependencies.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
2003-12-25 06:59:31 +00:00
|
|
|
|
#define OUTPUT1(tty, a) emacs_tputs ((tty), a, 1, cmputc)
|
|
|
|
|
#define OUTPUTL(tty, a, lines) emacs_tputs ((tty), a, lines, cmputc)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
Implemented multiple tty support.
README.multi-tty: New file.
src/termchar.h (struct terminal): Renamed to struct tty_output. Added name, type,
input, output, termscript, old_tty, term_initted, old_tty_valid,
background_pixel, foreground_pixel, next fields.
(TERMINAL_*): Renamed to TTY_* for brevity.
(CURRENT_TERMINAL): Renamed to CURTTY for brevity.
(tty_list): New variable.
(TERMINAL_PTR): Removed.
(FRAME_TTY): New function.
(TTY_NAME, TTY_TYPE): New macros.
src/term.c (current_terminal): Removed. (_current_terminal): Removed. (tty_list):
New variable. (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
parameter. (set_terminal_modes): Added tty parameter. (reset_terminal_modes):
Added tty parameter. (cursor_to, raw_cursor_to): Updated cmgoto() calls.
(clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
cmcheckmagic() calls. (get_named_tty): New function. (term_dummy_init): New
function. (term_init): Added name parameter, added tty_output return value.
Changed algorithm to update tty_list. Call init_sys_modes() to set up tty
mode on the newly opened terminal device.
(get_current_tty): New function, intended for debugging.
src/termhooks.h (termscript): Removed.
src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
definition.
src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
(current_tty): New variable, for cmputc().
(cmcheckmagic, cmputc, cmgoto): Added prototypes.
src/cm.c (current_tty): New variable, for cmputc().
(cmputc): Use it.
(cmcheckmagic): Added tty parameter, look up terminal streams there.
(calccost): Added tty parameter. Use emacs_tputs() instead of tputs().
(cmgoto): Added tty parameter. Pass it on to calccost(). Use emacs_tputs()
instead of tputs().
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
(term_init): Added name parameter (the filename of the terminal device). Added
return value (struct tty_output).
src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
(termscript): Moved to struct tty_output.
(terminal_type): Removed.
src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
during init_display().
(shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
src/frame.c (Qtty, Qtty_type): New variables.
(syms_of_frame): Initialize them.
(tty_display): Removed.
(make_terminal_frame): New parameters (tty filename and type).
Initialize output_data.tty field instead of output_data.x. Use term_init() to
find the right tty_output. (Use term_dummy_init() during bootstrap.)
(Fmake_terminal_frame): Get device filename and type from frame parameters.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
if the frame is a tty.
(struct frame): New member in output_data: tty.
(make_terminal_frame): Updated of prototype.
src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
reset_sys_modes(). Ditto with init_sys_modes().
src/lisp.h (tty_output): Added forward declaration.
(init_sys_modes, reset_sys_modes): Updated prototype.
(init_all_sys_modes, reset_all_sys_modes): New prototypes.
src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
(init_all_sys_modes): New function.
(init_sys_modes): Added tty_output parameter. Use it.
(reset_all_sys_modes): New function.
(reset_sys_modes): Added tty_output parameter. Use it.
src/Makefile.in: Update dependencies.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
2003-12-25 06:59:31 +00:00
|
|
|
|
#define OUTPUT_IF(tty, a) \
|
2003-12-27 01:12:57 +00:00
|
|
|
|
do { \
|
|
|
|
|
if (a) \
|
2011-02-18 02:07:36 +00:00
|
|
|
|
OUTPUT (tty, a); \
|
2003-12-27 01:12:57 +00:00
|
|
|
|
} while (0)
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Implemented multiple tty support.
README.multi-tty: New file.
src/termchar.h (struct terminal): Renamed to struct tty_output. Added name, type,
input, output, termscript, old_tty, term_initted, old_tty_valid,
background_pixel, foreground_pixel, next fields.
(TERMINAL_*): Renamed to TTY_* for brevity.
(CURRENT_TERMINAL): Renamed to CURTTY for brevity.
(tty_list): New variable.
(TERMINAL_PTR): Removed.
(FRAME_TTY): New function.
(TTY_NAME, TTY_TYPE): New macros.
src/term.c (current_terminal): Removed. (_current_terminal): Removed. (tty_list):
New variable. (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
parameter. (set_terminal_modes): Added tty parameter. (reset_terminal_modes):
Added tty parameter. (cursor_to, raw_cursor_to): Updated cmgoto() calls.
(clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
cmcheckmagic() calls. (get_named_tty): New function. (term_dummy_init): New
function. (term_init): Added name parameter, added tty_output return value.
Changed algorithm to update tty_list. Call init_sys_modes() to set up tty
mode on the newly opened terminal device.
(get_current_tty): New function, intended for debugging.
src/termhooks.h (termscript): Removed.
src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
definition.
src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
(current_tty): New variable, for cmputc().
(cmcheckmagic, cmputc, cmgoto): Added prototypes.
src/cm.c (current_tty): New variable, for cmputc().
(cmputc): Use it.
(cmcheckmagic): Added tty parameter, look up terminal streams there.
(calccost): Added tty parameter. Use emacs_tputs() instead of tputs().
(cmgoto): Added tty parameter. Pass it on to calccost(). Use emacs_tputs()
instead of tputs().
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
(term_init): Added name parameter (the filename of the terminal device). Added
return value (struct tty_output).
src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
(termscript): Moved to struct tty_output.
(terminal_type): Removed.
src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
during init_display().
(shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
src/frame.c (Qtty, Qtty_type): New variables.
(syms_of_frame): Initialize them.
(tty_display): Removed.
(make_terminal_frame): New parameters (tty filename and type).
Initialize output_data.tty field instead of output_data.x. Use term_init() to
find the right tty_output. (Use term_dummy_init() during bootstrap.)
(Fmake_terminal_frame): Get device filename and type from frame parameters.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
if the frame is a tty.
(struct frame): New member in output_data: tty.
(make_terminal_frame): Updated of prototype.
src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
reset_sys_modes(). Ditto with init_sys_modes().
src/lisp.h (tty_output): Added forward declaration.
(init_sys_modes, reset_sys_modes): Updated prototype.
(init_all_sys_modes, reset_all_sys_modes): New prototypes.
src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
(init_all_sys_modes): New function.
(init_sys_modes): Added tty_output parameter. Use it.
(reset_all_sys_modes): New function.
(reset_sys_modes): Added tty_output parameter. Use it.
src/Makefile.in: Update dependencies.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
2003-12-25 06:59:31 +00:00
|
|
|
|
#define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0)
|
1996-08-29 20:50:15 +00:00
|
|
|
|
|
2014-07-21 01:41:59 +00:00
|
|
|
|
/* Display space properties. */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2014-07-21 01:41:59 +00:00
|
|
|
|
/* Chain of all tty device parameters. */
|
Separate frame-local, tty-dependent parameters from tty-local parameters.
src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters. (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.
src/term.c: Update prototypes. Use tty_display_info instead of tty_output.
src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.
src/cm.h: Update prototypes.
src/dispextern.h: Ditto.
src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.
src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output. Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty. Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty. Use reference count to
decide if the tty should be closed.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.
src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.
src/lisp.h: Declare struct display. Update prototypes.
src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
2004-01-01 17:55:53 +00:00
|
|
|
|
struct tty_display_info *tty_list;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2000-04-01 13:33:12 +00:00
|
|
|
|
/* Meaning of bits in no_color_video. Each bit set means that the
|
|
|
|
|
corresponding attribute cannot be combined with colors. */
|
|
|
|
|
|
|
|
|
|
enum no_color_bit
|
|
|
|
|
{
|
|
|
|
|
NC_STANDOUT = 1 << 0,
|
|
|
|
|
NC_UNDERLINE = 1 << 1,
|
|
|
|
|
NC_REVERSE = 1 << 2,
|
2012-06-09 16:44:44 +00:00
|
|
|
|
NC_ITALIC = 1 << 3,
|
2000-04-01 13:33:12 +00:00
|
|
|
|
NC_DIM = 1 << 4,
|
|
|
|
|
NC_BOLD = 1 << 5,
|
|
|
|
|
NC_INVIS = 1 << 6,
|
2012-06-09 16:44:44 +00:00
|
|
|
|
NC_PROTECT = 1 << 7
|
2000-04-01 13:33:12 +00:00
|
|
|
|
};
|
|
|
|
|
|
1991-05-09 10:29:44 +00:00
|
|
|
|
/* internal state */
|
|
|
|
|
|
1995-02-17 08:42:18 +00:00
|
|
|
|
/* The largest frame width in any call to calculate_costs. */
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2011-04-14 02:52:33 +00:00
|
|
|
|
static int max_frame_cols;
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
1994-11-01 08:44:15 +00:00
|
|
|
|
|
2007-05-20 05:13:28 +00:00
|
|
|
|
#ifdef HAVE_GPM
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
#include <sys/fcntl.h>
|
|
|
|
|
|
2007-09-21 17:10:48 +00:00
|
|
|
|
/* The device for which we have enabled gpm support (or NULL). */
|
|
|
|
|
struct tty_display_info *gpm_tty = NULL;
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
2010-11-02 19:35:12 +00:00
|
|
|
|
/* Last recorded mouse coordinates. */
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
static int last_mouse_x, last_mouse_y;
|
2007-05-20 05:13:28 +00:00
|
|
|
|
#endif /* HAVE_GPM */
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
/* Ring the bell on a tty. */
|
1996-08-29 20:50:15 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
tty_ring_bell (struct frame *f)
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
{
|
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
1996-08-29 20:50:15 +00:00
|
|
|
|
|
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
* lisp/frame.el (make-frame-on-display): Update doc.
(make-frame): Handle display-id parameter. Update doc.
(frames-on-display-list): Update for display ids.
(framep-on-display): Ditto.
(suspend-frame): Use display-name, not frame-tty-name.
(selected-display): New function.
* lisp/server.el (server-delete-client): Use delete-display, not delete-tty.
(server-tty-live-p, server-handle-delete-tty): Removed.
(server-handle-delete-frame): Delete tty clients, if needed.
(server-process-filter): Set the display parameter, and use it when appropriate.
(server-handle-suspend-tty): Use the display parameter.
(server-start, server-unload-hook): Removed obsolete delete-tty hook.
* lisp/talk.el (talk): Always use talk-add-display.
(talk-add-tty-frame, talk-handle-delete-tty): Removed.
(talk-handle-delete-frame): New function.
(talk-add-display): Open a new frame only if parameter was not a frame.
* src/dispextern.h (get_display, Fdisplay_tty_type): New prototypes.
(Fframe_tty_type): Removed.
* src/dispnew.c (init_display): Use Fdisplay_tty_type, not Fframe_tty_type.
* src/frame.c (Qdisplay_id, Qdisplay_live_p): New symbols.
(make_terminal_frame): Get display as a parameter.
(Fmake_terminal_frame): Get/create display here; pass it to
make_terminal_frame.
(Fframe_display): New function.
(Fdelete_frame): Stop if the hook deleted the frame.
(syms_of_frame): Register new stuff.
* src/frame.h (Qdisplay_id, Qdisplay_live_p, make_terminal_frame):
Updated prototypes.
* src/keyboard.c (interrupt_signal): Updated comment.
* src/term.c (Vdelete_tty_after_functions): Removed variable.
(Qframe_tty_name, Qframe_tty_type): Removed.
(next_display_id): New var.
(tty_ring_bell): Don't do anything on suspended frames.
(Ftty_display_color_p, Ftty_display_color_cells): Doc update.
(get_display): New function.
(get_tty_display): Use it.
(get_named_tty_display): Ignore suspended displays.
(Fframe_tty_name): Renamed to Fdisplay_name. Handle all kinds of
displays.
(Fframe_tty_type): Renamed to Fdisplay_tty_type.
(init_initial_display): Set display name.
(term_init): Allow more displays on the same device. Set display name.
(Fdelete_tty): Removed.
(delete_tty): Don't run hooks.
(create_display): Set display id.
(delete_display): Free display name.
(Fdelete_display, Fdisplay_live_p, Fdisplay_list): New functions.
(Fsuspend_tty): Call hook with display id. Doc update.
(Fresume_tty): Refuse to resume when there is already an active display
on the same device. Call hook with display id. Doc update.
(syms_of_term): Reflect above changes.
* src/termhooks.h (struct display): Added `id' and `name' members.
(DISPLAY_ACTIVE_P): New macro.
* src/xfns.c (check_x_display_info): Handle display ids.
(Fx_create_frame): Try to get display from `display-id' parameter.
* src/xterm.c (x_term_init): Set display name.
(x_delete_display): Handle the case when `font_table' is NULL.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-207
2004-07-04 04:48:55 +00:00
|
|
|
|
if (tty->output)
|
|
|
|
|
{
|
|
|
|
|
OUTPUT (tty, (tty->TS_visible_bell && visible_bell
|
|
|
|
|
? tty->TS_visible_bell
|
|
|
|
|
: tty->TS_bell));
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fflush_unlocked (tty->output);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
/* Set up termcap modes for Emacs. */
|
|
|
|
|
|
2014-04-17 07:54:23 +00:00
|
|
|
|
static void
|
2014-04-17 14:59:22 +00:00
|
|
|
|
tty_send_additional_strings (struct terminal *terminal, Lisp_Object sym)
|
2014-04-17 07:54:23 +00:00
|
|
|
|
{
|
2017-09-18 05:01:56 +00:00
|
|
|
|
/* Use only accessors like CDR_SAFE and assq_no_quit to avoid any
|
|
|
|
|
form of quitting or signaling an error, since this function can
|
|
|
|
|
run as part of the "emergency escape" procedure invoked in the
|
|
|
|
|
middle of GC, where quitting means crashing (Bug#17406). */
|
|
|
|
|
if (! terminal->name)
|
|
|
|
|
return;
|
2014-04-17 07:54:23 +00:00
|
|
|
|
struct tty_display_info *tty = terminal->display_info.tty;
|
|
|
|
|
|
2017-09-18 05:01:56 +00:00
|
|
|
|
for (Lisp_Object extra_codes
|
|
|
|
|
= CDR_SAFE (assq_no_quit (sym, terminal->param_alist));
|
2014-04-17 07:54:23 +00:00
|
|
|
|
CONSP (extra_codes);
|
|
|
|
|
extra_codes = XCDR (extra_codes))
|
|
|
|
|
{
|
|
|
|
|
Lisp_Object string = XCAR (extra_codes);
|
|
|
|
|
if (STRINGP (string))
|
|
|
|
|
{
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fwrite_unlocked (SDATA (string), 1, SBYTES (string), tty->output);
|
2014-04-17 07:54:23 +00:00
|
|
|
|
if (tty->termscript)
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fwrite_unlocked (SDATA (string), 1, SBYTES (string),
|
|
|
|
|
tty->termscript);
|
2014-04-17 07:54:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-04-14 02:52:33 +00:00
|
|
|
|
static void
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
tty_set_terminal_modes (struct terminal *terminal)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
struct tty_display_info *tty = terminal->display_info.tty;
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
if (tty->output)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
2005-09-04 03:48:17 +00:00
|
|
|
|
if (tty->TS_termcap_modes)
|
|
|
|
|
OUTPUT (tty, tty->TS_termcap_modes);
|
2005-08-07 17:35:09 +00:00
|
|
|
|
else
|
2005-09-04 03:48:17 +00:00
|
|
|
|
{
|
|
|
|
|
/* Output enough newlines to scroll all the old screen contents
|
|
|
|
|
off the screen, so it won't be overwritten and lost. */
|
|
|
|
|
int i;
|
2005-09-19 21:25:51 +00:00
|
|
|
|
current_tty = tty;
|
2014-08-10 08:26:28 +00:00
|
|
|
|
for (i = 0; i < FRAME_TOTAL_LINES (XFRAME (selected_frame)); i++)
|
2005-09-19 21:25:51 +00:00
|
|
|
|
cmputc ('\n');
|
2005-09-04 03:48:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-01-03 02:15:28 +00:00
|
|
|
|
OUTPUT_IF (tty, visible_cursor ? tty->TS_cursor_visible : tty->TS_cursor_normal);
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
OUTPUT_IF (tty, tty->TS_keypad_mode);
|
|
|
|
|
losecursor (tty);
|
2014-04-17 07:54:23 +00:00
|
|
|
|
tty_send_additional_strings (terminal, Qtty_mode_set_strings);
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fflush_unlocked (tty->output);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
/* Reset termcap modes before exiting Emacs. */
|
|
|
|
|
|
2011-04-14 02:52:33 +00:00
|
|
|
|
static void
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
tty_reset_terminal_modes (struct terminal *terminal)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
struct tty_display_info *tty = terminal->display_info.tty;
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
|
|
|
|
|
if (tty->output)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
2014-04-17 07:54:23 +00:00
|
|
|
|
tty_send_additional_strings (terminal, Qtty_mode_reset_strings);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_highlight (tty);
|
|
|
|
|
tty_turn_off_insert (tty);
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
OUTPUT_IF (tty, tty->TS_end_keypad_mode);
|
|
|
|
|
OUTPUT_IF (tty, tty->TS_cursor_normal);
|
|
|
|
|
OUTPUT_IF (tty, tty->TS_end_termcap_modes);
|
|
|
|
|
OUTPUT_IF (tty, tty->TS_orig_pair);
|
2001-05-31 08:56:32 +00:00
|
|
|
|
/* Output raw CR so kernel can track the cursor hpos. */
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
current_tty = tty;
|
2001-05-31 08:56:32 +00:00
|
|
|
|
cmputc ('\r');
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fflush_unlocked (tty->output);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
/* Flag the end of a display update on a termcap terminal. */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
tty_update_end (struct frame *f)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
if (!XWINDOW (selected_window)->cursor_off_p)
|
|
|
|
|
tty_show_cursor (tty);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_insert (tty);
|
|
|
|
|
tty_background_highlight (tty);
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fflush_unlocked (tty->output);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
/* The implementation of set_terminal_window for termcap frames. */
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
tty_set_terminal_window (struct frame *f, int size)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
|
|
|
|
|
2014-08-10 08:26:28 +00:00
|
|
|
|
tty->specified_window = size ? size : FRAME_TOTAL_LINES (f);
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
if (FRAME_SCROLL_REGION_OK (f))
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_set_scroll_region (f, 0, tty->specified_window);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
|
|
|
|
tty_set_scroll_region (struct frame *f, int start, int stop)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
|
|
|
|
char *buf;
|
Separate frame-local, tty-dependent parameters from tty-local parameters.
src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters. (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.
src/term.c: Update prototypes. Use tty_display_info instead of tty_output.
src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.
src/cm.h: Update prototypes.
src/dispextern.h: Ditto.
src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.
src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output. Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty. Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty. Use reference count to
decide if the tty should be closed.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.
src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.
src/lisp.h: Declare struct display. Update prototypes.
src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
2004-01-01 17:55:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_set_scroll_region)
|
* tparam.h: New file.
* term.c, tparam.h: Include it.
* deps.mk (term.o, tparam.o): Depend on tparam.h.
* term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
Move these decls to tparam.h, and make them agree with what
is actually in tparam.c. The previous trick of using incompatible
decls in different modules does not conform to the C standard.
All callers of tparam changed to use tparam's actual API.
* tparam.c (tparam1, tparam, tgoto):
Use const pointers where appropriate.
2011-03-08 18:26:34 +00:00
|
|
|
|
buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1, 0, 0);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
else if (tty->TS_set_scroll_region_1)
|
|
|
|
|
buf = tparam (tty->TS_set_scroll_region_1, 0, 0,
|
2014-08-10 08:26:28 +00:00
|
|
|
|
FRAME_TOTAL_LINES (f), start,
|
|
|
|
|
FRAME_TOTAL_LINES (f) - stop,
|
|
|
|
|
FRAME_TOTAL_LINES (f));
|
1991-05-09 10:29:44 +00:00
|
|
|
|
else
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
buf = tparam (tty->TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (f));
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
OUTPUT (tty, buf);
|
Put interrupt input blocking in a separate file from xterm.h.
This isn't specific to X, and it allows us to avoid #including
xterm.h in files that don't really have anything to do with X.
* blockinput.h: New file.
* xterm.h (BLOCK_INPUT, UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT,
UNBLOCK_INPUT_RESIGNAL): These are now in blockinput.h.
(x_input_blocked, x_pending_input): Deleted; there are analogs
in blockinput.h called interrupt_input_blocked and
interrupt_input_pending.
* keyboard.c (interrupt_input_blocked, interrupt_input_pending):
New variables, used by the macros in blockinput.h.
* xterm.c: #include blockinput.h.
(x_input_blocked, x_pending_input): Deleted.
(XTread_socket): Test and set interrupt_input_blocked and
interrupt_input_pending instead of the old variables.
* alloc.c, xfaces.c, xfns.c, xmenu.c, xselect.c, keymap.c:
#include blockinput.h.
* eval.c: #include blockinput.h instead of xterm.h.
* keyboard.c: #include blockinput.h.
(input_poll_signal): Just test
interrupt_input_blocked, instead of testing HAVE_X_WINDOWS and
x_input_blocked.
Block the processing of interrupt input while we're manipulating the
malloc heap.
* alloc.c: (xfree): New function, to make it easy to free things
safely.
(xmalloc, xrealloc): Block X input while doing the deed.
(VALIDATE_LISP_STORAGE, gc_sweep, compact_strings): Use xfree
instead of free.
(uninterrupt_malloc): New function, to install input-blocking
hooks into the GNU malloc routines.
* emacs.c [not SYSTEM_MALLOC] (main): Call uninterrupt_malloc
on startup.
* alloc.c: (make_interval, make_float, Fcons, Fmake_vector,
Fmake_symbol, Fmake_marker, make_uninit_string, Fgarbage_collect):
Use xmalloc instead of malloc; don't bother to check if out of
memory here.
(Fgarbage_collect): Call xrealloc instead of realloc.
* buffer.c: Use xmalloc and xfree instead of malloc and free;
don't bother to check if out of memory here.
(Fget_buffer_create): Put BLOCK_INPUT/UNBLOCK_INPUT pair around
calls to ralloc routines.
* insdel.c: Same.
* lisp.h (xfree): New extern declaration.
* xfaces.c (xfree): Don't #define this to be free; use the
definition in alloc.c.
* dispnew.c, doc.c, doprnt.c, fileio.c, lread.c, term.c, xfns.c,
xmenu.c, xterm.c: Use xfree instead of free.
* hftctl.c: Use xfree and xmalloc instead of free and malloc.
* keymap.c (current_minor_maps): BLOCK_INPUT while calling realloc
and malloc.
* search.c: Since the regexp routines can malloc, BLOCK_INPUT
while runing them. #include blockinput.h.
* sysdep.c: #include blockinput.h. Call xfree and xmalloc instead
of free and malloc. BLOCK_INPUT around routines which we know
will call malloc.
ymakefile (keyboard.o, keymap.o, search.o, sysdep.o, xfaces.o,
xfns.o, xmenu.o, xterm.o, xselect.o, alloc.o, eval.o): Note that
these depend on blockinput.h.
1993-03-31 10:55:33 +00:00
|
|
|
|
xfree (buf);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
losecursor (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
2001-05-31 08:56:32 +00:00
|
|
|
|
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2001-05-31 08:56:32 +00:00
|
|
|
|
static void
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_on_insert (struct tty_display_info *tty)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (!tty->insert_mode)
|
|
|
|
|
OUTPUT (tty, tty->TS_insert_mode);
|
|
|
|
|
tty->insert_mode = 1;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-04-14 12:25:56 +00:00
|
|
|
|
void
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_insert (struct tty_display_info *tty)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->insert_mode)
|
|
|
|
|
OUTPUT (tty, tty->TS_end_insert_mode);
|
|
|
|
|
tty->insert_mode = 0;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-20 10:33:48 +00:00
|
|
|
|
/* Handle highlighting. */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2011-04-14 02:52:33 +00:00
|
|
|
|
static void
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_highlight (struct tty_display_info *tty)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->standout_mode)
|
|
|
|
|
OUTPUT_IF (tty, tty->TS_end_standout_mode);
|
|
|
|
|
tty->standout_mode = 0;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-05-31 08:56:32 +00:00
|
|
|
|
static void
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_on_highlight (struct tty_display_info *tty)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (!tty->standout_mode)
|
|
|
|
|
OUTPUT_IF (tty, tty->TS_standout_mode);
|
|
|
|
|
tty->standout_mode = 1;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-04-25 18:31:33 +00:00
|
|
|
|
static void
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_toggle_highlight (struct tty_display_info *tty)
|
2001-04-25 18:31:33 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->standout_mode)
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_highlight (tty);
|
2001-04-25 18:31:33 +00:00
|
|
|
|
else
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_on_highlight (tty);
|
2001-04-25 18:31:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
|
|
|
|
/* Make cursor invisible. */
|
|
|
|
|
|
|
|
|
|
static void
|
Separate frame-local, tty-dependent parameters from tty-local parameters.
src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters. (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.
src/term.c: Update prototypes. Use tty_display_info instead of tty_output.
src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.
src/cm.h: Update prototypes.
src/dispextern.h: Ditto.
src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.
src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output. Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty. Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty. Use reference count to
decide if the tty should be closed.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.
src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.
src/lisp.h: Declare struct display. Update prototypes.
src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
2004-01-01 17:55:53 +00:00
|
|
|
|
tty_hide_cursor (struct tty_display_info *tty)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->cursor_hidden == 0)
|
2001-05-31 08:56:32 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->cursor_hidden = 1;
|
2013-09-18 08:26:03 +00:00
|
|
|
|
#ifdef WINDOWSNT
|
|
|
|
|
w32con_hide_cursor ();
|
|
|
|
|
#else
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT_IF (tty, tty->TS_cursor_invisible);
|
2013-09-18 08:26:03 +00:00
|
|
|
|
#endif
|
2001-05-31 08:56:32 +00:00
|
|
|
|
}
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Ensure that cursor is visible. */
|
|
|
|
|
|
|
|
|
|
static void
|
Separate frame-local, tty-dependent parameters from tty-local parameters.
src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters. (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.
src/term.c: Update prototypes. Use tty_display_info instead of tty_output.
src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.
src/cm.h: Update prototypes.
src/dispextern.h: Ditto.
src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.
src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output. Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty. Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty. Use reference count to
decide if the tty should be closed.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.
src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.
src/lisp.h: Declare struct display. Update prototypes.
src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
2004-01-01 17:55:53 +00:00
|
|
|
|
tty_show_cursor (struct tty_display_info *tty)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->cursor_hidden)
|
2001-05-31 08:56:32 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->cursor_hidden = 0;
|
2013-09-18 08:26:03 +00:00
|
|
|
|
#ifdef WINDOWSNT
|
|
|
|
|
w32con_show_cursor ();
|
|
|
|
|
#else
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT_IF (tty, tty->TS_cursor_normal);
|
2005-12-30 21:48:35 +00:00
|
|
|
|
if (visible_cursor)
|
2006-01-03 02:15:28 +00:00
|
|
|
|
OUTPUT_IF (tty, tty->TS_cursor_visible);
|
2013-09-18 08:26:03 +00:00
|
|
|
|
#endif
|
2001-05-31 08:56:32 +00:00
|
|
|
|
}
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1991-05-09 10:29:44 +00:00
|
|
|
|
/* Set standout mode to the state it should be in for
|
|
|
|
|
empty space inside windows. What this is,
|
|
|
|
|
depends on the user option inverse-video. */
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
|
|
|
|
tty_background_highlight (struct tty_display_info *tty)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
|
|
|
|
if (inverse_video)
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_on_highlight (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
else
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_highlight (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Set standout mode to the mode specified for the text to be output. */
|
|
|
|
|
|
1998-04-14 12:25:56 +00:00
|
|
|
|
static void
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_highlight_if_desired (struct tty_display_info *tty)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
(reassert_line_highlight_hook, change_line_highlight_hook): Variables removed.
(reassert_line_highlight, change_line_highlight): Functions removed.
(standout_requested): Variable removed.
(update_end, highlight_if_desired): Don't use it.
(chars_wasted, copybuf): Variables removed.
(write_standout_marker): Function removed.
(cursor_to, clear_to_end, clear_frame, clear_end_of_line_raw)
(clear_end_of_line_raw, write_glyphs, ins_del_lines):
Don't use `chars_wasted' or `copybuf'.
(calculate_costs): Don't allocate `chars_wasted' or `copybuf'.
Set `costs_set' to true.
(cursor_to, clear_end_of_line): Test `costs_set' instead of `chars_wasted'.
(clear_end_of_line): Function removed.
(clear_end_of_line_raw): Renamed to `clear_end_of_line'.
(clear_to_end): Call `clear_end_of_line' instead of `clear_end_of_line_raw'.
2001-10-20 05:53:04 +00:00
|
|
|
|
if (inverse_video)
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_on_highlight (tty);
|
(reassert_line_highlight_hook, change_line_highlight_hook): Variables removed.
(reassert_line_highlight, change_line_highlight): Functions removed.
(standout_requested): Variable removed.
(update_end, highlight_if_desired): Don't use it.
(chars_wasted, copybuf): Variables removed.
(write_standout_marker): Function removed.
(cursor_to, clear_to_end, clear_frame, clear_end_of_line_raw)
(clear_end_of_line_raw, write_glyphs, ins_del_lines):
Don't use `chars_wasted' or `copybuf'.
(calculate_costs): Don't allocate `chars_wasted' or `copybuf'.
Set `costs_set' to true.
(cursor_to, clear_end_of_line): Test `costs_set' instead of `chars_wasted'.
(clear_end_of_line): Function removed.
(clear_end_of_line_raw): Renamed to `clear_end_of_line'.
(clear_to_end): Call `clear_end_of_line' instead of `clear_end_of_line_raw'.
2001-10-20 05:53:04 +00:00
|
|
|
|
else
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_highlight (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
/* Move cursor to row/column position VPOS/HPOS. HPOS/VPOS are
|
|
|
|
|
frame-relative coordinates. */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
tty_cursor_to (struct frame *f, int vpos, int hpos)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
1995-06-05 12:35:17 +00:00
|
|
|
|
/* Detect the case where we are called from reset_sys_modes
|
|
|
|
|
and the costs have never been calculated. Do nothing. */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (! tty->costs_set)
|
1995-06-05 12:35:17 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
if (curY (tty) == vpos
|
|
|
|
|
&& curX (tty) == hpos)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
return;
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (!tty->TF_standout_motion)
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_background_highlight (tty);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (!tty->TF_insmode_motion)
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_insert (tty);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
cmgoto (tty, vpos, hpos);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Similar but don't take any account of the wasted characters. */
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
tty_raw_cursor_to (struct frame *f, int row, int col)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
if (curY (tty) == row
|
|
|
|
|
&& curX (tty) == col)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
return;
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (!tty->TF_standout_motion)
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_background_highlight (tty);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (!tty->TF_insmode_motion)
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_insert (tty);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
cmgoto (tty, row, col);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Erase operations */
|
|
|
|
|
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
/* Clear from cursor to end of frame on a termcap device. */
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
tty_clear_to_end (struct frame *f)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
|
|
|
|
register int i;
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_clr_to_bottom)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_background_highlight (tty);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT (tty, tty->TS_clr_to_bottom);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-08-10 08:26:28 +00:00
|
|
|
|
for (i = curY (tty); i < FRAME_TOTAL_LINES (f); i++)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
cursor_to (f, i, 0);
|
|
|
|
|
clear_end_of_line (f, FRAME_COLS (f));
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
/* Clear an entire termcap frame. */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
tty_clear_frame (struct frame *f)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_clr_frame)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_background_highlight (tty);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT (tty, tty->TS_clr_frame);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
cmat (tty, 0, 0);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
cursor_to (f, 0, 0);
|
|
|
|
|
clear_to_end (f);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
/* An implementation of clear_end_of_line for termcap frames.
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
|
|
|
|
Note that the cursor may be moved, on terminals lacking a `ce' string. */
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
tty_clear_end_of_line (struct frame *f, int first_unused_hpos)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
|
|
|
|
register int i;
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
1995-06-05 12:35:17 +00:00
|
|
|
|
/* Detect the case where we are called from reset_sys_modes
|
|
|
|
|
and the costs have never been calculated. Do nothing. */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (! tty->costs_set)
|
1995-06-05 12:35:17 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
if (curX (tty) >= first_unused_hpos)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
return;
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_background_highlight (tty);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_clr_line)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT1 (tty, tty->TS_clr_line);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{ /* have to do it the hard way */
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_insert (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
/* Do not write in last row last col with Auto-wrap on. */
|
2003-12-27 01:12:57 +00:00
|
|
|
|
if (AutoWrap (tty)
|
Bugfix festival.
lib-src/emacsclient.c (main_argc, main_argv): New variables.
(main): Initialize them.
(fail): Use them.
(window_change, copy_from_to): Don't kill if emacs_pid is zero.
(pty_conversation): Watch the command socket, too. Read emacs_pid
here. Emacs and emacsclient could deadlock if Emacs tried to do a
reset_sys_modes before sending its pid.
lisp/server.el: Automatically delete the client frame when done editing.
(server-frames): New variable.
(server-process-filter, server-sentinel, server-buffer-done): Use it.
(server-process-filter): Do a redisplay before evaluating other
parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from
messing up the system.
src/dispextern.h: Update prototypes.
src/dispnew.c (window_change_signal): Do nothing if !term_initted.
(init_display): Set the frame size from the tty data after term_init.
src/emacs.c (main): Make sure things that init_sys_modes needs are
initialized before init_display (which calls init_sys_modes now).
(sort_args): Use xfree, not free.
(shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
instead of reset_sys_modes.
src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
back to the middle of frame setup. Handle errors by making sure that
the delete_tty() called from term_init() will see and delete this
frame.
(Fdelete_frame): Kill the frame before calling delete_tty(). Fix
condition for tty deletion.
src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
terminal only.
src/lisp.h: Remove duplicate prototypes.
src/msdos.c (croak): use reset_all_sys_modes().
src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
(child_setup_tty): Reset sigio on stdin, not CURTTY().
(reset_sigio): Added fd parameter, put explicit fcntl there.
(request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
SIGIO signal, don't touch the file params. There are multiple ttys
now, and we can't disable the SIGIO from emacsclient.
(get_tty_size)[VMS]: Use tty_out instead of CURTTY().
(reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
cmgoto and tty_clear_end_of_line instead. The frame may already be
dead. Updated reset_sigio call.
src/term.c (clear_and_of_line): Separate tty-dependent stuff to
tty_clear_end_of_line() for reset_sys_modes.
(tty_clear_end_of_line): New function.
(term_init): Added frame parameter, don't use selected_frame.
Set the frame's output_data.tty value (in case there is an error
later). Set the frame size in Wcm, not in the frame. Only free the
termcap buffer if there is a termcap-related error. Call
init_sys_modes last, not first.
(deleting_tty): New variable.
(delete_tty): Use it for handling recursive calls. Free deleted tty,
except its Wcm (there is still a dangling reference somewhere).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
2003-12-29 07:16:26 +00:00
|
|
|
|
&& curY (tty) == FrameRows (tty) - 1
|
|
|
|
|
&& first_unused_hpos == FrameCols (tty))
|
1991-05-09 10:29:44 +00:00
|
|
|
|
first_unused_hpos--;
|
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
for (i = curX (tty); i < first_unused_hpos; i++)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
if (tty->termscript)
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fputc_unlocked (' ', tty->termscript);
|
|
|
|
|
fputc_unlocked (' ', tty->output);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
2003-12-27 01:12:57 +00:00
|
|
|
|
cmplus (tty, first_unused_hpos - curX (tty));
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-11 02:11:33 +00:00
|
|
|
|
/* Buffers to store the source and result of code conversion for terminal. */
|
|
|
|
|
static unsigned char *encode_terminal_src;
|
|
|
|
|
static unsigned char *encode_terminal_dst;
|
|
|
|
|
/* Allocated sizes of the above buffers. */
|
2011-07-29 01:22:19 +00:00
|
|
|
|
static ptrdiff_t encode_terminal_src_size;
|
|
|
|
|
static ptrdiff_t encode_terminal_dst_size;
|
2004-12-11 02:11:33 +00:00
|
|
|
|
|
|
|
|
|
/* Encode SRC_LEN glyphs starting at SRC to terminal output codes.
|
|
|
|
|
Set CODING->produced to the byte-length of the resulting byte
|
|
|
|
|
sequence, and return a pointer to that byte sequence. */
|
|
|
|
|
|
2011-03-11 09:41:56 +00:00
|
|
|
|
unsigned char *
|
2013-10-17 06:42:21 +00:00
|
|
|
|
encode_terminal_code (struct glyph *src, int src_len,
|
|
|
|
|
struct coding_system *coding)
|
1997-02-20 06:57:21 +00:00
|
|
|
|
{
|
2005-10-20 15:03:58 +00:00
|
|
|
|
struct glyph *src_end = src + src_len;
|
2004-12-11 02:11:33 +00:00
|
|
|
|
unsigned char *buf;
|
2011-07-29 01:22:19 +00:00
|
|
|
|
ptrdiff_t nchars, nbytes, required;
|
|
|
|
|
ptrdiff_t tlen = GLYPH_TABLE_LENGTH;
|
1997-02-20 06:57:21 +00:00
|
|
|
|
register Lisp_Object *tbase = GLYPH_TABLE_BASE;
|
2004-12-11 02:11:33 +00:00
|
|
|
|
Lisp_Object charset_list;
|
2003-10-02 12:39:47 +00:00
|
|
|
|
|
2004-12-11 02:11:33 +00:00
|
|
|
|
/* Allocate sufficient size of buffer to store all characters in
|
|
|
|
|
multibyte-form. But, it may be enlarged on demand if
|
2006-10-26 12:00:50 +00:00
|
|
|
|
Vglyph_table contains a string or a composite glyph is
|
|
|
|
|
encountered. */
|
Use INT_ADD_WRAPV etc. to check integer overflow
* src/alloc.c (xnmalloc, xnrealloc, xpalloc, Fmake_string):
* src/buffer.c (record_overlay_string, overlay_strings):
* src/casefiddle.c (casify_object):
* src/ccl.c (Fccl_execute_on_string):
* src/character.c (char_width, c_string_width, lisp_string_width)
(count_size_as_multibyte, string_escape_byte8):
* src/coding.c (coding_alloc_by_realloc, produce_chars):
* src/data.c (arith_driver):
* src/dispnew.c (realloc_glyph_pool, init_display):
* src/editfns.c (styled_format):
* src/fns.c (Ffillarray):
* src/ftfont.c (ftfont_shape_by_flt):
* src/gnutls.c (gnutls_hex_string):
* src/gtkutil.c (get_utf8_string):
* src/image.c (x_to_xcolors, x_detect_edges, png_load_body):
* src/keymap.c (Fkey_description):
* src/lisp.h (SAFE_ALLOCA_LISP):
* src/term.c (encode_terminal_code):
* src/tparam.c (tparam1):
* src/xselect.c (x_property_data_to_lisp):
* src/xsmfns.c (smc_save_yourself_CB):
* src/xterm.c (x_term_init):
When checking for integer overflow, prefer INT_MULTIPLY_WRAPV to
more-complicated code involving division and/or
INT_MULTIPLY_OVERFLOW, and similarly for INT_ADD_WRAPV and
subtraction and/or INT_ADD_OVERFLOW.
* src/casefiddle.c (casify_object): Simplify multibyte size check.
* src/character.c: Remove some obsolete ‘#ifdef emacs’s.
* src/data.c (arith_driver): Also check for division overflow,
as that’s now possible given that the accumulator can now contain
any Emacs integer.
* src/lisp.h (lisp_word_count): Remove; no longer used.
2015-11-09 06:47:01 +00:00
|
|
|
|
if (INT_MULTIPLY_WRAPV (src_len, MAX_MULTIBYTE_LENGTH, &required))
|
2011-07-29 01:22:19 +00:00
|
|
|
|
memory_full (SIZE_MAX);
|
2004-12-11 02:11:33 +00:00
|
|
|
|
if (encode_terminal_src_size < required)
|
2015-11-08 07:52:17 +00:00
|
|
|
|
encode_terminal_src = xpalloc (encode_terminal_src,
|
|
|
|
|
&encode_terminal_src_size,
|
|
|
|
|
required - encode_terminal_src_size,
|
|
|
|
|
-1, sizeof *encode_terminal_src);
|
1998-01-22 01:26:45 +00:00
|
|
|
|
|
2004-12-11 02:11:33 +00:00
|
|
|
|
charset_list = coding_charset_list (coding);
|
1997-02-20 06:57:21 +00:00
|
|
|
|
|
2004-12-11 02:11:33 +00:00
|
|
|
|
buf = encode_terminal_src;
|
|
|
|
|
nchars = 0;
|
|
|
|
|
while (src < src_end)
|
1997-02-20 06:57:21 +00:00
|
|
|
|
{
|
2006-10-26 12:00:50 +00:00
|
|
|
|
if (src->type == COMPOSITE_GLYPH)
|
|
|
|
|
{
|
2016-06-08 17:33:34 +00:00
|
|
|
|
struct composition *cmp UNINIT;
|
|
|
|
|
Lisp_Object gstring UNINIT;
|
2006-10-26 12:00:50 +00:00
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
nbytes = buf - encode_terminal_src;
|
2008-08-29 07:57:13 +00:00
|
|
|
|
if (src->u.cmp.automatic)
|
|
|
|
|
{
|
|
|
|
|
gstring = composition_gstring_from_id (src->u.cmp.id);
|
2011-07-29 01:22:19 +00:00
|
|
|
|
required = src->slice.cmp.to - src->slice.cmp.from + 1;
|
2008-08-29 07:57:13 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cmp = composition_table[src->u.cmp.id];
|
2011-07-29 01:22:19 +00:00
|
|
|
|
required = cmp->glyph_len;
|
|
|
|
|
required *= MAX_MULTIBYTE_LENGTH;
|
2008-08-29 07:57:13 +00:00
|
|
|
|
}
|
2006-10-26 12:00:50 +00:00
|
|
|
|
|
2011-07-29 01:22:19 +00:00
|
|
|
|
if (encode_terminal_src_size - nbytes < required)
|
2006-10-26 12:00:50 +00:00
|
|
|
|
{
|
2011-08-05 02:15:35 +00:00
|
|
|
|
encode_terminal_src =
|
|
|
|
|
xpalloc (encode_terminal_src, &encode_terminal_src_size,
|
|
|
|
|
required - (encode_terminal_src_size - nbytes),
|
|
|
|
|
-1, 1);
|
2006-10-26 12:00:50 +00:00
|
|
|
|
buf = encode_terminal_src + nbytes;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-29 07:57:13 +00:00
|
|
|
|
if (src->u.cmp.automatic)
|
2010-09-27 05:27:28 +00:00
|
|
|
|
for (i = src->slice.cmp.from; i <= src->slice.cmp.to; i++)
|
2008-08-29 07:57:13 +00:00
|
|
|
|
{
|
|
|
|
|
Lisp_Object g = LGSTRING_GLYPH (gstring, i);
|
|
|
|
|
int c = LGLYPH_CHAR (g);
|
|
|
|
|
|
|
|
|
|
if (! char_charset (c, charset_list, NULL))
|
2009-02-04 01:35:16 +00:00
|
|
|
|
c = '?';
|
2008-08-29 07:57:13 +00:00
|
|
|
|
buf += CHAR_STRING (c, buf);
|
|
|
|
|
nchars++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
for (i = 0; i < cmp->glyph_len; i++)
|
|
|
|
|
{
|
|
|
|
|
int c = COMPOSITION_GLYPH (cmp, i);
|
|
|
|
|
|
2011-09-15 16:22:58 +00:00
|
|
|
|
/* TAB in a composition means display glyphs with
|
|
|
|
|
padding space on the left or right. */
|
2009-02-04 01:35:16 +00:00
|
|
|
|
if (c == '\t')
|
|
|
|
|
continue;
|
|
|
|
|
if (char_charset (c, charset_list, NULL))
|
|
|
|
|
{
|
2016-09-13 22:29:26 +00:00
|
|
|
|
if (CHARACTER_WIDTH (c) == 0
|
2009-02-04 01:35:16 +00:00
|
|
|
|
&& i > 0 && COMPOSITION_GLYPH (cmp, i - 1) == '\t')
|
|
|
|
|
/* Should be left-padded */
|
|
|
|
|
{
|
|
|
|
|
buf += CHAR_STRING (' ', buf);
|
|
|
|
|
nchars++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
c = '?';
|
2008-08-29 07:57:13 +00:00
|
|
|
|
buf += CHAR_STRING (c, buf);
|
|
|
|
|
nchars++;
|
|
|
|
|
}
|
2006-10-26 12:00:50 +00:00
|
|
|
|
}
|
1997-02-20 06:57:21 +00:00
|
|
|
|
/* We must skip glyphs to be padded for a wide character. */
|
2006-10-26 12:00:50 +00:00
|
|
|
|
else if (! CHAR_GLYPH_PADDING_P (*src))
|
1997-02-20 06:57:21 +00:00
|
|
|
|
{
|
2008-02-27 22:49:29 +00:00
|
|
|
|
GLYPH g;
|
2016-06-08 17:33:34 +00:00
|
|
|
|
int c UNINIT;
|
2004-12-11 02:11:33 +00:00
|
|
|
|
Lisp_Object string;
|
|
|
|
|
|
2003-10-01 04:43:53 +00:00
|
|
|
|
string = Qnil;
|
2008-02-27 22:49:29 +00:00
|
|
|
|
SET_GLYPH_FROM_CHAR_GLYPH (g, src[0]);
|
1999-12-27 05:07:56 +00:00
|
|
|
|
|
2008-02-27 22:49:29 +00:00
|
|
|
|
if (GLYPH_INVALID_P (g) || GLYPH_SIMPLE_P (tbase, tlen, g))
|
2004-12-11 02:11:33 +00:00
|
|
|
|
{
|
2008-09-27 10:50:48 +00:00
|
|
|
|
/* This glyph doesn't have an entry in Vglyph_table. */
|
2004-12-11 02:11:33 +00:00
|
|
|
|
c = src->u.ch;
|
|
|
|
|
}
|
1999-12-27 05:07:56 +00:00
|
|
|
|
else
|
1997-02-20 06:57:21 +00:00
|
|
|
|
{
|
1999-12-27 05:07:56 +00:00
|
|
|
|
/* This glyph has an entry in Vglyph_table,
|
1997-02-20 06:57:21 +00:00
|
|
|
|
so process any alias before testing for simpleness. */
|
|
|
|
|
GLYPH_FOLLOW_ALIASES (tbase, tlen, g);
|
1999-12-27 05:07:56 +00:00
|
|
|
|
|
|
|
|
|
if (GLYPH_SIMPLE_P (tbase, tlen, g))
|
2003-10-01 04:43:53 +00:00
|
|
|
|
/* We set the multi-byte form of a character in G
|
|
|
|
|
(that should be an ASCII character) at WORKBUF. */
|
2008-02-27 22:49:29 +00:00
|
|
|
|
c = GLYPH_CHAR (g);
|
1999-12-27 05:07:56 +00:00
|
|
|
|
else
|
2003-10-01 04:43:53 +00:00
|
|
|
|
/* We have a string in Vglyph_table. */
|
2008-02-27 22:49:29 +00:00
|
|
|
|
string = tbase[GLYPH_CHAR (g)];
|
1997-07-30 03:57:26 +00:00
|
|
|
|
}
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2003-10-01 04:43:53 +00:00
|
|
|
|
if (NILP (string))
|
1998-09-28 11:52:53 +00:00
|
|
|
|
{
|
2006-10-26 12:00:50 +00:00
|
|
|
|
nbytes = buf - encode_terminal_src;
|
2011-07-29 01:22:19 +00:00
|
|
|
|
if (encode_terminal_src_size - nbytes < MAX_MULTIBYTE_LENGTH)
|
2006-10-26 12:00:50 +00:00
|
|
|
|
{
|
2011-08-05 02:15:35 +00:00
|
|
|
|
encode_terminal_src =
|
|
|
|
|
xpalloc (encode_terminal_src, &encode_terminal_src_size,
|
|
|
|
|
MAX_MULTIBYTE_LENGTH, -1, 1);
|
2006-10-26 12:00:50 +00:00
|
|
|
|
buf = encode_terminal_src + nbytes;
|
|
|
|
|
}
|
2010-08-31 07:49:21 +00:00
|
|
|
|
if (CHAR_BYTE8_P (c)
|
|
|
|
|
|| char_charset (c, charset_list, NULL))
|
2003-10-02 12:39:47 +00:00
|
|
|
|
{
|
2004-12-11 02:11:33 +00:00
|
|
|
|
/* Store the multibyte form of C at BUF. */
|
|
|
|
|
buf += CHAR_STRING (c, buf);
|
|
|
|
|
nchars++;
|
2003-10-02 12:39:47 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-12-11 02:11:33 +00:00
|
|
|
|
/* C is not encodable. */
|
|
|
|
|
*buf++ = '?';
|
2003-10-02 12:39:47 +00:00
|
|
|
|
nchars++;
|
2004-12-11 02:11:33 +00:00
|
|
|
|
while (src + 1 < src_end && CHAR_GLYPH_PADDING_P (src[1]))
|
|
|
|
|
{
|
|
|
|
|
*buf++ = '?';
|
|
|
|
|
nchars++;
|
|
|
|
|
src++;
|
|
|
|
|
}
|
2003-10-02 12:39:47 +00:00
|
|
|
|
}
|
2003-10-01 04:43:53 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-12-11 02:11:33 +00:00
|
|
|
|
if (! STRING_MULTIBYTE (string))
|
|
|
|
|
string = string_to_multibyte (string);
|
|
|
|
|
nbytes = buf - encode_terminal_src;
|
2011-07-29 01:22:19 +00:00
|
|
|
|
if (encode_terminal_src_size - nbytes < SBYTES (string))
|
2003-10-01 04:43:53 +00:00
|
|
|
|
{
|
2011-08-05 02:15:35 +00:00
|
|
|
|
encode_terminal_src =
|
|
|
|
|
xpalloc (encode_terminal_src, &encode_terminal_src_size,
|
|
|
|
|
(SBYTES (string)
|
|
|
|
|
- (encode_terminal_src_size - nbytes)),
|
|
|
|
|
-1, 1);
|
2004-12-11 02:11:33 +00:00
|
|
|
|
buf = encode_terminal_src + nbytes;
|
2003-10-01 04:43:53 +00:00
|
|
|
|
}
|
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
* alloc.c (overrun_check_malloc, overrun_check_realloc)
(overrun_check_free, xstrdup, allocate_string)
(allocate_string_data, compact_small_strings, Fmake_string)
(make_unibyte_string, make_multibyte_string)
(make_string_from_bytes, make_specified_string, make_float)
(Fcons, allocate_terminal, allocate_frame, make_pure_string)
(Fgarbage_collect): Replace bcopy, safe_bcopy, bzero, bcmp by
memcpy, memmove, memset, memcmp.
* atimer.c (start_atimer, set_alarm): Likewise.
* buffer.c (clone_per_buffer_values, report_overlay_modification)
(mmap_realloc, init_buffer_once): Likewise.
* callint.c (Fcall_interactively): Likewise.
* callproc.c (Fcall_process, Fcall_process_region, child_setup)
(getenv_internal_1): Likewise.
* casefiddle.c (casify_object): Likewise.
* ccl.c (ccl_driver): Likewise.
* character.c (str_as_multibyte, str_to_multibyte): Likewise.
* charset.c (load_charset_map_from_file)
(load_charset_map_from_file, load_charset_map_from_vector)
(Fdefine_charset_internal): Likewise.
* cm.c (Wcm_clear): Likewise.
* coding.c (decode_eol, decode_coding_object)
(Fset_coding_system_priority, make_subsidiaries): Likewise.
* data.c (Faset): Likewise.
* dired.c (directory_files_internal, file_name_completion_stat):
Likewise.
* dispnew.c (new_glyph_matrix, adjust_glyph_matrix)
(clear_glyph_row, copy_row_except_pointers)
(copy_glyph_row_contents, new_glyph_pool, realloc_glyph_pool)
(save_current_matrix, restore_current_matrix)
(build_frame_matrix_from_leaf_window, mirrored_line_dance)
(mirror_line_dance, scrolling_window): Likewise.
* doc.c (Fsnarf_documentation, Fsubstitute_command_keys):
Likewise.
* doprnt.c (doprnt): Likewise.
* editfns.c (Fuser_full_name, make_buffer_string_both)
(Fmessage_box, Fformat, Ftranspose_regions): Likewise.
* emacs.c (sort_args): Likewise.
* eval.c (Fapply, Ffuncall): Likewise.
* fileio.c (Ffile_name_directory, make_temp_name)
(Fexpand_file_name, search_embedded_absfilename)
(Fsubstitute_in_file_name, Ffile_symlink_p, Finsert_file_contents)
(auto_save_error): Likewise.
* fns.c (Fstring_equal, Fcopy_sequence, concat)
(string_to_multibyte, Fstring_as_unibyte, Fstring_as_multibyte)
(internal_equal, Fclear_string, larger_vector, copy_hash_table)
(Fmake_hash_table): Likewise.
* fringe.c (Fdefine_fringe_bitmap): Likewise.
* ftfont.c (ftfont_text_extents): Likewise.
* getloadavg.c (getloadavg): Likewise.
* image.c (define_image_type, make_image, make_image_cache)
(x_create_x_image_and_pixmap, xbm_image_p)
(w32_create_pixmap_from_bitmap_data, xbm_load, xpm_lookup_color)
(xpm_image_p, x_create_bitmap_from_xpm_data, xpm_load)
(init_color_table, x_build_heuristic_mask, pbm_image_p, pbm_load)
(png_image_p, png_read_from_memory, png_load, jpeg_image_p)
(tiff_image_p, tiff_read_from_memory, gif_image_p)
(gif_read_from_memory, gif_load, svg_image_p, gs_image_p):
Likewise.
* indent.c (scan_for_column, compute_motion): Likewise.
* insdel.c (gap_left, gap_right, make_gap_smaller, copy_text)
(insert_1_both, insert_from_gap, replace_range_2): Likewise.
* intervals.c (reproduce_tree, reproduce_tree_obj): Likewise.
* keyboard.c (echo_char, save_getcjmp, restore_getcjmp)
(kbd_buffer_store_event_hold, apply_modifiers_uncached)
(store_user_signal_events, menu_bar_items, tool_bar_items)
(process_tool_bar_item, append_tool_bar_item)
(read_char_minibuf_menu_prompt, read_key_sequence)
(Fread_key_sequence, Fread_key_sequence_vector, Frecent_keys):
Likewise.
* keymap.c (current_minor_maps, Fdescribe_buffer_bindings):
Likewise.
* lisp.h (STRING_COPYIN): Likewise.
* lread.c (Fload, read1, oblookup): Likewise.
* msdos.c (Frecent_doskeys): Likewise.
* nsfns.m (Fx_create_frame): Likewise.
* nsfont.m (nsfont_open, nsfont_text_extents, ns_glyph_metrics):
Likewise.
* nsimage.m (EmacsImage-initFromSkipXBM:width:height:)
(EmacsImage-initForXPMWithDepth:width:height:flip:length:):
Likewise.
* nsmenu.m (ns_update_menubar): Likewise.
* nsterm.m (ns_draw_fringe_bitmap, ns_term_init): Likewise.
* print.c (print_unwind, printchar, strout, print_string)
(print_error_message): Likewise.
* process.c (conv_lisp_to_sockaddr, set_socket_option)
(Fmake_network_process, Fnetwork_interface_list)
(Fnetwork_interface_info, read_process_output, Fprocess_send_eof)
(init_process): Likewise.
* ralloc.c (resize_bloc, r_alloc_sbrk, r_alloc_init): Likewise.
* regex.c (init_syntax_once, regex_compile, re_compile_fastmap):
Likewise.
* scroll.c (do_scrolling, do_direct_scrolling)
(scrolling_max_lines_saved): Likewise.
* search.c (search_buffer, wordify, Freplace_match): Likewise.
* sound.c (wav_init, au_init, Fplay_sound_internal): Likewise.
* syntax.c (skip_chars, skip_syntaxes): Likewise.
* sysdep.c (child_setup_tty, sys_subshell, emacs_get_tty)
(emacs_set_tty): Likewise.
* term.c (encode_terminal_code, calculate_costs)
(produce_special_glyphs, create_tty_output, init_tty, delete_tty):
Likewise.
* termcap.c (tgetst1, gobble_line): Likewise.
* termhooks.h (EVENT_INIT): Likewise.
* tparam.c (tparam1): Likewise.
* unexalpha.c (unexec): Likewise.
* unexec.c (write_segment): Likewise.
* unexmacosx.c (unexec_write_zero): Likewise.
* w32fns.c (w32_wnd_proc, Fx_create_frame, x_create_tip_frame)
(Fx_file_dialog, Fsystem_move_file_to_trash): Likewise.
* w32font.c (w32font_list_family, w32font_text_extents)
(w32font_list_internal, w32font_match_internal)
(w32font_open_internal, compute_metrics, Fx_select_font):
Likewise.
* w32menu.c (set_frame_menubar, add_menu_item)
(w32_menu_display_help, w32_free_submenu_strings): Likewise.
* w32term.c (XCreateGC, w32_initialize_display_info): Likewise.
* w32uniscribe.c (uniscribe_list_family): Likewise.
* w32xfns.c (get_next_msg, post_msg, prepend_msg): Likewise.
* window.c (make_window, replace_window, set_window_buffer)
(Fsplit_window): Likewise.
* xdisp.c (init_iterator, RECORD_OVERLAY_STRING, reseat_to_string)
(add_to_log, message3, x_consider_frame_title)
(append_space_for_newline, extend_face_to_end_of_line)
(decode_mode_spec_coding, init_glyph_string): Likewise.
* xfaces.c (x_create_gc, get_lface_attributes_no_remap)
(Finternal_copy_lisp_face, Finternal_merge_in_global_face)
(face_attr_equal_p, make_realized_face, make_face_cache)
(free_realized_faces, lookup_named_face, smaller_face)
(face_with_height, lookup_derived_face)
(x_supports_face_attributes_p, Finternal_set_font_selection_order)
(Finternal_set_font_selection_order, realize_default_face)
(compute_char_face, face_at_buffer_position)
(face_for_overlay_string, face_at_string_position, merge_faces):
Likewise.
* xfns.c (xic_create_fontsetname, Fx_create_frame)
(Fx_window_property, x_create_tip_frame)
(Fx_backspace_delete_keys_p): Likewise.
* xfont.c (xfont_list, xfont_match, xfont_list_family)
(xfont_text_extents): Likewise.
* xmenu.c (set_frame_menubar, xmenu_show): Likewise.
* xrdb.c (magic_file_p, x_get_resource): Likewise.
* xselect.c (x_queue_event, x_get_window_property)
(receive_incremental_selection): Likewise.
* xsmfns.c (x_session_check_input): Likewise.
* xterm.c (x_send_scroll_bar_event, SET_SAVED_MENU_EVENT)
(handle_one_xevent, x_check_errors, xim_initialize, x_term_init):
Likewise.
* character.h (BCOPY_SHORT): Removed.
* config.in: Regenerate.
* dispnew.c (safe_bcopy): Only define as dummy if PROFILING.
* emacs.c (main) [PROFILING]: Don't declare
dump_opcode_frequencies.
* lisp.h (safe_bcopy): Remove declaration.
(memset) [!HAVE_MEMSET]: Declare.
(memcpy) [!HAVE_MEMCPY]: Likewise.
(memmove) [!HAVE_MEMMOVE]: Likewise.
(memcmp) [!HAVE_MEMCMP]: Likewise.
* s/ms-w32.h (bzero, bcopy, bcmp, GAP_USE_BCOPY)
(BCOPY_UPWARD_SAFE, BCOPY_DOWNWARD_SAFE, HAVE_BCOPY, HAVE_BCMP):
Don't define.
(HAVE_MEMCMP, HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET): Define.
* s/msdos.h (GAP_USE_BCOPY, BCOPY_UPWARD_SAFE)
(BCOPY_DOWNWARD_SAFE): Don't define.
* sysdep.c (memset) [!HAVE_MEMSET]: Define.
(memcpy) [!HAVE_MEMCPY]: Define.
(memmove) [!HAVE_MEMMOVE]: Define.
(memcmp) [!HAVE_MEMCMP]: Define.
* config.nt (HAVE_BCOPY, HAVE_BCMP): Remove undefs.
(HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET, HAVE_MEMCMP): Add undefs.
* sed2v2.inp (HAVE_MEMCPY, HAVE_MEMSET): Edit to 1.
(HAVE_BZERO): Don't edit.
* lwlib.c (lwlib_memset, lwlib_bcopy): Remove.
(malloc_widget_value, free_widget_info, allocate_widget_instance)
(lw_separator_p): Replace lwlib_memset, lwlib_bcopy, bzero, bcmp by
memset, memcpy, memcmp.
* lwlib-utils.c (XtApplyToWidgets): Likewise.
* xlwmenu.c (XlwMenuInitialize): Likewise.
* lwlib.h (lwlib_bcopy): Remove declaration.
* ebrowse.c (add_sym, make_namespace): Replace bcopy, bzero by
memcpy, memmove, memset.
* pop.c (pop_retrieve, socket_connection, pop_getline): Likewise.
* CPP-DEFINES (BCOPY_DOWNWARD_SAFE, BCOPY_UPWARD_SAFE)
(GAP_USE_BCOPY, HAVE_BCMP, HAVE_BCOPY, bcmp, bcopy, bzero):
Remove.
* configure.in: Don't check for bcopy, bcmp, bzero. Don't include
<strings.h> and don't define bcopy, bzero, BCMP in config.h.
2010-07-07 22:18:28 +00:00
|
|
|
|
memcpy (buf, SDATA (string), SBYTES (string));
|
2004-12-11 02:11:33 +00:00
|
|
|
|
buf += SBYTES (string);
|
|
|
|
|
nchars += SCHARS (string);
|
1998-09-28 11:52:53 +00:00
|
|
|
|
}
|
1997-02-20 06:57:21 +00:00
|
|
|
|
}
|
2004-12-11 02:11:33 +00:00
|
|
|
|
src++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (nchars == 0)
|
|
|
|
|
{
|
|
|
|
|
coding->produced = 0;
|
|
|
|
|
return NULL;
|
1997-02-20 06:57:21 +00:00
|
|
|
|
}
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2004-12-11 02:11:33 +00:00
|
|
|
|
nbytes = buf - encode_terminal_src;
|
|
|
|
|
coding->source = encode_terminal_src;
|
|
|
|
|
if (encode_terminal_dst_size == 0)
|
2003-10-01 04:43:53 +00:00
|
|
|
|
{
|
2011-07-29 01:22:19 +00:00
|
|
|
|
encode_terminal_dst = xrealloc (encode_terminal_dst,
|
|
|
|
|
encode_terminal_src_size);
|
2004-12-11 02:11:33 +00:00
|
|
|
|
encode_terminal_dst_size = encode_terminal_src_size;
|
2003-10-01 04:43:53 +00:00
|
|
|
|
}
|
2004-12-11 02:11:33 +00:00
|
|
|
|
coding->destination = encode_terminal_dst;
|
|
|
|
|
coding->dst_bytes = encode_terminal_dst_size;
|
|
|
|
|
encode_coding_object (coding, Qnil, 0, 0, nchars, nbytes, Qnil);
|
2003-10-02 12:39:47 +00:00
|
|
|
|
/* coding->destination may have been reallocated. */
|
2004-12-11 02:11:33 +00:00
|
|
|
|
encode_terminal_dst = coding->destination;
|
|
|
|
|
encode_terminal_dst_size = coding->dst_bytes;
|
2003-10-01 04:43:53 +00:00
|
|
|
|
|
2004-12-11 02:11:33 +00:00
|
|
|
|
return (encode_terminal_dst);
|
1997-02-20 06:57:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2007-10-11 16:24:58 +00:00
|
|
|
|
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
/* An implementation of write_glyphs for termcap frames. */
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
tty_write_glyphs (struct frame *f, struct glyph *string, int len)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
2004-12-11 02:11:33 +00:00
|
|
|
|
unsigned char *conversion_buffer;
|
|
|
|
|
struct coding_system *coding;
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
int n, stringlen;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_insert (tty);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty_hide_cursor (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
/* Don't dare write in last column of bottom line, if Auto-Wrap,
|
1992-07-13 20:53:59 +00:00
|
|
|
|
since that would scroll the whole frame on some terminals. */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
if (AutoWrap (tty)
|
2014-08-10 08:26:28 +00:00
|
|
|
|
&& curY (tty) + 1 == FRAME_TOTAL_LINES (f)
|
2003-12-27 01:12:57 +00:00
|
|
|
|
&& (curX (tty) + len) == FRAME_COLS (f))
|
1991-05-09 10:29:44 +00:00
|
|
|
|
len --;
|
1997-02-20 06:57:21 +00:00
|
|
|
|
if (len <= 0)
|
|
|
|
|
return;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
cmplus (tty, len);
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2004-11-30 08:19:32 +00:00
|
|
|
|
/* If terminal_coding does any conversion, use it, otherwise use
|
|
|
|
|
safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here
|
|
|
|
|
because it always return 1 if the member src_multibyte is 1. */
|
2004-12-08 22:20:27 +00:00
|
|
|
|
coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK
|
|
|
|
|
? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
|
1998-01-22 01:26:45 +00:00
|
|
|
|
/* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
|
|
|
|
|
the tail. */
|
2004-11-30 08:19:32 +00:00
|
|
|
|
coding->mode &= ~CODING_MODE_LAST_BLOCK;
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2011-04-01 17:34:25 +00:00
|
|
|
|
for (stringlen = len; stringlen != 0; stringlen -= n)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
/* Identify a run of glyphs with the same face. */
|
1999-12-27 05:07:56 +00:00
|
|
|
|
int face_id = string->face_id;
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2011-04-01 17:34:25 +00:00
|
|
|
|
for (n = 1; n < stringlen; ++n)
|
1999-12-27 05:07:56 +00:00
|
|
|
|
if (string[n].face_id != face_id)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* Turn appearance modes of the face of the run on. */
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_highlight_if_desired (tty);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
turn_on_face (f, face_id);
|
|
|
|
|
|
2011-04-01 17:34:25 +00:00
|
|
|
|
if (n == stringlen)
|
2004-12-11 02:11:33 +00:00
|
|
|
|
/* This is the last run. */
|
|
|
|
|
coding->mode |= CODING_MODE_LAST_BLOCK;
|
|
|
|
|
conversion_buffer = encode_terminal_code (string, n, coding);
|
|
|
|
|
if (coding->produced > 0)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Simplify and avoid signal-handling races.
* nt/inc/ms-w32.h (emacs_raise): New macro.
* src/alloc.c (die):
* src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
Avoid recursive loop if there's a fatal error in the function itself.
* src/atimer.c (pending_atimers):
* src/blockinput.h: Don't include "atimer.h"; no longer needed.
(interrupt_input_pending): Remove. All uses removed.
pending_signals now counts both atimers and ordinary interrupts.
This is less racy than having three separate pending-signal flags.
(block_input, unblock_input, totally_unblock_input, unblock_input_to)
(input_blocked_p):
Rename from their upper-case counterparts BLOCK_INPUT,
UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
INPUT_BLOCKED_P, and turn into functions. All uses changed.
This makes it easier to access volatile variables more accurately.
(BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
(input_blocked_p): Prefer this to 'interrupt_input_blocked', as
that's more reliable if the code is buggy and sets
interrupt_input_blocked to a negative value. All uses changed.
* src/atimer.c (deliver_alarm_signal):
Remove. No need to deliver this to the parent; any thread can
handle this signal now. All uses replaced by underlying handler.
* src/atimer.c (turn_on_atimers):
* src/dispnew.c (handle_window_change_signal):
* src/emacs.c (handle_danger_signal):
* src/keyboard.c (kbd_buffer_get_event):
Don't reestablish signal handler; not needed with sigaction.
* src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
(UNBLOCK_INPUT_TO):
Rework to avoid unnecessary accesses to volatile variables.
(UNBLOCK_INPUT_TO): Now a function.
(totally_unblock_input, unblock_input): New decls.
* src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
(init_data): Remove. Necessary stuff now done in init_signal.
* src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
* src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
(fatal_error_code): Remove; no longer needed.
(terminate_due_to_signal): Rename from fatal_error_backtrace, since
it doesn't always backtrace. All uses changed. No need to reset
signal to default, since sigaction and/or die does that for us now.
Use emacs_raise (FOO), not kill (getpid (), FOO).
(main): Check more-accurately whether we're dumping.
Move fatal-error setup to sysdep.c
* src/floatfns.c: Do not include "syssignal.h"; no longer needed.
* src/gtkutil.c (xg_get_file_name, xg_get_font):
Remove no-longer-needed signal-mask manipulation.
* src/keyboard.c, src/process.c (POLL_FOR_INPUT):
Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
* src/keyboard.c (read_avail_input): Remove.
All uses replaced by gobble_input.
(Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
(kbd_buffer_store_event_hold, gobble_input):
(record_asynch_buffer_change) [USABLE_SIGIO]:
(store_user_signal_events):
No need to mess with signal mask.
(gobble_input): If blocking input and there are terminals, simply
set pending_signals to 1 and return. All hooks changed to not
worry about whether input is blocked.
(process_pending_signals): Clear pending_signals before processing
them, in case a signal comes in while we're processing.
By convention callers now test pending_signals before calling us.
(UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
New functions, to support changes to blockinput.h.
(handle_input_available_signal): Now extern.
(reinvoke_input_signal): Remove. All uses replaced by
handle_async_input.
(quit_count): Now volatile, since a signal handler uses it.
(handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All
callers changed. Block SIGINT only if not already blocked.
Clear sigmask reliably, even if Fsignal returns, which it can.
Omit unnecessary accesses to volatile var.
(quit_throw_to_read_char): No need to restore sigmask.
* src/keyboard.c (gobble_input, handle_user_signal):
* src/process.c (wait_reading_process_output):
Call signal-handling code rather than killing ourselves.
* src/lisp.h: Include <float.h>, for...
(IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
(pending_signals): Now volatile.
(syms_of_data): Now const if IEEE floating point.
(handle_input_available_signal) [USABLE_SIGIO]:
(terminate_due_to_signal, record_child_status_change): New decls.
* src/process.c (create_process): Avoid disaster if memory is exhausted
while we're processing a vfork, by tightening the critical section
around the vfork.
(send_process_frame, process_sent_to, handle_pipe_signal)
(deliver_pipe_signal): Remove. No longer needed, as Emacs now
ignores SIGPIPE.
(send_process): No need for setjmp/longjmp any more, since the
SIGPIPE stuff is now gone. Instead, report an error if errno
is EPIPE.
(record_child_status_change): Now extern. PID and W are now args.
Return void, not bool. All callers changed.
* src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
Remove. All uses removed. This bug should be fixed now in a
different way.
(wait_for_termination_1): Use waitpid rather than sigsuspend,
and record the child status change directly. This avoids the
need to futz with the signal mask.
(process_fatal_action): Move here from emacs.c.
(emacs_sigaction_flags): New function, containing
much of what used to be in emacs_sigaction_init.
(emacs_sigaction_init): Use it. Block nonfatal system signals that are
caught by emacs, to make races less likely.
(deliver_process_signal): Rename from handle_on_main_thread.
All uses changed.
(BACKTRACE_LIMIT_MAX): Now at top level.
(thread_backtrace_buffer, threadback_backtrace_pointers):
New static vars.
(deliver_thread_signal, deliver_fatal_thread_signal):
New functions, for more-accurate delivery of thread-specific signals.
(handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
(deliver_arith_signal): Handle in this thread, not
in the main thread, since it's triggered by this thread.
(maybe_fatal_sig): New function.
(init_signals): New arg DUMPING so that we can be more accurate
about whether we're dumping. Caller changed.
Treat thread-specific signals differently from process-general signals.
Block all signals while handling fatal error; that's safer.
xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
on IEEE hosts.
When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
Ignore SIGPIPE unless batch.
(emacs_backtrace): Output backtrace for the appropriate thread,
which is not necessarily the main thread.
* src/syssignal.h: Include <stdbool.h>.
(emacs_raise): New macro.
* src/xterm.c (x_connection_signal): Remove; no longer needed
now that we use sigaction.
(x_connection_closed): No need to mess with sigmask now.
(x_initialize): No need to reset SIGPIPE handler here, since
init_signals does this for us now.
Fixes: debbugs:12471
2012-09-23 08:44:20 +00:00
|
|
|
|
block_input ();
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fwrite_unlocked (conversion_buffer, 1, coding->produced, tty->output);
|
|
|
|
|
clearerr_unlocked (tty->output);
|
2004-12-08 22:20:27 +00:00
|
|
|
|
if (tty->termscript)
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fwrite_unlocked (conversion_buffer, 1, coding->produced,
|
|
|
|
|
tty->termscript);
|
Simplify and avoid signal-handling races.
* nt/inc/ms-w32.h (emacs_raise): New macro.
* src/alloc.c (die):
* src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
Avoid recursive loop if there's a fatal error in the function itself.
* src/atimer.c (pending_atimers):
* src/blockinput.h: Don't include "atimer.h"; no longer needed.
(interrupt_input_pending): Remove. All uses removed.
pending_signals now counts both atimers and ordinary interrupts.
This is less racy than having three separate pending-signal flags.
(block_input, unblock_input, totally_unblock_input, unblock_input_to)
(input_blocked_p):
Rename from their upper-case counterparts BLOCK_INPUT,
UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
INPUT_BLOCKED_P, and turn into functions. All uses changed.
This makes it easier to access volatile variables more accurately.
(BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
(input_blocked_p): Prefer this to 'interrupt_input_blocked', as
that's more reliable if the code is buggy and sets
interrupt_input_blocked to a negative value. All uses changed.
* src/atimer.c (deliver_alarm_signal):
Remove. No need to deliver this to the parent; any thread can
handle this signal now. All uses replaced by underlying handler.
* src/atimer.c (turn_on_atimers):
* src/dispnew.c (handle_window_change_signal):
* src/emacs.c (handle_danger_signal):
* src/keyboard.c (kbd_buffer_get_event):
Don't reestablish signal handler; not needed with sigaction.
* src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
(UNBLOCK_INPUT_TO):
Rework to avoid unnecessary accesses to volatile variables.
(UNBLOCK_INPUT_TO): Now a function.
(totally_unblock_input, unblock_input): New decls.
* src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
(init_data): Remove. Necessary stuff now done in init_signal.
* src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
* src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
(fatal_error_code): Remove; no longer needed.
(terminate_due_to_signal): Rename from fatal_error_backtrace, since
it doesn't always backtrace. All uses changed. No need to reset
signal to default, since sigaction and/or die does that for us now.
Use emacs_raise (FOO), not kill (getpid (), FOO).
(main): Check more-accurately whether we're dumping.
Move fatal-error setup to sysdep.c
* src/floatfns.c: Do not include "syssignal.h"; no longer needed.
* src/gtkutil.c (xg_get_file_name, xg_get_font):
Remove no-longer-needed signal-mask manipulation.
* src/keyboard.c, src/process.c (POLL_FOR_INPUT):
Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
* src/keyboard.c (read_avail_input): Remove.
All uses replaced by gobble_input.
(Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
(kbd_buffer_store_event_hold, gobble_input):
(record_asynch_buffer_change) [USABLE_SIGIO]:
(store_user_signal_events):
No need to mess with signal mask.
(gobble_input): If blocking input and there are terminals, simply
set pending_signals to 1 and return. All hooks changed to not
worry about whether input is blocked.
(process_pending_signals): Clear pending_signals before processing
them, in case a signal comes in while we're processing.
By convention callers now test pending_signals before calling us.
(UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
New functions, to support changes to blockinput.h.
(handle_input_available_signal): Now extern.
(reinvoke_input_signal): Remove. All uses replaced by
handle_async_input.
(quit_count): Now volatile, since a signal handler uses it.
(handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All
callers changed. Block SIGINT only if not already blocked.
Clear sigmask reliably, even if Fsignal returns, which it can.
Omit unnecessary accesses to volatile var.
(quit_throw_to_read_char): No need to restore sigmask.
* src/keyboard.c (gobble_input, handle_user_signal):
* src/process.c (wait_reading_process_output):
Call signal-handling code rather than killing ourselves.
* src/lisp.h: Include <float.h>, for...
(IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
(pending_signals): Now volatile.
(syms_of_data): Now const if IEEE floating point.
(handle_input_available_signal) [USABLE_SIGIO]:
(terminate_due_to_signal, record_child_status_change): New decls.
* src/process.c (create_process): Avoid disaster if memory is exhausted
while we're processing a vfork, by tightening the critical section
around the vfork.
(send_process_frame, process_sent_to, handle_pipe_signal)
(deliver_pipe_signal): Remove. No longer needed, as Emacs now
ignores SIGPIPE.
(send_process): No need for setjmp/longjmp any more, since the
SIGPIPE stuff is now gone. Instead, report an error if errno
is EPIPE.
(record_child_status_change): Now extern. PID and W are now args.
Return void, not bool. All callers changed.
* src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
Remove. All uses removed. This bug should be fixed now in a
different way.
(wait_for_termination_1): Use waitpid rather than sigsuspend,
and record the child status change directly. This avoids the
need to futz with the signal mask.
(process_fatal_action): Move here from emacs.c.
(emacs_sigaction_flags): New function, containing
much of what used to be in emacs_sigaction_init.
(emacs_sigaction_init): Use it. Block nonfatal system signals that are
caught by emacs, to make races less likely.
(deliver_process_signal): Rename from handle_on_main_thread.
All uses changed.
(BACKTRACE_LIMIT_MAX): Now at top level.
(thread_backtrace_buffer, threadback_backtrace_pointers):
New static vars.
(deliver_thread_signal, deliver_fatal_thread_signal):
New functions, for more-accurate delivery of thread-specific signals.
(handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
(deliver_arith_signal): Handle in this thread, not
in the main thread, since it's triggered by this thread.
(maybe_fatal_sig): New function.
(init_signals): New arg DUMPING so that we can be more accurate
about whether we're dumping. Caller changed.
Treat thread-specific signals differently from process-general signals.
Block all signals while handling fatal error; that's safer.
xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
on IEEE hosts.
When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
Ignore SIGPIPE unless batch.
(emacs_backtrace): Output backtrace for the appropriate thread,
which is not necessarily the main thread.
* src/syssignal.h: Include <stdbool.h>.
(emacs_raise): New macro.
* src/xterm.c (x_connection_signal): Remove; no longer needed
now that we use sigaction.
(x_connection_closed): No need to mess with sigmask now.
(x_initialize): No need to reset SIGPIPE handler here, since
init_signals does this for us now.
Fixes: debbugs:12471
2012-09-23 08:44:20 +00:00
|
|
|
|
unblock_input ();
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
2004-12-11 02:11:33 +00:00
|
|
|
|
string += n;
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
|
|
|
|
/* Turn appearance modes off. */
|
|
|
|
|
turn_off_face (f, face_id);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_highlight (tty);
|
1997-02-20 06:57:21 +00:00
|
|
|
|
}
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
cmcheckmagic (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-09-29 20:56:48 +00:00
|
|
|
|
#ifdef HAVE_GPM /* Only used by GPM code. */
|
|
|
|
|
|
2007-05-20 23:29:14 +00:00
|
|
|
|
static void
|
2010-07-05 10:36:06 +00:00
|
|
|
|
tty_write_glyphs_with_face (register struct frame *f, register struct glyph *string,
|
|
|
|
|
register int len, register int face_id)
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
{
|
|
|
|
|
unsigned char *conversion_buffer;
|
|
|
|
|
struct coding_system *coding;
|
|
|
|
|
|
2007-05-20 23:29:14 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
|
|
|
|
|
|
|
|
|
tty_turn_off_insert (tty);
|
|
|
|
|
tty_hide_cursor (tty);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
|
|
|
|
/* Don't dare write in last column of bottom line, if Auto-Wrap,
|
|
|
|
|
since that would scroll the whole frame on some terminals. */
|
|
|
|
|
|
2007-05-20 23:29:14 +00:00
|
|
|
|
if (AutoWrap (tty)
|
2014-08-10 08:26:28 +00:00
|
|
|
|
&& curY (tty) + 1 == FRAME_TOTAL_LINES (f)
|
2007-05-20 23:29:14 +00:00
|
|
|
|
&& (curX (tty) + len) == FRAME_COLS (f))
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
len --;
|
|
|
|
|
if (len <= 0)
|
|
|
|
|
return;
|
|
|
|
|
|
2007-05-20 23:29:14 +00:00
|
|
|
|
cmplus (tty, len);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
|
|
|
|
/* If terminal_coding does any conversion, use it, otherwise use
|
|
|
|
|
safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here
|
|
|
|
|
because it always return 1 if the member src_multibyte is 1. */
|
2007-05-20 23:29:14 +00:00
|
|
|
|
coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK
|
|
|
|
|
? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
/* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
|
|
|
|
|
the tail. */
|
|
|
|
|
coding->mode &= ~CODING_MODE_LAST_BLOCK;
|
|
|
|
|
|
|
|
|
|
/* Turn appearance modes of the face. */
|
2007-05-20 23:29:14 +00:00
|
|
|
|
tty_highlight_if_desired (tty);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
turn_on_face (f, face_id);
|
|
|
|
|
|
|
|
|
|
coding->mode |= CODING_MODE_LAST_BLOCK;
|
|
|
|
|
conversion_buffer = encode_terminal_code (string, len, coding);
|
|
|
|
|
if (coding->produced > 0)
|
|
|
|
|
{
|
Simplify and avoid signal-handling races.
* nt/inc/ms-w32.h (emacs_raise): New macro.
* src/alloc.c (die):
* src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
Avoid recursive loop if there's a fatal error in the function itself.
* src/atimer.c (pending_atimers):
* src/blockinput.h: Don't include "atimer.h"; no longer needed.
(interrupt_input_pending): Remove. All uses removed.
pending_signals now counts both atimers and ordinary interrupts.
This is less racy than having three separate pending-signal flags.
(block_input, unblock_input, totally_unblock_input, unblock_input_to)
(input_blocked_p):
Rename from their upper-case counterparts BLOCK_INPUT,
UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
INPUT_BLOCKED_P, and turn into functions. All uses changed.
This makes it easier to access volatile variables more accurately.
(BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
(input_blocked_p): Prefer this to 'interrupt_input_blocked', as
that's more reliable if the code is buggy and sets
interrupt_input_blocked to a negative value. All uses changed.
* src/atimer.c (deliver_alarm_signal):
Remove. No need to deliver this to the parent; any thread can
handle this signal now. All uses replaced by underlying handler.
* src/atimer.c (turn_on_atimers):
* src/dispnew.c (handle_window_change_signal):
* src/emacs.c (handle_danger_signal):
* src/keyboard.c (kbd_buffer_get_event):
Don't reestablish signal handler; not needed with sigaction.
* src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
(UNBLOCK_INPUT_TO):
Rework to avoid unnecessary accesses to volatile variables.
(UNBLOCK_INPUT_TO): Now a function.
(totally_unblock_input, unblock_input): New decls.
* src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
(init_data): Remove. Necessary stuff now done in init_signal.
* src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
* src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
(fatal_error_code): Remove; no longer needed.
(terminate_due_to_signal): Rename from fatal_error_backtrace, since
it doesn't always backtrace. All uses changed. No need to reset
signal to default, since sigaction and/or die does that for us now.
Use emacs_raise (FOO), not kill (getpid (), FOO).
(main): Check more-accurately whether we're dumping.
Move fatal-error setup to sysdep.c
* src/floatfns.c: Do not include "syssignal.h"; no longer needed.
* src/gtkutil.c (xg_get_file_name, xg_get_font):
Remove no-longer-needed signal-mask manipulation.
* src/keyboard.c, src/process.c (POLL_FOR_INPUT):
Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
* src/keyboard.c (read_avail_input): Remove.
All uses replaced by gobble_input.
(Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
(kbd_buffer_store_event_hold, gobble_input):
(record_asynch_buffer_change) [USABLE_SIGIO]:
(store_user_signal_events):
No need to mess with signal mask.
(gobble_input): If blocking input and there are terminals, simply
set pending_signals to 1 and return. All hooks changed to not
worry about whether input is blocked.
(process_pending_signals): Clear pending_signals before processing
them, in case a signal comes in while we're processing.
By convention callers now test pending_signals before calling us.
(UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
New functions, to support changes to blockinput.h.
(handle_input_available_signal): Now extern.
(reinvoke_input_signal): Remove. All uses replaced by
handle_async_input.
(quit_count): Now volatile, since a signal handler uses it.
(handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All
callers changed. Block SIGINT only if not already blocked.
Clear sigmask reliably, even if Fsignal returns, which it can.
Omit unnecessary accesses to volatile var.
(quit_throw_to_read_char): No need to restore sigmask.
* src/keyboard.c (gobble_input, handle_user_signal):
* src/process.c (wait_reading_process_output):
Call signal-handling code rather than killing ourselves.
* src/lisp.h: Include <float.h>, for...
(IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
(pending_signals): Now volatile.
(syms_of_data): Now const if IEEE floating point.
(handle_input_available_signal) [USABLE_SIGIO]:
(terminate_due_to_signal, record_child_status_change): New decls.
* src/process.c (create_process): Avoid disaster if memory is exhausted
while we're processing a vfork, by tightening the critical section
around the vfork.
(send_process_frame, process_sent_to, handle_pipe_signal)
(deliver_pipe_signal): Remove. No longer needed, as Emacs now
ignores SIGPIPE.
(send_process): No need for setjmp/longjmp any more, since the
SIGPIPE stuff is now gone. Instead, report an error if errno
is EPIPE.
(record_child_status_change): Now extern. PID and W are now args.
Return void, not bool. All callers changed.
* src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
Remove. All uses removed. This bug should be fixed now in a
different way.
(wait_for_termination_1): Use waitpid rather than sigsuspend,
and record the child status change directly. This avoids the
need to futz with the signal mask.
(process_fatal_action): Move here from emacs.c.
(emacs_sigaction_flags): New function, containing
much of what used to be in emacs_sigaction_init.
(emacs_sigaction_init): Use it. Block nonfatal system signals that are
caught by emacs, to make races less likely.
(deliver_process_signal): Rename from handle_on_main_thread.
All uses changed.
(BACKTRACE_LIMIT_MAX): Now at top level.
(thread_backtrace_buffer, threadback_backtrace_pointers):
New static vars.
(deliver_thread_signal, deliver_fatal_thread_signal):
New functions, for more-accurate delivery of thread-specific signals.
(handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
(deliver_arith_signal): Handle in this thread, not
in the main thread, since it's triggered by this thread.
(maybe_fatal_sig): New function.
(init_signals): New arg DUMPING so that we can be more accurate
about whether we're dumping. Caller changed.
Treat thread-specific signals differently from process-general signals.
Block all signals while handling fatal error; that's safer.
xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
on IEEE hosts.
When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
Ignore SIGPIPE unless batch.
(emacs_backtrace): Output backtrace for the appropriate thread,
which is not necessarily the main thread.
* src/syssignal.h: Include <stdbool.h>.
(emacs_raise): New macro.
* src/xterm.c (x_connection_signal): Remove; no longer needed
now that we use sigaction.
(x_connection_closed): No need to mess with sigmask now.
(x_initialize): No need to reset SIGPIPE handler here, since
init_signals does this for us now.
Fixes: debbugs:12471
2012-09-23 08:44:20 +00:00
|
|
|
|
block_input ();
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fwrite_unlocked (conversion_buffer, 1, coding->produced, tty->output);
|
|
|
|
|
clearerr_unlocked (tty->output);
|
2007-05-20 23:29:14 +00:00
|
|
|
|
if (tty->termscript)
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fwrite_unlocked (conversion_buffer, 1, coding->produced,
|
|
|
|
|
tty->termscript);
|
Simplify and avoid signal-handling races.
* nt/inc/ms-w32.h (emacs_raise): New macro.
* src/alloc.c (die):
* src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
Avoid recursive loop if there's a fatal error in the function itself.
* src/atimer.c (pending_atimers):
* src/blockinput.h: Don't include "atimer.h"; no longer needed.
(interrupt_input_pending): Remove. All uses removed.
pending_signals now counts both atimers and ordinary interrupts.
This is less racy than having three separate pending-signal flags.
(block_input, unblock_input, totally_unblock_input, unblock_input_to)
(input_blocked_p):
Rename from their upper-case counterparts BLOCK_INPUT,
UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
INPUT_BLOCKED_P, and turn into functions. All uses changed.
This makes it easier to access volatile variables more accurately.
(BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
(input_blocked_p): Prefer this to 'interrupt_input_blocked', as
that's more reliable if the code is buggy and sets
interrupt_input_blocked to a negative value. All uses changed.
* src/atimer.c (deliver_alarm_signal):
Remove. No need to deliver this to the parent; any thread can
handle this signal now. All uses replaced by underlying handler.
* src/atimer.c (turn_on_atimers):
* src/dispnew.c (handle_window_change_signal):
* src/emacs.c (handle_danger_signal):
* src/keyboard.c (kbd_buffer_get_event):
Don't reestablish signal handler; not needed with sigaction.
* src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
(UNBLOCK_INPUT_TO):
Rework to avoid unnecessary accesses to volatile variables.
(UNBLOCK_INPUT_TO): Now a function.
(totally_unblock_input, unblock_input): New decls.
* src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
(init_data): Remove. Necessary stuff now done in init_signal.
* src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
* src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
(fatal_error_code): Remove; no longer needed.
(terminate_due_to_signal): Rename from fatal_error_backtrace, since
it doesn't always backtrace. All uses changed. No need to reset
signal to default, since sigaction and/or die does that for us now.
Use emacs_raise (FOO), not kill (getpid (), FOO).
(main): Check more-accurately whether we're dumping.
Move fatal-error setup to sysdep.c
* src/floatfns.c: Do not include "syssignal.h"; no longer needed.
* src/gtkutil.c (xg_get_file_name, xg_get_font):
Remove no-longer-needed signal-mask manipulation.
* src/keyboard.c, src/process.c (POLL_FOR_INPUT):
Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
* src/keyboard.c (read_avail_input): Remove.
All uses replaced by gobble_input.
(Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
(kbd_buffer_store_event_hold, gobble_input):
(record_asynch_buffer_change) [USABLE_SIGIO]:
(store_user_signal_events):
No need to mess with signal mask.
(gobble_input): If blocking input and there are terminals, simply
set pending_signals to 1 and return. All hooks changed to not
worry about whether input is blocked.
(process_pending_signals): Clear pending_signals before processing
them, in case a signal comes in while we're processing.
By convention callers now test pending_signals before calling us.
(UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
New functions, to support changes to blockinput.h.
(handle_input_available_signal): Now extern.
(reinvoke_input_signal): Remove. All uses replaced by
handle_async_input.
(quit_count): Now volatile, since a signal handler uses it.
(handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All
callers changed. Block SIGINT only if not already blocked.
Clear sigmask reliably, even if Fsignal returns, which it can.
Omit unnecessary accesses to volatile var.
(quit_throw_to_read_char): No need to restore sigmask.
* src/keyboard.c (gobble_input, handle_user_signal):
* src/process.c (wait_reading_process_output):
Call signal-handling code rather than killing ourselves.
* src/lisp.h: Include <float.h>, for...
(IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
(pending_signals): Now volatile.
(syms_of_data): Now const if IEEE floating point.
(handle_input_available_signal) [USABLE_SIGIO]:
(terminate_due_to_signal, record_child_status_change): New decls.
* src/process.c (create_process): Avoid disaster if memory is exhausted
while we're processing a vfork, by tightening the critical section
around the vfork.
(send_process_frame, process_sent_to, handle_pipe_signal)
(deliver_pipe_signal): Remove. No longer needed, as Emacs now
ignores SIGPIPE.
(send_process): No need for setjmp/longjmp any more, since the
SIGPIPE stuff is now gone. Instead, report an error if errno
is EPIPE.
(record_child_status_change): Now extern. PID and W are now args.
Return void, not bool. All callers changed.
* src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
Remove. All uses removed. This bug should be fixed now in a
different way.
(wait_for_termination_1): Use waitpid rather than sigsuspend,
and record the child status change directly. This avoids the
need to futz with the signal mask.
(process_fatal_action): Move here from emacs.c.
(emacs_sigaction_flags): New function, containing
much of what used to be in emacs_sigaction_init.
(emacs_sigaction_init): Use it. Block nonfatal system signals that are
caught by emacs, to make races less likely.
(deliver_process_signal): Rename from handle_on_main_thread.
All uses changed.
(BACKTRACE_LIMIT_MAX): Now at top level.
(thread_backtrace_buffer, threadback_backtrace_pointers):
New static vars.
(deliver_thread_signal, deliver_fatal_thread_signal):
New functions, for more-accurate delivery of thread-specific signals.
(handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
(deliver_arith_signal): Handle in this thread, not
in the main thread, since it's triggered by this thread.
(maybe_fatal_sig): New function.
(init_signals): New arg DUMPING so that we can be more accurate
about whether we're dumping. Caller changed.
Treat thread-specific signals differently from process-general signals.
Block all signals while handling fatal error; that's safer.
xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
on IEEE hosts.
When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
Ignore SIGPIPE unless batch.
(emacs_backtrace): Output backtrace for the appropriate thread,
which is not necessarily the main thread.
* src/syssignal.h: Include <stdbool.h>.
(emacs_raise): New macro.
* src/xterm.c (x_connection_signal): Remove; no longer needed
now that we use sigaction.
(x_connection_closed): No need to mess with sigmask now.
(x_initialize): No need to reset SIGPIPE handler here, since
init_signals does this for us now.
Fixes: debbugs:12471
2012-09-23 08:44:20 +00:00
|
|
|
|
unblock_input ();
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Turn appearance modes off. */
|
|
|
|
|
turn_off_face (f, face_id);
|
2007-05-20 23:29:14 +00:00
|
|
|
|
tty_turn_off_highlight (tty);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
2007-05-20 23:29:14 +00:00
|
|
|
|
cmcheckmagic (tty);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
}
|
2007-09-29 20:56:48 +00:00
|
|
|
|
#endif
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
/* An implementation of insert_glyphs for termcap frames. */
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
|
|
|
|
char *buf;
|
2000-09-21 20:54:57 +00:00
|
|
|
|
struct glyph *glyph = NULL;
|
2004-11-30 08:19:32 +00:00
|
|
|
|
unsigned char *conversion_buffer;
|
|
|
|
|
unsigned char space[1];
|
|
|
|
|
struct coding_system *coding;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_ins_multi_chars)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
* tparam.h: New file.
* term.c, tparam.h: Include it.
* deps.mk (term.o, tparam.o): Depend on tparam.h.
* term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
Move these decls to tparam.h, and make them agree with what
is actually in tparam.c. The previous trick of using incompatible
decls in different modules does not conform to the C standard.
All callers of tparam changed to use tparam's actual API.
* tparam.c (tparam1, tparam, tgoto):
Use const pointers where appropriate.
2011-03-08 18:26:34 +00:00
|
|
|
|
buf = tparam (tty->TS_ins_multi_chars, 0, 0, len, 0, 0, 0);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
OUTPUT1 (tty, buf);
|
Put interrupt input blocking in a separate file from xterm.h.
This isn't specific to X, and it allows us to avoid #including
xterm.h in files that don't really have anything to do with X.
* blockinput.h: New file.
* xterm.h (BLOCK_INPUT, UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT,
UNBLOCK_INPUT_RESIGNAL): These are now in blockinput.h.
(x_input_blocked, x_pending_input): Deleted; there are analogs
in blockinput.h called interrupt_input_blocked and
interrupt_input_pending.
* keyboard.c (interrupt_input_blocked, interrupt_input_pending):
New variables, used by the macros in blockinput.h.
* xterm.c: #include blockinput.h.
(x_input_blocked, x_pending_input): Deleted.
(XTread_socket): Test and set interrupt_input_blocked and
interrupt_input_pending instead of the old variables.
* alloc.c, xfaces.c, xfns.c, xmenu.c, xselect.c, keymap.c:
#include blockinput.h.
* eval.c: #include blockinput.h instead of xterm.h.
* keyboard.c: #include blockinput.h.
(input_poll_signal): Just test
interrupt_input_blocked, instead of testing HAVE_X_WINDOWS and
x_input_blocked.
Block the processing of interrupt input while we're manipulating the
malloc heap.
* alloc.c: (xfree): New function, to make it easy to free things
safely.
(xmalloc, xrealloc): Block X input while doing the deed.
(VALIDATE_LISP_STORAGE, gc_sweep, compact_strings): Use xfree
instead of free.
(uninterrupt_malloc): New function, to install input-blocking
hooks into the GNU malloc routines.
* emacs.c [not SYSTEM_MALLOC] (main): Call uninterrupt_malloc
on startup.
* alloc.c: (make_interval, make_float, Fcons, Fmake_vector,
Fmake_symbol, Fmake_marker, make_uninit_string, Fgarbage_collect):
Use xmalloc instead of malloc; don't bother to check if out of
memory here.
(Fgarbage_collect): Call xrealloc instead of realloc.
* buffer.c: Use xmalloc and xfree instead of malloc and free;
don't bother to check if out of memory here.
(Fget_buffer_create): Put BLOCK_INPUT/UNBLOCK_INPUT pair around
calls to ralloc routines.
* insdel.c: Same.
* lisp.h (xfree): New extern declaration.
* xfaces.c (xfree): Don't #define this to be free; use the
definition in alloc.c.
* dispnew.c, doc.c, doprnt.c, fileio.c, lread.c, term.c, xfns.c,
xmenu.c, xterm.c: Use xfree instead of free.
* hftctl.c: Use xfree and xmalloc instead of free and malloc.
* keymap.c (current_minor_maps): BLOCK_INPUT while calling realloc
and malloc.
* search.c: Since the regexp routines can malloc, BLOCK_INPUT
while runing them. #include blockinput.h.
* sysdep.c: #include blockinput.h. Call xfree and xmalloc instead
of free and malloc. BLOCK_INPUT around routines which we know
will call malloc.
ymakefile (keyboard.o, keymap.o, search.o, sysdep.o, xfaces.o,
xfns.o, xmenu.o, xterm.o, xselect.o, alloc.o, eval.o): Note that
these depend on blockinput.h.
1993-03-31 10:55:33 +00:00
|
|
|
|
xfree (buf);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
if (start)
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
write_glyphs (f, start, len);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_on_insert (tty);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
cmplus (tty, len);
|
2004-12-11 02:11:33 +00:00
|
|
|
|
|
|
|
|
|
if (! start)
|
|
|
|
|
space[0] = SPACEGLYPH;
|
|
|
|
|
|
|
|
|
|
/* If terminal_coding does any conversion, use it, otherwise use
|
|
|
|
|
safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here
|
|
|
|
|
because it always return 1 if the member src_multibyte is 1. */
|
2004-12-08 22:20:27 +00:00
|
|
|
|
coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK
|
|
|
|
|
? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
|
2004-12-11 02:11:33 +00:00
|
|
|
|
/* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
|
|
|
|
|
the tail. */
|
|
|
|
|
coding->mode &= ~CODING_MODE_LAST_BLOCK;
|
|
|
|
|
|
1997-03-19 16:32:46 +00:00
|
|
|
|
while (len-- > 0)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT1_IF (tty, tty->TS_ins_char);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
if (!start)
|
1999-12-27 05:07:56 +00:00
|
|
|
|
{
|
2004-12-11 02:11:33 +00:00
|
|
|
|
conversion_buffer = space;
|
|
|
|
|
coding->produced = 1;
|
1999-12-27 05:07:56 +00:00
|
|
|
|
}
|
1991-05-09 10:29:44 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_highlight_if_desired (tty);
|
1999-12-27 05:07:56 +00:00
|
|
|
|
turn_on_face (f, start->face_id);
|
2000-01-02 14:00:03 +00:00
|
|
|
|
glyph = start;
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
++start;
|
1997-02-20 06:57:21 +00:00
|
|
|
|
/* We must open sufficient space for a character which
|
|
|
|
|
occupies more than one column. */
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
while (len && CHAR_GLYPH_PADDING_P (*start))
|
1997-02-20 06:57:21 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT1_IF (tty, tty->TS_ins_char);
|
1997-02-20 06:57:21 +00:00
|
|
|
|
start++, len--;
|
|
|
|
|
}
|
2004-12-11 02:11:33 +00:00
|
|
|
|
|
|
|
|
|
if (len <= 0)
|
|
|
|
|
/* This is the last glyph. */
|
|
|
|
|
coding->mode |= CODING_MODE_LAST_BLOCK;
|
|
|
|
|
|
2004-12-08 22:20:27 +00:00
|
|
|
|
conversion_buffer = encode_terminal_code (glyph, 1, coding);
|
1999-12-27 05:07:56 +00:00
|
|
|
|
}
|
1997-02-20 06:57:21 +00:00
|
|
|
|
|
2004-12-11 02:11:33 +00:00
|
|
|
|
if (coding->produced > 0)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Simplify and avoid signal-handling races.
* nt/inc/ms-w32.h (emacs_raise): New macro.
* src/alloc.c (die):
* src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
Avoid recursive loop if there's a fatal error in the function itself.
* src/atimer.c (pending_atimers):
* src/blockinput.h: Don't include "atimer.h"; no longer needed.
(interrupt_input_pending): Remove. All uses removed.
pending_signals now counts both atimers and ordinary interrupts.
This is less racy than having three separate pending-signal flags.
(block_input, unblock_input, totally_unblock_input, unblock_input_to)
(input_blocked_p):
Rename from their upper-case counterparts BLOCK_INPUT,
UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
INPUT_BLOCKED_P, and turn into functions. All uses changed.
This makes it easier to access volatile variables more accurately.
(BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
(input_blocked_p): Prefer this to 'interrupt_input_blocked', as
that's more reliable if the code is buggy and sets
interrupt_input_blocked to a negative value. All uses changed.
* src/atimer.c (deliver_alarm_signal):
Remove. No need to deliver this to the parent; any thread can
handle this signal now. All uses replaced by underlying handler.
* src/atimer.c (turn_on_atimers):
* src/dispnew.c (handle_window_change_signal):
* src/emacs.c (handle_danger_signal):
* src/keyboard.c (kbd_buffer_get_event):
Don't reestablish signal handler; not needed with sigaction.
* src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
(UNBLOCK_INPUT_TO):
Rework to avoid unnecessary accesses to volatile variables.
(UNBLOCK_INPUT_TO): Now a function.
(totally_unblock_input, unblock_input): New decls.
* src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
(init_data): Remove. Necessary stuff now done in init_signal.
* src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
* src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
(fatal_error_code): Remove; no longer needed.
(terminate_due_to_signal): Rename from fatal_error_backtrace, since
it doesn't always backtrace. All uses changed. No need to reset
signal to default, since sigaction and/or die does that for us now.
Use emacs_raise (FOO), not kill (getpid (), FOO).
(main): Check more-accurately whether we're dumping.
Move fatal-error setup to sysdep.c
* src/floatfns.c: Do not include "syssignal.h"; no longer needed.
* src/gtkutil.c (xg_get_file_name, xg_get_font):
Remove no-longer-needed signal-mask manipulation.
* src/keyboard.c, src/process.c (POLL_FOR_INPUT):
Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
* src/keyboard.c (read_avail_input): Remove.
All uses replaced by gobble_input.
(Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
(kbd_buffer_store_event_hold, gobble_input):
(record_asynch_buffer_change) [USABLE_SIGIO]:
(store_user_signal_events):
No need to mess with signal mask.
(gobble_input): If blocking input and there are terminals, simply
set pending_signals to 1 and return. All hooks changed to not
worry about whether input is blocked.
(process_pending_signals): Clear pending_signals before processing
them, in case a signal comes in while we're processing.
By convention callers now test pending_signals before calling us.
(UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
New functions, to support changes to blockinput.h.
(handle_input_available_signal): Now extern.
(reinvoke_input_signal): Remove. All uses replaced by
handle_async_input.
(quit_count): Now volatile, since a signal handler uses it.
(handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All
callers changed. Block SIGINT only if not already blocked.
Clear sigmask reliably, even if Fsignal returns, which it can.
Omit unnecessary accesses to volatile var.
(quit_throw_to_read_char): No need to restore sigmask.
* src/keyboard.c (gobble_input, handle_user_signal):
* src/process.c (wait_reading_process_output):
Call signal-handling code rather than killing ourselves.
* src/lisp.h: Include <float.h>, for...
(IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
(pending_signals): Now volatile.
(syms_of_data): Now const if IEEE floating point.
(handle_input_available_signal) [USABLE_SIGIO]:
(terminate_due_to_signal, record_child_status_change): New decls.
* src/process.c (create_process): Avoid disaster if memory is exhausted
while we're processing a vfork, by tightening the critical section
around the vfork.
(send_process_frame, process_sent_to, handle_pipe_signal)
(deliver_pipe_signal): Remove. No longer needed, as Emacs now
ignores SIGPIPE.
(send_process): No need for setjmp/longjmp any more, since the
SIGPIPE stuff is now gone. Instead, report an error if errno
is EPIPE.
(record_child_status_change): Now extern. PID and W are now args.
Return void, not bool. All callers changed.
* src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
Remove. All uses removed. This bug should be fixed now in a
different way.
(wait_for_termination_1): Use waitpid rather than sigsuspend,
and record the child status change directly. This avoids the
need to futz with the signal mask.
(process_fatal_action): Move here from emacs.c.
(emacs_sigaction_flags): New function, containing
much of what used to be in emacs_sigaction_init.
(emacs_sigaction_init): Use it. Block nonfatal system signals that are
caught by emacs, to make races less likely.
(deliver_process_signal): Rename from handle_on_main_thread.
All uses changed.
(BACKTRACE_LIMIT_MAX): Now at top level.
(thread_backtrace_buffer, threadback_backtrace_pointers):
New static vars.
(deliver_thread_signal, deliver_fatal_thread_signal):
New functions, for more-accurate delivery of thread-specific signals.
(handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
(deliver_arith_signal): Handle in this thread, not
in the main thread, since it's triggered by this thread.
(maybe_fatal_sig): New function.
(init_signals): New arg DUMPING so that we can be more accurate
about whether we're dumping. Caller changed.
Treat thread-specific signals differently from process-general signals.
Block all signals while handling fatal error; that's safer.
xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
on IEEE hosts.
When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
Ignore SIGPIPE unless batch.
(emacs_backtrace): Output backtrace for the appropriate thread,
which is not necessarily the main thread.
* src/syssignal.h: Include <stdbool.h>.
(emacs_raise): New macro.
* src/xterm.c (x_connection_signal): Remove; no longer needed
now that we use sigaction.
(x_connection_closed): No need to mess with sigmask now.
(x_initialize): No need to reset SIGPIPE handler here, since
init_signals does this for us now.
Fixes: debbugs:12471
2012-09-23 08:44:20 +00:00
|
|
|
|
block_input ();
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fwrite_unlocked (conversion_buffer, 1, coding->produced, tty->output);
|
|
|
|
|
clearerr_unlocked (tty->output);
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
if (tty->termscript)
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fwrite_unlocked (conversion_buffer, 1, coding->produced,
|
|
|
|
|
tty->termscript);
|
Simplify and avoid signal-handling races.
* nt/inc/ms-w32.h (emacs_raise): New macro.
* src/alloc.c (die):
* src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
Avoid recursive loop if there's a fatal error in the function itself.
* src/atimer.c (pending_atimers):
* src/blockinput.h: Don't include "atimer.h"; no longer needed.
(interrupt_input_pending): Remove. All uses removed.
pending_signals now counts both atimers and ordinary interrupts.
This is less racy than having three separate pending-signal flags.
(block_input, unblock_input, totally_unblock_input, unblock_input_to)
(input_blocked_p):
Rename from their upper-case counterparts BLOCK_INPUT,
UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
INPUT_BLOCKED_P, and turn into functions. All uses changed.
This makes it easier to access volatile variables more accurately.
(BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
(input_blocked_p): Prefer this to 'interrupt_input_blocked', as
that's more reliable if the code is buggy and sets
interrupt_input_blocked to a negative value. All uses changed.
* src/atimer.c (deliver_alarm_signal):
Remove. No need to deliver this to the parent; any thread can
handle this signal now. All uses replaced by underlying handler.
* src/atimer.c (turn_on_atimers):
* src/dispnew.c (handle_window_change_signal):
* src/emacs.c (handle_danger_signal):
* src/keyboard.c (kbd_buffer_get_event):
Don't reestablish signal handler; not needed with sigaction.
* src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
(UNBLOCK_INPUT_TO):
Rework to avoid unnecessary accesses to volatile variables.
(UNBLOCK_INPUT_TO): Now a function.
(totally_unblock_input, unblock_input): New decls.
* src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
(init_data): Remove. Necessary stuff now done in init_signal.
* src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
* src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
(fatal_error_code): Remove; no longer needed.
(terminate_due_to_signal): Rename from fatal_error_backtrace, since
it doesn't always backtrace. All uses changed. No need to reset
signal to default, since sigaction and/or die does that for us now.
Use emacs_raise (FOO), not kill (getpid (), FOO).
(main): Check more-accurately whether we're dumping.
Move fatal-error setup to sysdep.c
* src/floatfns.c: Do not include "syssignal.h"; no longer needed.
* src/gtkutil.c (xg_get_file_name, xg_get_font):
Remove no-longer-needed signal-mask manipulation.
* src/keyboard.c, src/process.c (POLL_FOR_INPUT):
Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
* src/keyboard.c (read_avail_input): Remove.
All uses replaced by gobble_input.
(Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
(kbd_buffer_store_event_hold, gobble_input):
(record_asynch_buffer_change) [USABLE_SIGIO]:
(store_user_signal_events):
No need to mess with signal mask.
(gobble_input): If blocking input and there are terminals, simply
set pending_signals to 1 and return. All hooks changed to not
worry about whether input is blocked.
(process_pending_signals): Clear pending_signals before processing
them, in case a signal comes in while we're processing.
By convention callers now test pending_signals before calling us.
(UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
New functions, to support changes to blockinput.h.
(handle_input_available_signal): Now extern.
(reinvoke_input_signal): Remove. All uses replaced by
handle_async_input.
(quit_count): Now volatile, since a signal handler uses it.
(handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All
callers changed. Block SIGINT only if not already blocked.
Clear sigmask reliably, even if Fsignal returns, which it can.
Omit unnecessary accesses to volatile var.
(quit_throw_to_read_char): No need to restore sigmask.
* src/keyboard.c (gobble_input, handle_user_signal):
* src/process.c (wait_reading_process_output):
Call signal-handling code rather than killing ourselves.
* src/lisp.h: Include <float.h>, for...
(IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
(pending_signals): Now volatile.
(syms_of_data): Now const if IEEE floating point.
(handle_input_available_signal) [USABLE_SIGIO]:
(terminate_due_to_signal, record_child_status_change): New decls.
* src/process.c (create_process): Avoid disaster if memory is exhausted
while we're processing a vfork, by tightening the critical section
around the vfork.
(send_process_frame, process_sent_to, handle_pipe_signal)
(deliver_pipe_signal): Remove. No longer needed, as Emacs now
ignores SIGPIPE.
(send_process): No need for setjmp/longjmp any more, since the
SIGPIPE stuff is now gone. Instead, report an error if errno
is EPIPE.
(record_child_status_change): Now extern. PID and W are now args.
Return void, not bool. All callers changed.
* src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
Remove. All uses removed. This bug should be fixed now in a
different way.
(wait_for_termination_1): Use waitpid rather than sigsuspend,
and record the child status change directly. This avoids the
need to futz with the signal mask.
(process_fatal_action): Move here from emacs.c.
(emacs_sigaction_flags): New function, containing
much of what used to be in emacs_sigaction_init.
(emacs_sigaction_init): Use it. Block nonfatal system signals that are
caught by emacs, to make races less likely.
(deliver_process_signal): Rename from handle_on_main_thread.
All uses changed.
(BACKTRACE_LIMIT_MAX): Now at top level.
(thread_backtrace_buffer, threadback_backtrace_pointers):
New static vars.
(deliver_thread_signal, deliver_fatal_thread_signal):
New functions, for more-accurate delivery of thread-specific signals.
(handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
(deliver_arith_signal): Handle in this thread, not
in the main thread, since it's triggered by this thread.
(maybe_fatal_sig): New function.
(init_signals): New arg DUMPING so that we can be more accurate
about whether we're dumping. Caller changed.
Treat thread-specific signals differently from process-general signals.
Block all signals while handling fatal error; that's safer.
xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
on IEEE hosts.
When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
Ignore SIGPIPE unless batch.
(emacs_backtrace): Output backtrace for the appropriate thread,
which is not necessarily the main thread.
* src/syssignal.h: Include <stdbool.h>.
(emacs_raise): New macro.
* src/xterm.c (x_connection_signal): Remove; no longer needed
now that we use sigaction.
(x_connection_closed): No need to mess with sigmask now.
(x_initialize): No need to reset SIGPIPE handler here, since
init_signals does this for us now.
Fixes: debbugs:12471
2012-09-23 08:44:20 +00:00
|
|
|
|
unblock_input ();
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT1_IF (tty, tty->TS_pad_inserted_char);
|
1999-12-27 05:07:56 +00:00
|
|
|
|
if (start)
|
2000-08-16 12:14:15 +00:00
|
|
|
|
{
|
|
|
|
|
turn_off_face (f, glyph->face_id);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_highlight (tty);
|
2000-08-16 12:14:15 +00:00
|
|
|
|
}
|
1995-01-17 00:18:55 +00:00
|
|
|
|
}
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
cmcheckmagic (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
/* An implementation of delete_glyphs for termcap frames. */
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
tty_delete_glyphs (struct frame *f, int n)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
|
|
|
|
char *buf;
|
|
|
|
|
register int i;
|
|
|
|
|
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->delete_in_insert_mode)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_on_insert (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_turn_off_insert (tty);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT_IF (tty, tty->TS_delete_mode);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_del_multi_chars)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
* tparam.h: New file.
* term.c, tparam.h: Include it.
* deps.mk (term.o, tparam.o): Depend on tparam.h.
* term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
Move these decls to tparam.h, and make them agree with what
is actually in tparam.c. The previous trick of using incompatible
decls in different modules does not conform to the C standard.
All callers of tparam changed to use tparam's actual API.
* tparam.c (tparam1, tparam, tgoto):
Use const pointers where appropriate.
2011-03-08 18:26:34 +00:00
|
|
|
|
buf = tparam (tty->TS_del_multi_chars, 0, 0, n, 0, 0, 0);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
OUTPUT1 (tty, buf);
|
Put interrupt input blocking in a separate file from xterm.h.
This isn't specific to X, and it allows us to avoid #including
xterm.h in files that don't really have anything to do with X.
* blockinput.h: New file.
* xterm.h (BLOCK_INPUT, UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT,
UNBLOCK_INPUT_RESIGNAL): These are now in blockinput.h.
(x_input_blocked, x_pending_input): Deleted; there are analogs
in blockinput.h called interrupt_input_blocked and
interrupt_input_pending.
* keyboard.c (interrupt_input_blocked, interrupt_input_pending):
New variables, used by the macros in blockinput.h.
* xterm.c: #include blockinput.h.
(x_input_blocked, x_pending_input): Deleted.
(XTread_socket): Test and set interrupt_input_blocked and
interrupt_input_pending instead of the old variables.
* alloc.c, xfaces.c, xfns.c, xmenu.c, xselect.c, keymap.c:
#include blockinput.h.
* eval.c: #include blockinput.h instead of xterm.h.
* keyboard.c: #include blockinput.h.
(input_poll_signal): Just test
interrupt_input_blocked, instead of testing HAVE_X_WINDOWS and
x_input_blocked.
Block the processing of interrupt input while we're manipulating the
malloc heap.
* alloc.c: (xfree): New function, to make it easy to free things
safely.
(xmalloc, xrealloc): Block X input while doing the deed.
(VALIDATE_LISP_STORAGE, gc_sweep, compact_strings): Use xfree
instead of free.
(uninterrupt_malloc): New function, to install input-blocking
hooks into the GNU malloc routines.
* emacs.c [not SYSTEM_MALLOC] (main): Call uninterrupt_malloc
on startup.
* alloc.c: (make_interval, make_float, Fcons, Fmake_vector,
Fmake_symbol, Fmake_marker, make_uninit_string, Fgarbage_collect):
Use xmalloc instead of malloc; don't bother to check if out of
memory here.
(Fgarbage_collect): Call xrealloc instead of realloc.
* buffer.c: Use xmalloc and xfree instead of malloc and free;
don't bother to check if out of memory here.
(Fget_buffer_create): Put BLOCK_INPUT/UNBLOCK_INPUT pair around
calls to ralloc routines.
* insdel.c: Same.
* lisp.h (xfree): New extern declaration.
* xfaces.c (xfree): Don't #define this to be free; use the
definition in alloc.c.
* dispnew.c, doc.c, doprnt.c, fileio.c, lread.c, term.c, xfns.c,
xmenu.c, xterm.c: Use xfree instead of free.
* hftctl.c: Use xfree and xmalloc instead of free and malloc.
* keymap.c (current_minor_maps): BLOCK_INPUT while calling realloc
and malloc.
* search.c: Since the regexp routines can malloc, BLOCK_INPUT
while runing them. #include blockinput.h.
* sysdep.c: #include blockinput.h. Call xfree and xmalloc instead
of free and malloc. BLOCK_INPUT around routines which we know
will call malloc.
ymakefile (keyboard.o, keymap.o, search.o, sysdep.o, xfaces.o,
xfns.o, xmenu.o, xterm.o, xselect.o, alloc.o, eval.o): Note that
these depend on blockinput.h.
1993-03-31 10:55:33 +00:00
|
|
|
|
xfree (buf);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
for (i = 0; i < n; i++)
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT1 (tty, tty->TS_del_char);
|
|
|
|
|
if (!tty->delete_in_insert_mode)
|
|
|
|
|
OUTPUT_IF (tty, tty->TS_end_delete_mode);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
/* An implementation of ins_del_lines for termcap frames. */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
tty_ins_del_lines (struct frame *f, int vpos, int n)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
2011-03-09 02:12:00 +00:00
|
|
|
|
const char *multi =
|
|
|
|
|
n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines;
|
|
|
|
|
const char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line;
|
|
|
|
|
const char *scroll = n > 0 ? tty->TS_rev_scroll : tty->TS_fwd_scroll;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2013-01-02 07:57:00 +00:00
|
|
|
|
int i = eabs (n);
|
|
|
|
|
char *buf;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
|
|
|
|
/* If the lines below the insertion are being pushed
|
|
|
|
|
into the end of the window, this is the same as clearing;
|
|
|
|
|
and we know the lines are already clear, since the matching
|
|
|
|
|
deletion has already been done. So can ignore this. */
|
|
|
|
|
/* If the lines below the deletion are blank lines coming
|
|
|
|
|
out of the end of the window, don't bother,
|
|
|
|
|
as there will be a matching inslines later that will flush them. */
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
if (FRAME_SCROLL_REGION_OK (f)
|
|
|
|
|
&& vpos + i >= tty->specified_window)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
return;
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
if (!FRAME_MEMORY_BELOW_FRAME (f)
|
2014-08-10 08:26:28 +00:00
|
|
|
|
&& vpos + i >= FRAME_TOTAL_LINES (f))
|
1991-05-09 10:29:44 +00:00
|
|
|
|
return;
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
1991-05-09 10:29:44 +00:00
|
|
|
|
if (multi)
|
|
|
|
|
{
|
2004-04-18 01:08:46 +00:00
|
|
|
|
raw_cursor_to (f, vpos, 0);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_background_highlight (tty);
|
* tparam.h: New file.
* term.c, tparam.h: Include it.
* deps.mk (term.o, tparam.o): Depend on tparam.h.
* term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
Move these decls to tparam.h, and make them agree with what
is actually in tparam.c. The previous trick of using incompatible
decls in different modules does not conform to the C standard.
All callers of tparam changed to use tparam's actual API.
* tparam.c (tparam1, tparam, tgoto):
Use const pointers where appropriate.
2011-03-08 18:26:34 +00:00
|
|
|
|
buf = tparam (multi, 0, 0, i, 0, 0, 0);
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
OUTPUT (tty, buf);
|
Put interrupt input blocking in a separate file from xterm.h.
This isn't specific to X, and it allows us to avoid #including
xterm.h in files that don't really have anything to do with X.
* blockinput.h: New file.
* xterm.h (BLOCK_INPUT, UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT,
UNBLOCK_INPUT_RESIGNAL): These are now in blockinput.h.
(x_input_blocked, x_pending_input): Deleted; there are analogs
in blockinput.h called interrupt_input_blocked and
interrupt_input_pending.
* keyboard.c (interrupt_input_blocked, interrupt_input_pending):
New variables, used by the macros in blockinput.h.
* xterm.c: #include blockinput.h.
(x_input_blocked, x_pending_input): Deleted.
(XTread_socket): Test and set interrupt_input_blocked and
interrupt_input_pending instead of the old variables.
* alloc.c, xfaces.c, xfns.c, xmenu.c, xselect.c, keymap.c:
#include blockinput.h.
* eval.c: #include blockinput.h instead of xterm.h.
* keyboard.c: #include blockinput.h.
(input_poll_signal): Just test
interrupt_input_blocked, instead of testing HAVE_X_WINDOWS and
x_input_blocked.
Block the processing of interrupt input while we're manipulating the
malloc heap.
* alloc.c: (xfree): New function, to make it easy to free things
safely.
(xmalloc, xrealloc): Block X input while doing the deed.
(VALIDATE_LISP_STORAGE, gc_sweep, compact_strings): Use xfree
instead of free.
(uninterrupt_malloc): New function, to install input-blocking
hooks into the GNU malloc routines.
* emacs.c [not SYSTEM_MALLOC] (main): Call uninterrupt_malloc
on startup.
* alloc.c: (make_interval, make_float, Fcons, Fmake_vector,
Fmake_symbol, Fmake_marker, make_uninit_string, Fgarbage_collect):
Use xmalloc instead of malloc; don't bother to check if out of
memory here.
(Fgarbage_collect): Call xrealloc instead of realloc.
* buffer.c: Use xmalloc and xfree instead of malloc and free;
don't bother to check if out of memory here.
(Fget_buffer_create): Put BLOCK_INPUT/UNBLOCK_INPUT pair around
calls to ralloc routines.
* insdel.c: Same.
* lisp.h (xfree): New extern declaration.
* xfaces.c (xfree): Don't #define this to be free; use the
definition in alloc.c.
* dispnew.c, doc.c, doprnt.c, fileio.c, lread.c, term.c, xfns.c,
xmenu.c, xterm.c: Use xfree instead of free.
* hftctl.c: Use xfree and xmalloc instead of free and malloc.
* keymap.c (current_minor_maps): BLOCK_INPUT while calling realloc
and malloc.
* search.c: Since the regexp routines can malloc, BLOCK_INPUT
while runing them. #include blockinput.h.
* sysdep.c: #include blockinput.h. Call xfree and xmalloc instead
of free and malloc. BLOCK_INPUT around routines which we know
will call malloc.
ymakefile (keyboard.o, keymap.o, search.o, sysdep.o, xfaces.o,
xfns.o, xmenu.o, xterm.o, xselect.o, alloc.o, eval.o): Note that
these depend on blockinput.h.
1993-03-31 10:55:33 +00:00
|
|
|
|
xfree (buf);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
else if (single)
|
|
|
|
|
{
|
2004-04-18 01:08:46 +00:00
|
|
|
|
raw_cursor_to (f, vpos, 0);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_background_highlight (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
while (--i >= 0)
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
OUTPUT (tty, single);
|
|
|
|
|
if (tty->TF_teleray)
|
|
|
|
|
curX (tty) = 0;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_set_scroll_region (f, vpos, tty->specified_window);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
if (n < 0)
|
2004-04-18 01:08:46 +00:00
|
|
|
|
raw_cursor_to (f, tty->specified_window - 1, 0);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
else
|
2004-04-18 01:08:46 +00:00
|
|
|
|
raw_cursor_to (f, vpos, 0);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_background_highlight (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
while (--i >= 0)
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
OUTPUTL (tty, scroll, tty->specified_window - vpos);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
tty_set_scroll_region (f, 0, tty->specified_window);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
if (!FRAME_SCROLL_REGION_OK (f)
|
|
|
|
|
&& FRAME_MEMORY_BELOW_FRAME (f)
|
|
|
|
|
&& n < 0)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
2014-08-10 08:26:28 +00:00
|
|
|
|
cursor_to (f, FRAME_TOTAL_LINES (f) + n, 0);
|
Eliminated updating_frame.
src/termhooks.h (cursor_to_hook, raw_cursor_to_hook)
(clear_to_end_hook, clear_end_of_line_hook, clear_frame_hook)
(ins_del_lines_hook, insert_glyphs_hook, write_glyphs_hook)
(delete_glyphs_hook, ring_bell_hook, set_terminal_window_hook):
Added frame parameter.
src/term.c (ring_bell, tty_ring_bell, set_terminal_window)
(tty_set_terminal_window, set_scroll_region, cursor_to)
(tty_cursor_to, raw_cursor_to, tty_raw_cursor_to, clear_to_end)
(tty_clear_to_end, clear_frame, tty_clear_frame, clear_end_of_line)
(tty_clear_end_of_line, write_glyphs, tty_write_glyphs, insert_glyphs)
(tty_insert_glyphs, delete_glyphs, tty_delete_glyphs, ins_del_lines)
(tty_ins_del_lines): Added frame parameter.
src/xterm.c (x_delete_glyphs, x_clear_frame, x_ins_del_lines):
Added frame parameter.
src/scroll.c (do_direct_scrolling, do_scrolling): Added frame parameter.
src/term.c (update_begin, update_end): Don't set updating_frame.
src/xfns.c (x_set_tool_bar_lines): Ditto.
src/term.c (updating_frame): Removed.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame, direct_output_for_insert)
(direct_output_forward_char, update_frame_1, update_frame_line)
(ding, bitch_at_user): Added frame parameter to calls to redisplay.
src/xdisp.c (try_window_id): Ditto.
src/scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): Ditto.
src/fileio.c (auto_save_error): Ditto.
src/term.c (tty_ring_bell): Flush the output stream after beeping.
src/dispnew.c (ding, bitch_at_user): Don't fflush CURTTY.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-140
2004-04-16 15:03:58 +00:00
|
|
|
|
clear_to_end (f);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Compute cost of sending "str", in characters,
|
|
|
|
|
not counting any line-dependent padding. */
|
|
|
|
|
|
|
|
|
|
int
|
Use const char* instead of char*.
Reduce the number of warnings with -Wwrite-strings.
* src/xrdb.c (get_environ_db, get_system_name):
* src/unexelf.c (find_section):
* src/term.c (string_cost, string_cost_one_line, per_line_cost)
(get_named_tty, init_tty):
* src/sysdep.c (sys_subshell):
* src/sound.c (sound_perror, sound_warning, vox_open, vox_init)
(alsa_sound_perror, alsa_open, alsa_configure, alsa_init):
* src/search.c (Freplace_match):
* src/process.c (Fmake_network_process, send_process, init_process):
* src/lread.c (Fload, init_lread):
* src/keymap.c (Fdescribe_buffer_bindings, describe_map_tree):
* src/keyboard.c (parse_tool_bar_item, struct event_head):
* src/gtkutil.h (xg_get_font_name):
* src/gtkutil.c (get_dialog_title, create_dialog, xg_get_font_name)
(make_widget_for_menu_item, make_menu_item, create_menus)
(xg_make_tool_item):
* src/font.c (parse_matrix, font_parse_name):
* src/floatfns.c (rounding_driver, float_error_fn_name):
* src/filelock.c (get_boot_time_1, lock_file_1):
* src/fileio.c (barf_or_query_if_file_exists, check_writable):
* src/editfns.c (get_system_name, get_operating_system_release)
(Fencode_time, Fset_time_zone_rule):
* src/dispextern.h (string_cost, per_line_cost, get_named_tty, init_tty):
* src/buffer.c (defvar_per_buffer): Use const.
2010-08-09 09:35:21 +00:00
|
|
|
|
string_cost (const char *str)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
|
|
|
|
cost = 0;
|
|
|
|
|
if (str)
|
|
|
|
|
tputs (str, 0, evalcost);
|
|
|
|
|
return cost;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Compute cost of sending "str", in characters,
|
|
|
|
|
counting any line-dependent padding at one line. */
|
|
|
|
|
|
|
|
|
|
static int
|
Use const char* instead of char*.
Reduce the number of warnings with -Wwrite-strings.
* src/xrdb.c (get_environ_db, get_system_name):
* src/unexelf.c (find_section):
* src/term.c (string_cost, string_cost_one_line, per_line_cost)
(get_named_tty, init_tty):
* src/sysdep.c (sys_subshell):
* src/sound.c (sound_perror, sound_warning, vox_open, vox_init)
(alsa_sound_perror, alsa_open, alsa_configure, alsa_init):
* src/search.c (Freplace_match):
* src/process.c (Fmake_network_process, send_process, init_process):
* src/lread.c (Fload, init_lread):
* src/keymap.c (Fdescribe_buffer_bindings, describe_map_tree):
* src/keyboard.c (parse_tool_bar_item, struct event_head):
* src/gtkutil.h (xg_get_font_name):
* src/gtkutil.c (get_dialog_title, create_dialog, xg_get_font_name)
(make_widget_for_menu_item, make_menu_item, create_menus)
(xg_make_tool_item):
* src/font.c (parse_matrix, font_parse_name):
* src/floatfns.c (rounding_driver, float_error_fn_name):
* src/filelock.c (get_boot_time_1, lock_file_1):
* src/fileio.c (barf_or_query_if_file_exists, check_writable):
* src/editfns.c (get_system_name, get_operating_system_release)
(Fencode_time, Fset_time_zone_rule):
* src/dispextern.h (string_cost, per_line_cost, get_named_tty, init_tty):
* src/buffer.c (defvar_per_buffer): Use const.
2010-08-09 09:35:21 +00:00
|
|
|
|
string_cost_one_line (const char *str)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
|
|
|
|
cost = 0;
|
|
|
|
|
if (str)
|
|
|
|
|
tputs (str, 1, evalcost);
|
|
|
|
|
return cost;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Compute per line amount of line-dependent padding,
|
|
|
|
|
in tenths of characters. */
|
|
|
|
|
|
|
|
|
|
int
|
Use const char* instead of char*.
Reduce the number of warnings with -Wwrite-strings.
* src/xrdb.c (get_environ_db, get_system_name):
* src/unexelf.c (find_section):
* src/term.c (string_cost, string_cost_one_line, per_line_cost)
(get_named_tty, init_tty):
* src/sysdep.c (sys_subshell):
* src/sound.c (sound_perror, sound_warning, vox_open, vox_init)
(alsa_sound_perror, alsa_open, alsa_configure, alsa_init):
* src/search.c (Freplace_match):
* src/process.c (Fmake_network_process, send_process, init_process):
* src/lread.c (Fload, init_lread):
* src/keymap.c (Fdescribe_buffer_bindings, describe_map_tree):
* src/keyboard.c (parse_tool_bar_item, struct event_head):
* src/gtkutil.h (xg_get_font_name):
* src/gtkutil.c (get_dialog_title, create_dialog, xg_get_font_name)
(make_widget_for_menu_item, make_menu_item, create_menus)
(xg_make_tool_item):
* src/font.c (parse_matrix, font_parse_name):
* src/floatfns.c (rounding_driver, float_error_fn_name):
* src/filelock.c (get_boot_time_1, lock_file_1):
* src/fileio.c (barf_or_query_if_file_exists, check_writable):
* src/editfns.c (get_system_name, get_operating_system_release)
(Fencode_time, Fset_time_zone_rule):
* src/dispextern.h (string_cost, per_line_cost, get_named_tty, init_tty):
* src/buffer.c (defvar_per_buffer): Use const.
2010-08-09 09:35:21 +00:00
|
|
|
|
per_line_cost (const char *str)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
|
|
|
|
cost = 0;
|
|
|
|
|
if (str)
|
|
|
|
|
tputs (str, 0, evalcost);
|
|
|
|
|
cost = - cost;
|
|
|
|
|
if (str)
|
|
|
|
|
tputs (str, 10, evalcost);
|
|
|
|
|
return cost;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* char_ins_del_cost[n] is cost of inserting N characters.
|
1995-02-17 08:42:18 +00:00
|
|
|
|
char_ins_del_cost[-n] is cost of deleting N characters.
|
2003-05-24 22:09:50 +00:00
|
|
|
|
The length of this vector is based on max_frame_cols. */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
|
|
|
|
int *char_ins_del_vector;
|
|
|
|
|
|
2003-05-24 22:09:50 +00:00
|
|
|
|
#define char_ins_del_cost(f) (&char_ins_del_vector[FRAME_COLS ((f))])
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
|
|
|
|
/* ARGSUSED */
|
|
|
|
|
static void
|
2004-04-18 01:08:46 +00:00
|
|
|
|
calculate_ins_del_char_costs (struct frame *f)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Separate frame-local, tty-dependent parameters from tty-local parameters.
src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters. (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.
src/term.c: Update prototypes. Use tty_display_info instead of tty_output.
src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.
src/cm.h: Update prototypes.
src/dispextern.h: Ditto.
src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.
src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output. Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty. Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty. Use reference count to
decide if the tty should be closed.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.
src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.
src/lisp.h: Declare struct display. Update prototypes.
src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
2004-01-01 17:55:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
int ins_startup_cost, del_startup_cost;
|
|
|
|
|
int ins_cost_per_char, del_cost_per_char;
|
|
|
|
|
register int i;
|
|
|
|
|
register int *p;
|
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_ins_multi_chars)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
|
|
|
|
ins_cost_per_char = 0;
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
ins_startup_cost = string_cost_one_line (tty->TS_ins_multi_chars);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
else if (tty->TS_ins_char || tty->TS_pad_inserted_char
|
|
|
|
|
|| (tty->TS_insert_mode && tty->TS_end_insert_mode))
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
ins_startup_cost = (30 * (string_cost (tty->TS_insert_mode)
|
|
|
|
|
+ string_cost (tty->TS_end_insert_mode))) / 100;
|
|
|
|
|
ins_cost_per_char = (string_cost_one_line (tty->TS_ins_char)
|
|
|
|
|
+ string_cost_one_line (tty->TS_pad_inserted_char));
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ins_startup_cost = 9999;
|
|
|
|
|
ins_cost_per_char = 0;
|
|
|
|
|
}
|
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_del_multi_chars)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
|
|
|
|
del_cost_per_char = 0;
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
del_startup_cost = string_cost_one_line (tty->TS_del_multi_chars);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
else if (tty->TS_del_char)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
del_startup_cost = (string_cost (tty->TS_delete_mode)
|
|
|
|
|
+ string_cost (tty->TS_end_delete_mode));
|
|
|
|
|
if (tty->delete_in_insert_mode)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
del_startup_cost /= 2;
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
del_cost_per_char = string_cost_one_line (tty->TS_del_char);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
del_startup_cost = 9999;
|
|
|
|
|
del_cost_per_char = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Delete costs are at negative offsets */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
p = &char_ins_del_cost (f)[0];
|
|
|
|
|
for (i = FRAME_COLS (f); --i >= 0;)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
*--p = (del_startup_cost += del_cost_per_char);
|
|
|
|
|
|
|
|
|
|
/* Doing nothing is free */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
p = &char_ins_del_cost (f)[0];
|
1991-05-09 10:29:44 +00:00
|
|
|
|
*p++ = 0;
|
|
|
|
|
|
|
|
|
|
/* Insert costs are at positive offsets */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
for (i = FRAME_COLS (f); --i >= 0;)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
*p++ = (ins_startup_cost += ins_cost_per_char);
|
|
|
|
|
}
|
|
|
|
|
|
1998-04-14 12:25:56 +00:00
|
|
|
|
void
|
2004-04-18 01:08:46 +00:00
|
|
|
|
calculate_costs (struct frame *frame)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
1994-12-06 08:49:33 +00:00
|
|
|
|
FRAME_COST_BAUD_RATE (frame) = baud_rate;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Implemented multiple tty support.
README.multi-tty: New file.
src/termchar.h (struct terminal): Renamed to struct tty_output. Added name, type,
input, output, termscript, old_tty, term_initted, old_tty_valid,
background_pixel, foreground_pixel, next fields.
(TERMINAL_*): Renamed to TTY_* for brevity.
(CURRENT_TERMINAL): Renamed to CURTTY for brevity.
(tty_list): New variable.
(TERMINAL_PTR): Removed.
(FRAME_TTY): New function.
(TTY_NAME, TTY_TYPE): New macros.
src/term.c (current_terminal): Removed. (_current_terminal): Removed. (tty_list):
New variable. (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
parameter. (set_terminal_modes): Added tty parameter. (reset_terminal_modes):
Added tty parameter. (cursor_to, raw_cursor_to): Updated cmgoto() calls.
(clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
cmcheckmagic() calls. (get_named_tty): New function. (term_dummy_init): New
function. (term_init): Added name parameter, added tty_output return value.
Changed algorithm to update tty_list. Call init_sys_modes() to set up tty
mode on the newly opened terminal device.
(get_current_tty): New function, intended for debugging.
src/termhooks.h (termscript): Removed.
src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
definition.
src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
(current_tty): New variable, for cmputc().
(cmcheckmagic, cmputc, cmgoto): Added prototypes.
src/cm.c (current_tty): New variable, for cmputc().
(cmputc): Use it.
(cmcheckmagic): Added tty parameter, look up terminal streams there.
(calccost): Added tty parameter. Use emacs_tputs() instead of tputs().
(cmgoto): Added tty parameter. Pass it on to calccost(). Use emacs_tputs()
instead of tputs().
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
(term_init): Added name parameter (the filename of the terminal device). Added
return value (struct tty_output).
src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
(termscript): Moved to struct tty_output.
(terminal_type): Removed.
src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
during init_display().
(shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
src/frame.c (Qtty, Qtty_type): New variables.
(syms_of_frame): Initialize them.
(tty_display): Removed.
(make_terminal_frame): New parameters (tty filename and type).
Initialize output_data.tty field instead of output_data.x. Use term_init() to
find the right tty_output. (Use term_dummy_init() during bootstrap.)
(Fmake_terminal_frame): Get device filename and type from frame parameters.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
if the frame is a tty.
(struct frame): New member in output_data: tty.
(make_terminal_frame): Updated of prototype.
src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
reset_sys_modes(). Ditto with init_sys_modes().
src/lisp.h (tty_output): Added forward declaration.
(init_sys_modes, reset_sys_modes): Updated prototype.
(init_all_sys_modes, reset_all_sys_modes): New prototypes.
src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
(init_all_sys_modes): New function.
(init_sys_modes): Added tty_output parameter. Use it.
(reset_all_sys_modes): New function.
(reset_sys_modes): Added tty_output parameter. Use it.
src/Makefile.in: Update dependencies.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
2003-12-25 06:59:31 +00:00
|
|
|
|
if (FRAME_TERMCAP_P (frame))
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
{
|
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (frame);
|
2011-03-09 02:12:00 +00:00
|
|
|
|
register const char *f = (tty->TS_set_scroll_region
|
|
|
|
|
? tty->TS_set_scroll_region
|
|
|
|
|
: tty->TS_set_scroll_region_1);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
FRAME_SCROLL_REGION_COST (frame) = string_cost (f);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
tty->costs_set = 1;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
/* These variables are only used for terminal stuff. They are
|
|
|
|
|
allocated once for the terminal frame of X-windows emacs, but not
|
|
|
|
|
used afterwards.
|
1995-02-17 08:42:18 +00:00
|
|
|
|
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
char_ins_del_vector (i.e., char_ins_del_cost) isn't used because
|
|
|
|
|
X turns off char_ins_del_ok. */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
max_frame_cols = max (max_frame_cols, FRAME_COLS (frame));
|
2011-08-05 02:15:35 +00:00
|
|
|
|
if ((min (PTRDIFF_MAX, SIZE_MAX) / sizeof (int) - 1) / 2
|
|
|
|
|
< max_frame_cols)
|
2011-07-29 01:22:19 +00:00
|
|
|
|
memory_full (SIZE_MAX);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2011-08-05 02:15:35 +00:00
|
|
|
|
char_ins_del_vector =
|
|
|
|
|
xrealloc (char_ins_del_vector,
|
|
|
|
|
(sizeof (int) + 2 * sizeof (int) * max_frame_cols));
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
* alloc.c (overrun_check_malloc, overrun_check_realloc)
(overrun_check_free, xstrdup, allocate_string)
(allocate_string_data, compact_small_strings, Fmake_string)
(make_unibyte_string, make_multibyte_string)
(make_string_from_bytes, make_specified_string, make_float)
(Fcons, allocate_terminal, allocate_frame, make_pure_string)
(Fgarbage_collect): Replace bcopy, safe_bcopy, bzero, bcmp by
memcpy, memmove, memset, memcmp.
* atimer.c (start_atimer, set_alarm): Likewise.
* buffer.c (clone_per_buffer_values, report_overlay_modification)
(mmap_realloc, init_buffer_once): Likewise.
* callint.c (Fcall_interactively): Likewise.
* callproc.c (Fcall_process, Fcall_process_region, child_setup)
(getenv_internal_1): Likewise.
* casefiddle.c (casify_object): Likewise.
* ccl.c (ccl_driver): Likewise.
* character.c (str_as_multibyte, str_to_multibyte): Likewise.
* charset.c (load_charset_map_from_file)
(load_charset_map_from_file, load_charset_map_from_vector)
(Fdefine_charset_internal): Likewise.
* cm.c (Wcm_clear): Likewise.
* coding.c (decode_eol, decode_coding_object)
(Fset_coding_system_priority, make_subsidiaries): Likewise.
* data.c (Faset): Likewise.
* dired.c (directory_files_internal, file_name_completion_stat):
Likewise.
* dispnew.c (new_glyph_matrix, adjust_glyph_matrix)
(clear_glyph_row, copy_row_except_pointers)
(copy_glyph_row_contents, new_glyph_pool, realloc_glyph_pool)
(save_current_matrix, restore_current_matrix)
(build_frame_matrix_from_leaf_window, mirrored_line_dance)
(mirror_line_dance, scrolling_window): Likewise.
* doc.c (Fsnarf_documentation, Fsubstitute_command_keys):
Likewise.
* doprnt.c (doprnt): Likewise.
* editfns.c (Fuser_full_name, make_buffer_string_both)
(Fmessage_box, Fformat, Ftranspose_regions): Likewise.
* emacs.c (sort_args): Likewise.
* eval.c (Fapply, Ffuncall): Likewise.
* fileio.c (Ffile_name_directory, make_temp_name)
(Fexpand_file_name, search_embedded_absfilename)
(Fsubstitute_in_file_name, Ffile_symlink_p, Finsert_file_contents)
(auto_save_error): Likewise.
* fns.c (Fstring_equal, Fcopy_sequence, concat)
(string_to_multibyte, Fstring_as_unibyte, Fstring_as_multibyte)
(internal_equal, Fclear_string, larger_vector, copy_hash_table)
(Fmake_hash_table): Likewise.
* fringe.c (Fdefine_fringe_bitmap): Likewise.
* ftfont.c (ftfont_text_extents): Likewise.
* getloadavg.c (getloadavg): Likewise.
* image.c (define_image_type, make_image, make_image_cache)
(x_create_x_image_and_pixmap, xbm_image_p)
(w32_create_pixmap_from_bitmap_data, xbm_load, xpm_lookup_color)
(xpm_image_p, x_create_bitmap_from_xpm_data, xpm_load)
(init_color_table, x_build_heuristic_mask, pbm_image_p, pbm_load)
(png_image_p, png_read_from_memory, png_load, jpeg_image_p)
(tiff_image_p, tiff_read_from_memory, gif_image_p)
(gif_read_from_memory, gif_load, svg_image_p, gs_image_p):
Likewise.
* indent.c (scan_for_column, compute_motion): Likewise.
* insdel.c (gap_left, gap_right, make_gap_smaller, copy_text)
(insert_1_both, insert_from_gap, replace_range_2): Likewise.
* intervals.c (reproduce_tree, reproduce_tree_obj): Likewise.
* keyboard.c (echo_char, save_getcjmp, restore_getcjmp)
(kbd_buffer_store_event_hold, apply_modifiers_uncached)
(store_user_signal_events, menu_bar_items, tool_bar_items)
(process_tool_bar_item, append_tool_bar_item)
(read_char_minibuf_menu_prompt, read_key_sequence)
(Fread_key_sequence, Fread_key_sequence_vector, Frecent_keys):
Likewise.
* keymap.c (current_minor_maps, Fdescribe_buffer_bindings):
Likewise.
* lisp.h (STRING_COPYIN): Likewise.
* lread.c (Fload, read1, oblookup): Likewise.
* msdos.c (Frecent_doskeys): Likewise.
* nsfns.m (Fx_create_frame): Likewise.
* nsfont.m (nsfont_open, nsfont_text_extents, ns_glyph_metrics):
Likewise.
* nsimage.m (EmacsImage-initFromSkipXBM:width:height:)
(EmacsImage-initForXPMWithDepth:width:height:flip:length:):
Likewise.
* nsmenu.m (ns_update_menubar): Likewise.
* nsterm.m (ns_draw_fringe_bitmap, ns_term_init): Likewise.
* print.c (print_unwind, printchar, strout, print_string)
(print_error_message): Likewise.
* process.c (conv_lisp_to_sockaddr, set_socket_option)
(Fmake_network_process, Fnetwork_interface_list)
(Fnetwork_interface_info, read_process_output, Fprocess_send_eof)
(init_process): Likewise.
* ralloc.c (resize_bloc, r_alloc_sbrk, r_alloc_init): Likewise.
* regex.c (init_syntax_once, regex_compile, re_compile_fastmap):
Likewise.
* scroll.c (do_scrolling, do_direct_scrolling)
(scrolling_max_lines_saved): Likewise.
* search.c (search_buffer, wordify, Freplace_match): Likewise.
* sound.c (wav_init, au_init, Fplay_sound_internal): Likewise.
* syntax.c (skip_chars, skip_syntaxes): Likewise.
* sysdep.c (child_setup_tty, sys_subshell, emacs_get_tty)
(emacs_set_tty): Likewise.
* term.c (encode_terminal_code, calculate_costs)
(produce_special_glyphs, create_tty_output, init_tty, delete_tty):
Likewise.
* termcap.c (tgetst1, gobble_line): Likewise.
* termhooks.h (EVENT_INIT): Likewise.
* tparam.c (tparam1): Likewise.
* unexalpha.c (unexec): Likewise.
* unexec.c (write_segment): Likewise.
* unexmacosx.c (unexec_write_zero): Likewise.
* w32fns.c (w32_wnd_proc, Fx_create_frame, x_create_tip_frame)
(Fx_file_dialog, Fsystem_move_file_to_trash): Likewise.
* w32font.c (w32font_list_family, w32font_text_extents)
(w32font_list_internal, w32font_match_internal)
(w32font_open_internal, compute_metrics, Fx_select_font):
Likewise.
* w32menu.c (set_frame_menubar, add_menu_item)
(w32_menu_display_help, w32_free_submenu_strings): Likewise.
* w32term.c (XCreateGC, w32_initialize_display_info): Likewise.
* w32uniscribe.c (uniscribe_list_family): Likewise.
* w32xfns.c (get_next_msg, post_msg, prepend_msg): Likewise.
* window.c (make_window, replace_window, set_window_buffer)
(Fsplit_window): Likewise.
* xdisp.c (init_iterator, RECORD_OVERLAY_STRING, reseat_to_string)
(add_to_log, message3, x_consider_frame_title)
(append_space_for_newline, extend_face_to_end_of_line)
(decode_mode_spec_coding, init_glyph_string): Likewise.
* xfaces.c (x_create_gc, get_lface_attributes_no_remap)
(Finternal_copy_lisp_face, Finternal_merge_in_global_face)
(face_attr_equal_p, make_realized_face, make_face_cache)
(free_realized_faces, lookup_named_face, smaller_face)
(face_with_height, lookup_derived_face)
(x_supports_face_attributes_p, Finternal_set_font_selection_order)
(Finternal_set_font_selection_order, realize_default_face)
(compute_char_face, face_at_buffer_position)
(face_for_overlay_string, face_at_string_position, merge_faces):
Likewise.
* xfns.c (xic_create_fontsetname, Fx_create_frame)
(Fx_window_property, x_create_tip_frame)
(Fx_backspace_delete_keys_p): Likewise.
* xfont.c (xfont_list, xfont_match, xfont_list_family)
(xfont_text_extents): Likewise.
* xmenu.c (set_frame_menubar, xmenu_show): Likewise.
* xrdb.c (magic_file_p, x_get_resource): Likewise.
* xselect.c (x_queue_event, x_get_window_property)
(receive_incremental_selection): Likewise.
* xsmfns.c (x_session_check_input): Likewise.
* xterm.c (x_send_scroll_bar_event, SET_SAVED_MENU_EVENT)
(handle_one_xevent, x_check_errors, xim_initialize, x_term_init):
Likewise.
* character.h (BCOPY_SHORT): Removed.
* config.in: Regenerate.
* dispnew.c (safe_bcopy): Only define as dummy if PROFILING.
* emacs.c (main) [PROFILING]: Don't declare
dump_opcode_frequencies.
* lisp.h (safe_bcopy): Remove declaration.
(memset) [!HAVE_MEMSET]: Declare.
(memcpy) [!HAVE_MEMCPY]: Likewise.
(memmove) [!HAVE_MEMMOVE]: Likewise.
(memcmp) [!HAVE_MEMCMP]: Likewise.
* s/ms-w32.h (bzero, bcopy, bcmp, GAP_USE_BCOPY)
(BCOPY_UPWARD_SAFE, BCOPY_DOWNWARD_SAFE, HAVE_BCOPY, HAVE_BCMP):
Don't define.
(HAVE_MEMCMP, HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET): Define.
* s/msdos.h (GAP_USE_BCOPY, BCOPY_UPWARD_SAFE)
(BCOPY_DOWNWARD_SAFE): Don't define.
* sysdep.c (memset) [!HAVE_MEMSET]: Define.
(memcpy) [!HAVE_MEMCPY]: Define.
(memmove) [!HAVE_MEMMOVE]: Define.
(memcmp) [!HAVE_MEMCMP]: Define.
* config.nt (HAVE_BCOPY, HAVE_BCMP): Remove undefs.
(HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET, HAVE_MEMCMP): Add undefs.
* sed2v2.inp (HAVE_MEMCPY, HAVE_MEMSET): Edit to 1.
(HAVE_BZERO): Don't edit.
* lwlib.c (lwlib_memset, lwlib_bcopy): Remove.
(malloc_widget_value, free_widget_info, allocate_widget_instance)
(lw_separator_p): Replace lwlib_memset, lwlib_bcopy, bzero, bcmp by
memset, memcpy, memcmp.
* lwlib-utils.c (XtApplyToWidgets): Likewise.
* xlwmenu.c (XlwMenuInitialize): Likewise.
* lwlib.h (lwlib_bcopy): Remove declaration.
* ebrowse.c (add_sym, make_namespace): Replace bcopy, bzero by
memcpy, memmove, memset.
* pop.c (pop_retrieve, socket_connection, pop_getline): Likewise.
* CPP-DEFINES (BCOPY_DOWNWARD_SAFE, BCOPY_UPWARD_SAFE)
(GAP_USE_BCOPY, HAVE_BCMP, HAVE_BCOPY, bcmp, bcopy, bzero):
Remove.
* configure.in: Don't check for bcopy, bcmp, bzero. Don't include
<strings.h> and don't define bcopy, bzero, BCMP in config.h.
2010-07-07 22:18:28 +00:00
|
|
|
|
memset (char_ins_del_vector, 0,
|
2011-08-05 02:15:35 +00:00
|
|
|
|
(sizeof (int) + 2 * sizeof (int) * max_frame_cols));
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
|
|
|
|
|
if (f && (!tty->TS_ins_line && !tty->TS_del_line))
|
|
|
|
|
do_line_insertion_deletion_costs (frame,
|
|
|
|
|
tty->TS_rev_scroll, tty->TS_ins_multi_lines,
|
|
|
|
|
tty->TS_fwd_scroll, tty->TS_del_multi_lines,
|
|
|
|
|
f, f, 1);
|
|
|
|
|
else
|
|
|
|
|
do_line_insertion_deletion_costs (frame,
|
|
|
|
|
tty->TS_ins_line, tty->TS_ins_multi_lines,
|
|
|
|
|
tty->TS_del_line, tty->TS_del_multi_lines,
|
|
|
|
|
0, 0, 1);
|
|
|
|
|
|
|
|
|
|
calculate_ins_del_char_costs (frame);
|
|
|
|
|
|
|
|
|
|
/* Don't use TS_repeat if its padding is worse than sending the chars */
|
|
|
|
|
if (tty->TS_repeat && per_line_cost (tty->TS_repeat) * baud_rate < 9000)
|
|
|
|
|
tty->RPov = string_cost (tty->TS_repeat);
|
|
|
|
|
else
|
|
|
|
|
tty->RPov = FRAME_COLS (frame) * 2;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
cmcostinit (FRAME_TTY (frame)); /* set up cursor motion costs */
|
|
|
|
|
}
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
1992-02-04 02:27:43 +00:00
|
|
|
|
|
1992-08-19 06:38:40 +00:00
|
|
|
|
struct fkey_table {
|
2011-03-09 02:12:00 +00:00
|
|
|
|
const char *cap, *name;
|
1992-08-19 06:38:40 +00:00
|
|
|
|
};
|
|
|
|
|
|
2017-09-08 08:00:34 +00:00
|
|
|
|
#ifndef DOS_NT
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/* Termcap capability names that correspond directly to X keysyms.
|
|
|
|
|
Some of these (marked "terminfo") aren't supplied by old-style
|
|
|
|
|
(Berkeley) termcap entries. They're listed in X keysym order;
|
|
|
|
|
except we put the keypad keys first, so that if they clash with
|
|
|
|
|
other keys (as on the IBM PC keyboard) they get overridden.
|
|
|
|
|
*/
|
|
|
|
|
|
2010-08-06 18:41:15 +00:00
|
|
|
|
static const struct fkey_table keys[] =
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
2001-12-18 06:25:50 +00:00
|
|
|
|
{"kh", "home"}, /* termcap */
|
|
|
|
|
{"kl", "left"}, /* termcap */
|
|
|
|
|
{"ku", "up"}, /* termcap */
|
|
|
|
|
{"kr", "right"}, /* termcap */
|
|
|
|
|
{"kd", "down"}, /* termcap */
|
|
|
|
|
{"%8", "prior"}, /* terminfo */
|
|
|
|
|
{"%5", "next"}, /* terminfo */
|
|
|
|
|
{"@7", "end"}, /* terminfo */
|
|
|
|
|
{"@1", "begin"}, /* terminfo */
|
|
|
|
|
{"*6", "select"}, /* terminfo */
|
|
|
|
|
{"%9", "print"}, /* terminfo */
|
|
|
|
|
{"@4", "execute"}, /* terminfo --- actually the `command' key */
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/*
|
|
|
|
|
* "insert" --- see below
|
|
|
|
|
*/
|
2001-12-18 06:25:50 +00:00
|
|
|
|
{"&8", "undo"}, /* terminfo */
|
|
|
|
|
{"%0", "redo"}, /* terminfo */
|
|
|
|
|
{"%7", "menu"}, /* terminfo --- actually the `options' key */
|
|
|
|
|
{"@0", "find"}, /* terminfo */
|
|
|
|
|
{"@2", "cancel"}, /* terminfo */
|
|
|
|
|
{"%1", "help"}, /* terminfo */
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/*
|
|
|
|
|
* "break" goes here, but can't be reliably intercepted with termcap
|
|
|
|
|
*/
|
2001-12-18 06:25:50 +00:00
|
|
|
|
{"&4", "reset"}, /* terminfo --- actually `restart' */
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/*
|
|
|
|
|
* "system" and "user" --- no termcaps
|
|
|
|
|
*/
|
2001-12-18 06:25:50 +00:00
|
|
|
|
{"kE", "clearline"}, /* terminfo */
|
|
|
|
|
{"kA", "insertline"}, /* terminfo */
|
|
|
|
|
{"kL", "deleteline"}, /* terminfo */
|
|
|
|
|
{"kI", "insertchar"}, /* terminfo */
|
|
|
|
|
{"kD", "deletechar"}, /* terminfo */
|
|
|
|
|
{"kB", "backtab"}, /* terminfo */
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/*
|
|
|
|
|
* "kp_backtab", "kp-space", "kp-tab" --- no termcaps
|
|
|
|
|
*/
|
2001-12-18 06:25:50 +00:00
|
|
|
|
{"@8", "kp-enter"}, /* terminfo */
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/*
|
|
|
|
|
* "kp-f1", "kp-f2", "kp-f3" "kp-f4",
|
|
|
|
|
* "kp-multiply", "kp-add", "kp-separator",
|
|
|
|
|
* "kp-subtract", "kp-decimal", "kp-divide", "kp-0";
|
|
|
|
|
* --- no termcaps for any of these.
|
|
|
|
|
*/
|
2001-12-18 06:25:50 +00:00
|
|
|
|
{"K4", "kp-1"}, /* terminfo */
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/*
|
|
|
|
|
* "kp-2" --- no termcap
|
|
|
|
|
*/
|
2001-12-18 06:25:50 +00:00
|
|
|
|
{"K5", "kp-3"}, /* terminfo */
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/*
|
|
|
|
|
* "kp-4" --- no termcap
|
|
|
|
|
*/
|
2001-12-18 06:25:50 +00:00
|
|
|
|
{"K2", "kp-5"}, /* terminfo */
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/*
|
|
|
|
|
* "kp-6" --- no termcap
|
|
|
|
|
*/
|
2001-12-18 06:25:50 +00:00
|
|
|
|
{"K1", "kp-7"}, /* terminfo */
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/*
|
|
|
|
|
* "kp-8" --- no termcap
|
|
|
|
|
*/
|
2001-12-18 06:25:50 +00:00
|
|
|
|
{"K3", "kp-9"}, /* terminfo */
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/*
|
|
|
|
|
* "kp-equal" --- no termcap
|
|
|
|
|
*/
|
2001-12-18 06:25:50 +00:00
|
|
|
|
{"k1", "f1"},
|
|
|
|
|
{"k2", "f2"},
|
|
|
|
|
{"k3", "f3"},
|
|
|
|
|
{"k4", "f4"},
|
|
|
|
|
{"k5", "f5"},
|
|
|
|
|
{"k6", "f6"},
|
|
|
|
|
{"k7", "f7"},
|
|
|
|
|
{"k8", "f8"},
|
2005-04-17 01:37:38 +00:00
|
|
|
|
{"k9", "f9"},
|
|
|
|
|
|
|
|
|
|
{"&0", "S-cancel"}, /*shifted cancel key*/
|
|
|
|
|
{"&9", "S-begin"}, /*shifted begin key*/
|
|
|
|
|
{"*0", "S-find"}, /*shifted find key*/
|
|
|
|
|
{"*1", "S-execute"}, /*shifted execute? actually shifted command key*/
|
|
|
|
|
{"*4", "S-delete"}, /*shifted delete-character key*/
|
|
|
|
|
{"*7", "S-end"}, /*shifted end key*/
|
|
|
|
|
{"*8", "S-clearline"}, /*shifted clear-to end-of-line key*/
|
|
|
|
|
{"#1", "S-help"}, /*shifted help key*/
|
|
|
|
|
{"#2", "S-home"}, /*shifted home key*/
|
|
|
|
|
{"#3", "S-insert"}, /*shifted insert-character key*/
|
|
|
|
|
{"#4", "S-left"}, /*shifted left-arrow key*/
|
|
|
|
|
{"%d", "S-menu"}, /*shifted menu? actually shifted options key*/
|
|
|
|
|
{"%c", "S-next"}, /*shifted next key*/
|
|
|
|
|
{"%e", "S-prior"}, /*shifted previous key*/
|
|
|
|
|
{"%f", "S-print"}, /*shifted print key*/
|
|
|
|
|
{"%g", "S-redo"}, /*shifted redo key*/
|
|
|
|
|
{"%i", "S-right"}, /*shifted right-arrow key*/
|
|
|
|
|
{"!3", "S-undo"} /*shifted undo key*/
|
1992-08-19 06:38:40 +00:00
|
|
|
|
};
|
|
|
|
|
|
2005-06-26 03:20:47 +00:00
|
|
|
|
static char **term_get_fkeys_address;
|
|
|
|
|
static KBOARD *term_get_fkeys_kboard;
|
2010-07-05 10:36:06 +00:00
|
|
|
|
static Lisp_Object term_get_fkeys_1 (void);
|
1993-08-11 04:09:28 +00:00
|
|
|
|
|
2007-10-09 05:05:39 +00:00
|
|
|
|
/* Find the escape codes sent by the function keys for Vinput_decode_map.
|
2003-02-04 14:56:31 +00:00
|
|
|
|
This function scans the termcap function key sequence entries, and
|
2007-10-09 05:05:39 +00:00
|
|
|
|
adds entries to Vinput_decode_map for each function key it finds. */
|
1993-03-11 08:13:27 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
2010-07-05 10:36:06 +00:00
|
|
|
|
term_get_fkeys (char **address, KBOARD *kboard)
|
1994-03-08 06:20:26 +00:00
|
|
|
|
{
|
|
|
|
|
/* We run the body of the function (term_get_fkeys_1) and ignore all Lisp
|
|
|
|
|
errors during the call. The only errors should be from Fdefine_key
|
|
|
|
|
when given a key sequence containing an invalid prefix key. If the
|
|
|
|
|
termcap defines function keys which use a prefix that is already bound
|
|
|
|
|
to a command by the default bindings, we should silently ignore that
|
|
|
|
|
function key specification, rather than giving the user an error and
|
|
|
|
|
refusing to run at all on such a terminal. */
|
|
|
|
|
|
2005-06-26 03:20:47 +00:00
|
|
|
|
term_get_fkeys_address = address;
|
|
|
|
|
term_get_fkeys_kboard = kboard;
|
1994-03-08 06:20:26 +00:00
|
|
|
|
internal_condition_case (term_get_fkeys_1, Qerror, Fidentity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Lisp_Object
|
2010-07-05 10:36:06 +00:00
|
|
|
|
term_get_fkeys_1 (void)
|
1992-02-04 02:27:43 +00:00
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
2005-06-26 03:20:47 +00:00
|
|
|
|
char **address = term_get_fkeys_address;
|
|
|
|
|
KBOARD *kboard = term_get_fkeys_kboard;
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
1993-05-31 20:18:35 +00:00
|
|
|
|
/* This can happen if CANNOT_DUMP or with strange options. */
|
Hide implementation of `struct kboard'
* callint.c (Fcall_interactively): Update.
* doc.c (Fsubstitute_command_keys): Update.
* cmds.c (Fself_insert_command): Update.
* keymap.c (Fcurrent_active_maps, Fkey_binding)
(Fdescribe_buffer_bindings): Update.
* macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
(store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
Update.
* keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
(echo_length, echo_truncate, cmd_error, command_loop_1)
(read_char, kbd_buffer_store_event_hold, make_lispy_event)
(menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
(read_key_sequence, Fcommand_execute, Fexecute_extended_command)
(Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
Update.
* xfns.c (Fx_create_frame): Update.
* xterm.c (x_connection_closed, x_term_init): Update.
* term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
Update.
* window.c (window_scroll_pixel_based, window_scroll_line_based):
Update.
* frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
(delete_frame): Update.
* lisp.h (DEFVAR_KBOARD): Update for change to field names.
* keyboard.h (struct kboard): Rename all Lisp_Object fields.
(KBOARD_INTERNAL_FIELD, KVAR): New macros.
2011-02-16 16:35:16 +00:00
|
|
|
|
if (!KEYMAPP (KVAR (kboard, Vinput_decode_map)))
|
* keyboard.h (KSET): Remove.
Replace all uses with calls to new setter functions.
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
(KEYBOARD_INLINE): New macro.
(kset_default_minibuffer_frame, kset_defining_kbd_macro)
(kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
(kset_prefix_arg, kset_system_key_alist, kset_window_system):
New setter functions.
* keyboard.c (KEYBOARD_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
(kset_echo_string, kset_kbd_queue)
(kset_keyboard_translate_table, kset_last_prefix_arg)
(kset_last_repeatable_command, kset_local_function_key_map)
(kset_overriding_terminal_local_map, kset_real_last_command)
(kset_system_key_syms): New setter functions.
Fixes: debbugs:12215
2012-08-17 23:38:43 +00:00
|
|
|
|
kset_input_decode_map (kboard, Fmake_sparse_keymap (Qnil));
|
1993-05-31 20:18:35 +00:00
|
|
|
|
|
2014-04-03 20:46:04 +00:00
|
|
|
|
for (i = 0; i < ARRAYELTS (keys); i++)
|
1992-02-04 02:27:43 +00:00
|
|
|
|
{
|
|
|
|
|
char *sequence = tgetstr (keys[i].cap, address);
|
|
|
|
|
if (sequence)
|
Hide implementation of `struct kboard'
* callint.c (Fcall_interactively): Update.
* doc.c (Fsubstitute_command_keys): Update.
* cmds.c (Fself_insert_command): Update.
* keymap.c (Fcurrent_active_maps, Fkey_binding)
(Fdescribe_buffer_bindings): Update.
* macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
(store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
Update.
* keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
(echo_length, echo_truncate, cmd_error, command_loop_1)
(read_char, kbd_buffer_store_event_hold, make_lispy_event)
(menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
(read_key_sequence, Fcommand_execute, Fexecute_extended_command)
(Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
Update.
* xfns.c (Fx_create_frame): Update.
* xterm.c (x_connection_closed, x_term_init): Update.
* term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
Update.
* window.c (window_scroll_pixel_based, window_scroll_line_based):
Update.
* frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
(delete_frame): Update.
* lisp.h (DEFVAR_KBOARD): Update for change to field names.
* keyboard.h (struct kboard): Rename all Lisp_Object fields.
(KBOARD_INTERNAL_FIELD, KVAR): New macros.
2011-02-16 16:35:16 +00:00
|
|
|
|
Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence),
|
Add make_vector and make_nil_vector
This makes the callers a bit easier to read, and doubtless
improves efficiency very slightly. It also simplifies
possible future changes to allow bignum indexes to buffers.
* src/alloc.c (allocate_vectorlike):
Prefer ptrdiff_t to size_t when either will do.
(make_vector): New function.
(Fmake_vector): Use it.
* src/buffer.c (syms_of_buffer):
* src/bytecode.c (syms_of_bytecode):
* src/category.c (Fmake_category_table, init_category_once):
* src/ccl.c (syms_of_ccl):
* src/character.c (syms_of_character):
* src/charset.c (Fdefine_charset_internal)
(Ffind_charset_region, Ffind_charset_string):
* src/chartab.c (copy_char_table):
* src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
* src/composite.c (get_composition_id, Fcomposition_get_gstring):
* src/composite.h (LGLYPH_NEW):
* src/fns.c (concat, Flocale_info, make_hash_table):
* src/font.c (font_otf_ValueRecord, font_otf_anchor)
(build_style_table, syms_of_font):
* src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
(dump_fontset, syms_of_fontset):
* src/image.c (xpm_make_color_table_v):
* src/keyboard.c (modify_event_symbol, menu_bar_items)
(parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
(syms_of_keyboard):
* src/keymap.c (Fdefine_key, describe_map, describe_vector):
* src/lread.c (read_vector):
* src/macfont.m (macfont_shape):
* src/menu.c (init_menu_items):
* src/nsfns.m (ns_make_monitor_attribute_list):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
* src/profiler.c (make_log):
* src/window.c (Fcurrent_window_configuration):
* src/xdisp.c (with_echo_area_buffer_unwind_data)
(format_mode_line_unwind_data):
* src/xfaces.c (Finternal_make_lisp_face)
(Fface_attributes_as_vector):
* src/xfns.c (x_make_monitor_attribute_list)
(Fx_display_monitor_attributes_list):
* src/xfont.c (syms_of_xfont):
* src/xselect.c (x_handle_dnd_message):
* src/xwidget.c (save_script_callback):
Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
* src/callint.c (Fcall_interactively):
* src/charset.c (load_charset_map):
* src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
* src/composite.c (get_composition_id)
* src/dispnew.c (Fframe_or_buffer_changed_p)
(syms_of_display):
* src/fns.c (make_hash_table, maybe_resize_hash_table):
* src/font.c (font_style_to_value):
* src/fontset.c (FONTSET_ADD, fontset_add):
* src/json.c (json_to_lisp):
* src/keymap.c (syms_of_keymap):
* src/lread.c (init_obarray):
* src/profiler.c (make_log, Fprofiler_cpu_log):
* src/term.c (term_get_fkeys_1):
Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
* src/font.c (build_style_table):
* src/macfont.m (macfont_shape):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
Prefer make_uninit_vector if the vector will be initialized soon.
* src/lisp.h (make_nil_vector): New function.
2018-12-09 08:18:36 +00:00
|
|
|
|
make_vector (1, intern (keys[i].name)));
|
1992-02-04 02:27:43 +00:00
|
|
|
|
}
|
1992-08-19 06:38:40 +00:00
|
|
|
|
|
|
|
|
|
/* The uses of the "k0" capability are inconsistent; sometimes it
|
|
|
|
|
describes F10, whereas othertimes it describes F0 and "k;" describes F10.
|
1993-06-09 11:59:12 +00:00
|
|
|
|
We will attempt to politely accommodate both systems by testing for
|
1992-08-19 06:38:40 +00:00
|
|
|
|
"k;", and if it is present, assuming that "k0" denotes F0, otherwise F10.
|
|
|
|
|
*/
|
|
|
|
|
{
|
2011-03-09 02:12:00 +00:00
|
|
|
|
const char *k_semi = tgetstr ("k;", address);
|
|
|
|
|
const char *k0 = tgetstr ("k0", address);
|
|
|
|
|
const char *k0_name = "f10";
|
1992-08-19 06:38:40 +00:00
|
|
|
|
|
|
|
|
|
if (k_semi)
|
|
|
|
|
{
|
2002-02-02 23:48:37 +00:00
|
|
|
|
if (k0)
|
|
|
|
|
/* Define f0 first, so that f10 takes precedence in case the
|
|
|
|
|
key sequences happens to be the same. */
|
Hide implementation of `struct kboard'
* callint.c (Fcall_interactively): Update.
* doc.c (Fsubstitute_command_keys): Update.
* cmds.c (Fself_insert_command): Update.
* keymap.c (Fcurrent_active_maps, Fkey_binding)
(Fdescribe_buffer_bindings): Update.
* macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
(store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
Update.
* keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
(echo_length, echo_truncate, cmd_error, command_loop_1)
(read_char, kbd_buffer_store_event_hold, make_lispy_event)
(menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
(read_key_sequence, Fcommand_execute, Fexecute_extended_command)
(Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
Update.
* xfns.c (Fx_create_frame): Update.
* xterm.c (x_connection_closed, x_term_init): Update.
* term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
Update.
* window.c (window_scroll_pixel_based, window_scroll_line_based):
Update.
* frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
(delete_frame): Update.
* lisp.h (DEFVAR_KBOARD): Update for change to field names.
* keyboard.h (struct kboard): Rename all Lisp_Object fields.
(KBOARD_INTERNAL_FIELD, KVAR): New macros.
2011-02-16 16:35:16 +00:00
|
|
|
|
Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k0),
|
Add make_vector and make_nil_vector
This makes the callers a bit easier to read, and doubtless
improves efficiency very slightly. It also simplifies
possible future changes to allow bignum indexes to buffers.
* src/alloc.c (allocate_vectorlike):
Prefer ptrdiff_t to size_t when either will do.
(make_vector): New function.
(Fmake_vector): Use it.
* src/buffer.c (syms_of_buffer):
* src/bytecode.c (syms_of_bytecode):
* src/category.c (Fmake_category_table, init_category_once):
* src/ccl.c (syms_of_ccl):
* src/character.c (syms_of_character):
* src/charset.c (Fdefine_charset_internal)
(Ffind_charset_region, Ffind_charset_string):
* src/chartab.c (copy_char_table):
* src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
* src/composite.c (get_composition_id, Fcomposition_get_gstring):
* src/composite.h (LGLYPH_NEW):
* src/fns.c (concat, Flocale_info, make_hash_table):
* src/font.c (font_otf_ValueRecord, font_otf_anchor)
(build_style_table, syms_of_font):
* src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
(dump_fontset, syms_of_fontset):
* src/image.c (xpm_make_color_table_v):
* src/keyboard.c (modify_event_symbol, menu_bar_items)
(parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
(syms_of_keyboard):
* src/keymap.c (Fdefine_key, describe_map, describe_vector):
* src/lread.c (read_vector):
* src/macfont.m (macfont_shape):
* src/menu.c (init_menu_items):
* src/nsfns.m (ns_make_monitor_attribute_list):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
* src/profiler.c (make_log):
* src/window.c (Fcurrent_window_configuration):
* src/xdisp.c (with_echo_area_buffer_unwind_data)
(format_mode_line_unwind_data):
* src/xfaces.c (Finternal_make_lisp_face)
(Fface_attributes_as_vector):
* src/xfns.c (x_make_monitor_attribute_list)
(Fx_display_monitor_attributes_list):
* src/xfont.c (syms_of_xfont):
* src/xselect.c (x_handle_dnd_message):
* src/xwidget.c (save_script_callback):
Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
* src/callint.c (Fcall_interactively):
* src/charset.c (load_charset_map):
* src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
* src/composite.c (get_composition_id)
* src/dispnew.c (Fframe_or_buffer_changed_p)
(syms_of_display):
* src/fns.c (make_hash_table, maybe_resize_hash_table):
* src/font.c (font_style_to_value):
* src/fontset.c (FONTSET_ADD, fontset_add):
* src/json.c (json_to_lisp):
* src/keymap.c (syms_of_keymap):
* src/lread.c (init_obarray):
* src/profiler.c (make_log, Fprofiler_cpu_log):
* src/term.c (term_get_fkeys_1):
Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
* src/font.c (build_style_table):
* src/macfont.m (macfont_shape):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
Prefer make_uninit_vector if the vector will be initialized soon.
* src/lisp.h (make_nil_vector): New function.
2018-12-09 08:18:36 +00:00
|
|
|
|
make_vector (1, intern ("f0")));
|
Hide implementation of `struct kboard'
* callint.c (Fcall_interactively): Update.
* doc.c (Fsubstitute_command_keys): Update.
* cmds.c (Fself_insert_command): Update.
* keymap.c (Fcurrent_active_maps, Fkey_binding)
(Fdescribe_buffer_bindings): Update.
* macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
(store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
Update.
* keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
(echo_length, echo_truncate, cmd_error, command_loop_1)
(read_char, kbd_buffer_store_event_hold, make_lispy_event)
(menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
(read_key_sequence, Fcommand_execute, Fexecute_extended_command)
(Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
Update.
* xfns.c (Fx_create_frame): Update.
* xterm.c (x_connection_closed, x_term_init): Update.
* term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
Update.
* window.c (window_scroll_pixel_based, window_scroll_line_based):
Update.
* frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
(delete_frame): Update.
* lisp.h (DEFVAR_KBOARD): Update for change to field names.
* keyboard.h (struct kboard): Rename all Lisp_Object fields.
(KBOARD_INTERNAL_FIELD, KVAR): New macros.
2011-02-16 16:35:16 +00:00
|
|
|
|
Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k_semi),
|
Add make_vector and make_nil_vector
This makes the callers a bit easier to read, and doubtless
improves efficiency very slightly. It also simplifies
possible future changes to allow bignum indexes to buffers.
* src/alloc.c (allocate_vectorlike):
Prefer ptrdiff_t to size_t when either will do.
(make_vector): New function.
(Fmake_vector): Use it.
* src/buffer.c (syms_of_buffer):
* src/bytecode.c (syms_of_bytecode):
* src/category.c (Fmake_category_table, init_category_once):
* src/ccl.c (syms_of_ccl):
* src/character.c (syms_of_character):
* src/charset.c (Fdefine_charset_internal)
(Ffind_charset_region, Ffind_charset_string):
* src/chartab.c (copy_char_table):
* src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
* src/composite.c (get_composition_id, Fcomposition_get_gstring):
* src/composite.h (LGLYPH_NEW):
* src/fns.c (concat, Flocale_info, make_hash_table):
* src/font.c (font_otf_ValueRecord, font_otf_anchor)
(build_style_table, syms_of_font):
* src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
(dump_fontset, syms_of_fontset):
* src/image.c (xpm_make_color_table_v):
* src/keyboard.c (modify_event_symbol, menu_bar_items)
(parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
(syms_of_keyboard):
* src/keymap.c (Fdefine_key, describe_map, describe_vector):
* src/lread.c (read_vector):
* src/macfont.m (macfont_shape):
* src/menu.c (init_menu_items):
* src/nsfns.m (ns_make_monitor_attribute_list):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
* src/profiler.c (make_log):
* src/window.c (Fcurrent_window_configuration):
* src/xdisp.c (with_echo_area_buffer_unwind_data)
(format_mode_line_unwind_data):
* src/xfaces.c (Finternal_make_lisp_face)
(Fface_attributes_as_vector):
* src/xfns.c (x_make_monitor_attribute_list)
(Fx_display_monitor_attributes_list):
* src/xfont.c (syms_of_xfont):
* src/xselect.c (x_handle_dnd_message):
* src/xwidget.c (save_script_callback):
Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
* src/callint.c (Fcall_interactively):
* src/charset.c (load_charset_map):
* src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
* src/composite.c (get_composition_id)
* src/dispnew.c (Fframe_or_buffer_changed_p)
(syms_of_display):
* src/fns.c (make_hash_table, maybe_resize_hash_table):
* src/font.c (font_style_to_value):
* src/fontset.c (FONTSET_ADD, fontset_add):
* src/json.c (json_to_lisp):
* src/keymap.c (syms_of_keymap):
* src/lread.c (init_obarray):
* src/profiler.c (make_log, Fprofiler_cpu_log):
* src/term.c (term_get_fkeys_1):
Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
* src/font.c (build_style_table):
* src/macfont.m (macfont_shape):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
Prefer make_uninit_vector if the vector will be initialized soon.
* src/lisp.h (make_nil_vector): New function.
2018-12-09 08:18:36 +00:00
|
|
|
|
make_vector (1, intern ("f10")));
|
1992-08-19 06:38:40 +00:00
|
|
|
|
}
|
2002-02-02 23:48:37 +00:00
|
|
|
|
else if (k0)
|
Hide implementation of `struct kboard'
* callint.c (Fcall_interactively): Update.
* doc.c (Fsubstitute_command_keys): Update.
* cmds.c (Fself_insert_command): Update.
* keymap.c (Fcurrent_active_maps, Fkey_binding)
(Fdescribe_buffer_bindings): Update.
* macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
(store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
Update.
* keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
(echo_length, echo_truncate, cmd_error, command_loop_1)
(read_char, kbd_buffer_store_event_hold, make_lispy_event)
(menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
(read_key_sequence, Fcommand_execute, Fexecute_extended_command)
(Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
Update.
* xfns.c (Fx_create_frame): Update.
* xterm.c (x_connection_closed, x_term_init): Update.
* term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
Update.
* window.c (window_scroll_pixel_based, window_scroll_line_based):
Update.
* frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
(delete_frame): Update.
* lisp.h (DEFVAR_KBOARD): Update for change to field names.
* keyboard.h (struct kboard): Rename all Lisp_Object fields.
(KBOARD_INTERNAL_FIELD, KVAR): New macros.
2011-02-16 16:35:16 +00:00
|
|
|
|
Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k0),
|
Add make_vector and make_nil_vector
This makes the callers a bit easier to read, and doubtless
improves efficiency very slightly. It also simplifies
possible future changes to allow bignum indexes to buffers.
* src/alloc.c (allocate_vectorlike):
Prefer ptrdiff_t to size_t when either will do.
(make_vector): New function.
(Fmake_vector): Use it.
* src/buffer.c (syms_of_buffer):
* src/bytecode.c (syms_of_bytecode):
* src/category.c (Fmake_category_table, init_category_once):
* src/ccl.c (syms_of_ccl):
* src/character.c (syms_of_character):
* src/charset.c (Fdefine_charset_internal)
(Ffind_charset_region, Ffind_charset_string):
* src/chartab.c (copy_char_table):
* src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
* src/composite.c (get_composition_id, Fcomposition_get_gstring):
* src/composite.h (LGLYPH_NEW):
* src/fns.c (concat, Flocale_info, make_hash_table):
* src/font.c (font_otf_ValueRecord, font_otf_anchor)
(build_style_table, syms_of_font):
* src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
(dump_fontset, syms_of_fontset):
* src/image.c (xpm_make_color_table_v):
* src/keyboard.c (modify_event_symbol, menu_bar_items)
(parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
(syms_of_keyboard):
* src/keymap.c (Fdefine_key, describe_map, describe_vector):
* src/lread.c (read_vector):
* src/macfont.m (macfont_shape):
* src/menu.c (init_menu_items):
* src/nsfns.m (ns_make_monitor_attribute_list):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
* src/profiler.c (make_log):
* src/window.c (Fcurrent_window_configuration):
* src/xdisp.c (with_echo_area_buffer_unwind_data)
(format_mode_line_unwind_data):
* src/xfaces.c (Finternal_make_lisp_face)
(Fface_attributes_as_vector):
* src/xfns.c (x_make_monitor_attribute_list)
(Fx_display_monitor_attributes_list):
* src/xfont.c (syms_of_xfont):
* src/xselect.c (x_handle_dnd_message):
* src/xwidget.c (save_script_callback):
Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
* src/callint.c (Fcall_interactively):
* src/charset.c (load_charset_map):
* src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
* src/composite.c (get_composition_id)
* src/dispnew.c (Fframe_or_buffer_changed_p)
(syms_of_display):
* src/fns.c (make_hash_table, maybe_resize_hash_table):
* src/font.c (font_style_to_value):
* src/fontset.c (FONTSET_ADD, fontset_add):
* src/json.c (json_to_lisp):
* src/keymap.c (syms_of_keymap):
* src/lread.c (init_obarray):
* src/profiler.c (make_log, Fprofiler_cpu_log):
* src/term.c (term_get_fkeys_1):
Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
* src/font.c (build_style_table):
* src/macfont.m (macfont_shape):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
Prefer make_uninit_vector if the vector will be initialized soon.
* src/lisp.h (make_nil_vector): New function.
2018-12-09 08:18:36 +00:00
|
|
|
|
make_vector (1, intern (k0_name)));
|
1992-08-19 06:38:40 +00:00
|
|
|
|
}
|
1993-03-11 08:13:27 +00:00
|
|
|
|
|
|
|
|
|
/* Set up cookies for numbered function keys above f10. */
|
|
|
|
|
{
|
|
|
|
|
char fcap[3], fkey[4];
|
|
|
|
|
|
1993-06-05 07:56:46 +00:00
|
|
|
|
fcap[0] = 'F'; fcap[2] = '\0';
|
1993-03-11 08:13:27 +00:00
|
|
|
|
for (i = 11; i < 64; i++)
|
|
|
|
|
{
|
|
|
|
|
if (i <= 19)
|
|
|
|
|
fcap[1] = '1' + i - 11;
|
|
|
|
|
else if (i <= 45)
|
1995-01-19 18:56:43 +00:00
|
|
|
|
fcap[1] = 'A' + i - 20;
|
1993-03-11 08:13:27 +00:00
|
|
|
|
else
|
1995-01-19 18:56:43 +00:00
|
|
|
|
fcap[1] = 'a' + i - 46;
|
1993-03-11 08:13:27 +00:00
|
|
|
|
|
1993-06-05 07:56:46 +00:00
|
|
|
|
{
|
|
|
|
|
char *sequence = tgetstr (fcap, address);
|
|
|
|
|
if (sequence)
|
|
|
|
|
{
|
1993-08-11 04:09:28 +00:00
|
|
|
|
sprintf (fkey, "f%d", i);
|
Hide implementation of `struct kboard'
* callint.c (Fcall_interactively): Update.
* doc.c (Fsubstitute_command_keys): Update.
* cmds.c (Fself_insert_command): Update.
* keymap.c (Fcurrent_active_maps, Fkey_binding)
(Fdescribe_buffer_bindings): Update.
* macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
(store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
Update.
* keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
(echo_length, echo_truncate, cmd_error, command_loop_1)
(read_char, kbd_buffer_store_event_hold, make_lispy_event)
(menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
(read_key_sequence, Fcommand_execute, Fexecute_extended_command)
(Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
Update.
* xfns.c (Fx_create_frame): Update.
* xterm.c (x_connection_closed, x_term_init): Update.
* term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
Update.
* window.c (window_scroll_pixel_based, window_scroll_line_based):
Update.
* frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
(delete_frame): Update.
* lisp.h (DEFVAR_KBOARD): Update for change to field names.
* keyboard.h (struct kboard): Rename all Lisp_Object fields.
(KBOARD_INTERNAL_FIELD, KVAR): New macros.
2011-02-16 16:35:16 +00:00
|
|
|
|
Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence),
|
Add make_vector and make_nil_vector
This makes the callers a bit easier to read, and doubtless
improves efficiency very slightly. It also simplifies
possible future changes to allow bignum indexes to buffers.
* src/alloc.c (allocate_vectorlike):
Prefer ptrdiff_t to size_t when either will do.
(make_vector): New function.
(Fmake_vector): Use it.
* src/buffer.c (syms_of_buffer):
* src/bytecode.c (syms_of_bytecode):
* src/category.c (Fmake_category_table, init_category_once):
* src/ccl.c (syms_of_ccl):
* src/character.c (syms_of_character):
* src/charset.c (Fdefine_charset_internal)
(Ffind_charset_region, Ffind_charset_string):
* src/chartab.c (copy_char_table):
* src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
* src/composite.c (get_composition_id, Fcomposition_get_gstring):
* src/composite.h (LGLYPH_NEW):
* src/fns.c (concat, Flocale_info, make_hash_table):
* src/font.c (font_otf_ValueRecord, font_otf_anchor)
(build_style_table, syms_of_font):
* src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
(dump_fontset, syms_of_fontset):
* src/image.c (xpm_make_color_table_v):
* src/keyboard.c (modify_event_symbol, menu_bar_items)
(parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
(syms_of_keyboard):
* src/keymap.c (Fdefine_key, describe_map, describe_vector):
* src/lread.c (read_vector):
* src/macfont.m (macfont_shape):
* src/menu.c (init_menu_items):
* src/nsfns.m (ns_make_monitor_attribute_list):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
* src/profiler.c (make_log):
* src/window.c (Fcurrent_window_configuration):
* src/xdisp.c (with_echo_area_buffer_unwind_data)
(format_mode_line_unwind_data):
* src/xfaces.c (Finternal_make_lisp_face)
(Fface_attributes_as_vector):
* src/xfns.c (x_make_monitor_attribute_list)
(Fx_display_monitor_attributes_list):
* src/xfont.c (syms_of_xfont):
* src/xselect.c (x_handle_dnd_message):
* src/xwidget.c (save_script_callback):
Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
* src/callint.c (Fcall_interactively):
* src/charset.c (load_charset_map):
* src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
* src/composite.c (get_composition_id)
* src/dispnew.c (Fframe_or_buffer_changed_p)
(syms_of_display):
* src/fns.c (make_hash_table, maybe_resize_hash_table):
* src/font.c (font_style_to_value):
* src/fontset.c (FONTSET_ADD, fontset_add):
* src/json.c (json_to_lisp):
* src/keymap.c (syms_of_keymap):
* src/lread.c (init_obarray):
* src/profiler.c (make_log, Fprofiler_cpu_log):
* src/term.c (term_get_fkeys_1):
Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
* src/font.c (build_style_table):
* src/macfont.m (macfont_shape):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
Prefer make_uninit_vector if the vector will be initialized soon.
* src/lisp.h (make_nil_vector): New function.
2018-12-09 08:18:36 +00:00
|
|
|
|
make_vector (1, intern (fkey)));
|
1993-06-05 07:56:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
1993-03-11 08:13:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Various mappings to try and get a better fit.
|
|
|
|
|
*/
|
|
|
|
|
{
|
1993-06-05 07:56:46 +00:00
|
|
|
|
#define CONDITIONAL_REASSIGN(cap1, cap2, sym) \
|
|
|
|
|
if (!tgetstr (cap1, address)) \
|
|
|
|
|
{ \
|
|
|
|
|
char *sequence = tgetstr (cap2, address); \
|
2005-06-26 03:20:47 +00:00
|
|
|
|
if (sequence) \
|
Hide implementation of `struct kboard'
* callint.c (Fcall_interactively): Update.
* doc.c (Fsubstitute_command_keys): Update.
* cmds.c (Fself_insert_command): Update.
* keymap.c (Fcurrent_active_maps, Fkey_binding)
(Fdescribe_buffer_bindings): Update.
* macros.c (Fstart_kbd_macro, end_kbd_macro, Fend_kbd_macro)
(store_kbd_macro_char, Fcall_last_kbd_macro, Fexecute_kbd_macro):
Update.
* keyboard.c (echo_char, echo_dash, echo_now, cancel_echoing)
(echo_length, echo_truncate, cmd_error, command_loop_1)
(read_char, kbd_buffer_store_event_hold, make_lispy_event)
(menu_bar_items, tool_bar_items, read_char_minibuf_menu_prompt)
(read_key_sequence, Fcommand_execute, Fexecute_extended_command)
(Fdiscard_input, init_kboard, init_keyboard, mark_kboards):
Update.
* xfns.c (Fx_create_frame): Update.
* xterm.c (x_connection_closed, x_term_init): Update.
* term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN, init_tty):
Update.
* window.c (window_scroll_pixel_based, window_scroll_line_based):
Update.
* frame.c (make_frame_without_minibuffer, Fhandle_switch_frame)
(delete_frame): Update.
* lisp.h (DEFVAR_KBOARD): Update for change to field names.
* keyboard.h (struct kboard): Rename all Lisp_Object fields.
(KBOARD_INTERNAL_FIELD, KVAR): New macros.
2011-02-16 16:35:16 +00:00
|
|
|
|
Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence), \
|
Add make_vector and make_nil_vector
This makes the callers a bit easier to read, and doubtless
improves efficiency very slightly. It also simplifies
possible future changes to allow bignum indexes to buffers.
* src/alloc.c (allocate_vectorlike):
Prefer ptrdiff_t to size_t when either will do.
(make_vector): New function.
(Fmake_vector): Use it.
* src/buffer.c (syms_of_buffer):
* src/bytecode.c (syms_of_bytecode):
* src/category.c (Fmake_category_table, init_category_once):
* src/ccl.c (syms_of_ccl):
* src/character.c (syms_of_character):
* src/charset.c (Fdefine_charset_internal)
(Ffind_charset_region, Ffind_charset_string):
* src/chartab.c (copy_char_table):
* src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
* src/composite.c (get_composition_id, Fcomposition_get_gstring):
* src/composite.h (LGLYPH_NEW):
* src/fns.c (concat, Flocale_info, make_hash_table):
* src/font.c (font_otf_ValueRecord, font_otf_anchor)
(build_style_table, syms_of_font):
* src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
(dump_fontset, syms_of_fontset):
* src/image.c (xpm_make_color_table_v):
* src/keyboard.c (modify_event_symbol, menu_bar_items)
(parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
(syms_of_keyboard):
* src/keymap.c (Fdefine_key, describe_map, describe_vector):
* src/lread.c (read_vector):
* src/macfont.m (macfont_shape):
* src/menu.c (init_menu_items):
* src/nsfns.m (ns_make_monitor_attribute_list):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
* src/profiler.c (make_log):
* src/window.c (Fcurrent_window_configuration):
* src/xdisp.c (with_echo_area_buffer_unwind_data)
(format_mode_line_unwind_data):
* src/xfaces.c (Finternal_make_lisp_face)
(Fface_attributes_as_vector):
* src/xfns.c (x_make_monitor_attribute_list)
(Fx_display_monitor_attributes_list):
* src/xfont.c (syms_of_xfont):
* src/xselect.c (x_handle_dnd_message):
* src/xwidget.c (save_script_callback):
Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
* src/callint.c (Fcall_interactively):
* src/charset.c (load_charset_map):
* src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
* src/composite.c (get_composition_id)
* src/dispnew.c (Fframe_or_buffer_changed_p)
(syms_of_display):
* src/fns.c (make_hash_table, maybe_resize_hash_table):
* src/font.c (font_style_to_value):
* src/fontset.c (FONTSET_ADD, fontset_add):
* src/json.c (json_to_lisp):
* src/keymap.c (syms_of_keymap):
* src/lread.c (init_obarray):
* src/profiler.c (make_log, Fprofiler_cpu_log):
* src/term.c (term_get_fkeys_1):
Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
* src/font.c (build_style_table):
* src/macfont.m (macfont_shape):
* src/process.c (conv_sockaddr_to_lisp, network_interface_info):
Prefer make_uninit_vector if the vector will be initialized soon.
* src/lisp.h (make_nil_vector): New function.
2018-12-09 08:18:36 +00:00
|
|
|
|
make_vector (1, intern (sym))); \
|
1993-06-05 07:56:46 +00:00
|
|
|
|
}
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/* if there's no key_next keycap, map key_npage to `next' keysym */
|
1993-03-18 10:18:30 +00:00
|
|
|
|
CONDITIONAL_REASSIGN ("%5", "kN", "next");
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/* if there's no key_prev keycap, map key_ppage to `previous' keysym */
|
1993-06-13 00:41:51 +00:00
|
|
|
|
CONDITIONAL_REASSIGN ("%8", "kP", "prior");
|
1993-03-11 08:13:27 +00:00
|
|
|
|
/* if there's no key_dc keycap, map key_ic to `insert' keysym */
|
1993-03-18 10:18:30 +00:00
|
|
|
|
CONDITIONAL_REASSIGN ("kD", "kI", "insert");
|
1997-08-16 16:39:20 +00:00
|
|
|
|
/* if there's no key_end keycap, map key_ll to 'end' keysym */
|
|
|
|
|
CONDITIONAL_REASSIGN ("@7", "kH", "end");
|
1993-03-17 13:11:50 +00:00
|
|
|
|
#undef CONDITIONAL_REASSIGN
|
1993-03-11 08:13:27 +00:00
|
|
|
|
}
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
|
|
|
|
return Qnil;
|
1992-02-04 02:27:43 +00:00
|
|
|
|
}
|
Make building under stricter warning flags somewhat cleaner.
Flags used: -Wold-style-declaration -Wunused-function -Wstrict-prototypes
* lib-src/emacsclient.c (getcwd, w32_getenv):
* lib-src/ntlib.h (getlogin, getuid, getegid, getgid): Fix prototypes.
* nt/runemacs.c (set_user_model_id): Fix prototype.
* src/callproc.c (relocate_fd): Set inside #ifndef WINDOWSNT.
* src/dired.c (opendir, readdir): Fix prototypes.
* src/editfns.c (w32_get_internal_run_time): Fix prototypes.
* src/keyboard.c (input_available_signal): Declare inside #ifdef SIGIO.
* src/ndir.h (opendir, readdir, seekdir, closedir): Fix prototypes.
(telldir): Remove declaration.
* src/ralloc.c (real_morecore, __morecore): Fix prototypes.
* src/sound.c (alsa_sound_perror): Declare inside #ifdef HAVE_ALSA.
* src/syssignal.h (strsignal): Fix prototype.
* src/term.c (tparam): Fix prototype.
(term_get_fkeys_address, term_get_fkeys_kboard, term_get_fkeys_1)
(term_get_fkeys): Set inside "#ifndef DOS_NT".
* src/vm-limit.c (check_memory_limits): Fix prototypes of real_morecore
and __morecore.
* src/w32gui.h (XParseGeometry): Fix prototype.
* src/w32heap.h (get_data_start, get_data_end, init_heap): Fix prototypes.
* src/w32term.c (my_set_focus): Declare inside #if 0.
* src/w32term.h (x_window_to_frame, x_display_info_for_name, w32_term_init)
(w32_fill_rect, w32_clear_window, init_crit, delete_crit, signal_quit)
(drain_message_queue, get_next_msg, post_msg, parse_button)
(ClipboardSequence_Proc): Fix prototypes.
(wait_for_sync): Remove declaration.
2010-07-25 00:20:51 +00:00
|
|
|
|
#endif /* not DOS_NT */
|
1992-02-04 02:27:43 +00:00
|
|
|
|
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
/***********************************************************************
|
|
|
|
|
Character Display Information
|
|
|
|
|
***********************************************************************/
|
2010-07-02 12:19:53 +00:00
|
|
|
|
static void append_glyph (struct it *);
|
|
|
|
|
static void append_composite_glyph (struct it *);
|
|
|
|
|
static void produce_composite_glyph (struct it *);
|
2011-03-09 02:12:00 +00:00
|
|
|
|
static void append_glyphless_glyph (struct it *, int, const char *);
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
static void produce_glyphless_glyph (struct it *, Lisp_Object);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
|
|
|
|
/* Append glyphs to IT's glyph_row. Called from produce_glyphs for
|
2006-02-07 01:19:06 +00:00
|
|
|
|
terminal frames if IT->glyph_row != NULL. IT->char_to_display is
|
|
|
|
|
the character for which to produce glyphs; IT->face_id contains the
|
|
|
|
|
character's face. Padding glyphs are appended if IT->c has a
|
|
|
|
|
IT->pixel_width > 1. */
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
static void
|
2010-07-05 10:36:06 +00:00
|
|
|
|
append_glyph (struct it *it)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
|
|
|
|
struct glyph *glyph, *end;
|
|
|
|
|
int i;
|
|
|
|
|
|
2012-06-28 07:50:27 +00:00
|
|
|
|
eassert (it->glyph_row);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
glyph = (it->glyph_row->glyphs[it->area]
|
|
|
|
|
+ it->glyph_row->used[it->area]);
|
|
|
|
|
end = it->glyph_row->glyphs[1 + it->area];
|
|
|
|
|
|
2010-01-01 11:39:56 +00:00
|
|
|
|
/* If the glyph row is reversed, we need to prepend the glyph rather
|
|
|
|
|
than append it. */
|
|
|
|
|
if (it->glyph_row->reversed_p && it->area == TEXT_AREA)
|
|
|
|
|
{
|
|
|
|
|
struct glyph *g;
|
|
|
|
|
int move_by = it->pixel_width;
|
|
|
|
|
|
|
|
|
|
/* Make room for the new glyphs. */
|
|
|
|
|
if (move_by > end - glyph) /* don't overstep end of this area */
|
|
|
|
|
move_by = end - glyph;
|
|
|
|
|
for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
|
|
|
|
|
g[move_by] = *g;
|
|
|
|
|
glyph = it->glyph_row->glyphs[it->area];
|
|
|
|
|
end = glyph + move_by;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* BIDI Note: we put the glyphs of a "multi-pixel" character left to
|
|
|
|
|
right, even in the REVERSED_P case, since (a) all of its u.ch are
|
|
|
|
|
identical, and (b) the PADDING_P flag needs to be set for the
|
|
|
|
|
leftmost one, because we write to the terminal left-to-right. */
|
2003-02-04 14:56:31 +00:00
|
|
|
|
for (i = 0;
|
|
|
|
|
i < it->pixel_width && glyph < end;
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
++i)
|
|
|
|
|
{
|
|
|
|
|
glyph->type = CHAR_GLYPH;
|
2000-06-06 12:27:18 +00:00
|
|
|
|
glyph->pixel_width = 1;
|
2006-02-07 01:19:06 +00:00
|
|
|
|
glyph->u.ch = it->char_to_display;
|
1999-12-27 05:07:56 +00:00
|
|
|
|
glyph->face_id = it->face_id;
|
2016-07-02 13:56:36 +00:00
|
|
|
|
glyph->avoid_cursor_p = it->avoid_cursor_p;
|
|
|
|
|
glyph->multibyte_p = it->multibyte_p;
|
1999-12-27 05:07:56 +00:00
|
|
|
|
glyph->padding_p = i > 0;
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
glyph->charpos = CHARPOS (it->position);
|
|
|
|
|
glyph->object = it->object;
|
2010-01-01 11:39:56 +00:00
|
|
|
|
if (it->bidi_p)
|
|
|
|
|
{
|
|
|
|
|
glyph->resolved_level = it->bidi_it.resolved_level;
|
2014-10-14 09:16:02 +00:00
|
|
|
|
eassert ((it->bidi_it.type & 7) == it->bidi_it.type);
|
2010-01-01 11:39:56 +00:00
|
|
|
|
glyph->bidi_type = it->bidi_it.type;
|
|
|
|
|
}
|
2010-01-01 15:04:53 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
glyph->resolved_level = 0;
|
|
|
|
|
glyph->bidi_type = UNKNOWN_BT;
|
|
|
|
|
}
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
++it->glyph_row->used[it->area];
|
|
|
|
|
++glyph;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-30 17:32:44 +00:00
|
|
|
|
/* For external use. */
|
|
|
|
|
void
|
|
|
|
|
tty_append_glyph (struct it *it)
|
|
|
|
|
{
|
|
|
|
|
append_glyph (it);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-04-03 15:19:39 +00:00
|
|
|
|
/* Produce glyphs for the display element described by IT. *IT
|
|
|
|
|
specifies what we want to produce a glyph for (character, image, ...),
|
|
|
|
|
and where in the glyph matrix we currently are (glyph row and hpos).
|
|
|
|
|
produce_glyphs fills in output fields of *IT with information such as the
|
|
|
|
|
pixel width and height of a character, and maybe output actual glyphs at
|
2010-02-19 13:57:53 +00:00
|
|
|
|
the same time if IT->glyph_row is non-null. For an overview, see
|
|
|
|
|
the explanation in dispextern.h, before the definition of the
|
|
|
|
|
display_element_type enumeration.
|
2002-04-03 15:19:39 +00:00
|
|
|
|
|
|
|
|
|
produce_glyphs also stores the result of glyph width, ascent
|
|
|
|
|
etc. computations in *IT.
|
|
|
|
|
|
|
|
|
|
IT->glyph_row may be null, in which case produce_glyphs does not
|
|
|
|
|
actually fill in the glyphs. This is used in the move_* functions
|
|
|
|
|
in xdisp.c for text width and height computations.
|
|
|
|
|
|
|
|
|
|
Callers usually don't call produce_glyphs directly;
|
|
|
|
|
instead they use the macro PRODUCE_GLYPHS. */
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2003-02-04 14:56:31 +00:00
|
|
|
|
void
|
2010-07-05 10:36:06 +00:00
|
|
|
|
produce_glyphs (struct it *it)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
|
|
|
|
/* If a hook is installed, let it do the work. */
|
2006-10-26 12:00:50 +00:00
|
|
|
|
|
|
|
|
|
/* Nothing but characters are supported on terminal frames. */
|
2012-06-28 07:50:27 +00:00
|
|
|
|
eassert (it->what == IT_CHARACTER
|
1999-12-15 00:21:15 +00:00
|
|
|
|
|| it->what == IT_COMPOSITION
|
2011-07-07 15:39:23 +00:00
|
|
|
|
|| it->what == IT_STRETCH
|
|
|
|
|
|| it->what == IT_GLYPHLESS);
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2004-04-16 12:51:06 +00:00
|
|
|
|
if (it->what == IT_STRETCH)
|
|
|
|
|
{
|
|
|
|
|
produce_stretch_glyph (it);
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
|
|
|
|
|
2006-10-26 12:00:50 +00:00
|
|
|
|
if (it->what == IT_COMPOSITION)
|
|
|
|
|
{
|
|
|
|
|
produce_composite_glyph (it);
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2010-11-01 04:09:26 +00:00
|
|
|
|
if (it->what == IT_GLYPHLESS)
|
|
|
|
|
{
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
produce_glyphless_glyph (it, Qnil);
|
2010-11-01 04:09:26 +00:00
|
|
|
|
goto done;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-31 07:49:21 +00:00
|
|
|
|
if (it->char_to_display >= 040 && it->char_to_display < 0177)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
|
|
|
|
it->pixel_width = it->nglyphs = 1;
|
|
|
|
|
if (it->glyph_row)
|
|
|
|
|
append_glyph (it);
|
|
|
|
|
}
|
2010-08-31 07:49:21 +00:00
|
|
|
|
else if (it->char_to_display == '\n')
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
it->pixel_width = it->nglyphs = 0;
|
2010-08-31 07:49:21 +00:00
|
|
|
|
else if (it->char_to_display == '\t')
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
2000-04-24 13:53:16 +00:00
|
|
|
|
int absolute_x = (it->current_x
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
+ it->continuation_lines_width);
|
2017-06-30 09:24:13 +00:00
|
|
|
|
int x0 = absolute_x;
|
|
|
|
|
/* Adjust for line numbers. */
|
2018-03-07 18:40:44 +00:00
|
|
|
|
if (!NILP (Vdisplay_line_numbers) && it->line_number_produced_p)
|
2017-06-30 09:24:13 +00:00
|
|
|
|
absolute_x -= it->lnum_pixel_width;
|
2003-02-04 14:56:31 +00:00
|
|
|
|
int next_tab_x
|
|
|
|
|
= (((1 + absolute_x + it->tab_width - 1)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
/ it->tab_width)
|
|
|
|
|
* it->tab_width);
|
2018-03-07 18:40:44 +00:00
|
|
|
|
if (!NILP (Vdisplay_line_numbers) && it->line_number_produced_p)
|
2017-06-30 09:24:13 +00:00
|
|
|
|
next_tab_x += it->lnum_pixel_width;
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
int nspaces;
|
|
|
|
|
|
|
|
|
|
/* If part of the TAB has been displayed on the previous line
|
|
|
|
|
which is continued now, continuation_lines_width will have
|
|
|
|
|
been incremented already by the part that fitted on the
|
|
|
|
|
continued line. So, we will get the right number of spaces
|
|
|
|
|
here. */
|
2017-06-30 09:24:13 +00:00
|
|
|
|
nspaces = next_tab_x - x0;
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
if (it->glyph_row)
|
|
|
|
|
{
|
|
|
|
|
int n = nspaces;
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2006-02-07 01:19:06 +00:00
|
|
|
|
it->char_to_display = ' ';
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
it->pixel_width = it->len = 1;
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
while (n--)
|
|
|
|
|
append_glyph (it);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
it->pixel_width = nspaces;
|
|
|
|
|
it->nglyphs = nspaces;
|
|
|
|
|
}
|
2010-08-31 07:49:21 +00:00
|
|
|
|
else if (CHAR_BYTE8_P (it->char_to_display))
|
2000-05-28 13:23:02 +00:00
|
|
|
|
{
|
2010-08-31 07:49:21 +00:00
|
|
|
|
/* Coming here means that we must send the raw 8-bit byte as is
|
|
|
|
|
to the terminal. Although there's no way to know how many
|
|
|
|
|
columns it occupies on a screen, it is a good assumption that
|
|
|
|
|
a single byte code has 1-column width. */
|
|
|
|
|
it->pixel_width = it->nglyphs = 1;
|
|
|
|
|
if (it->glyph_row)
|
|
|
|
|
append_glyph (it);
|
2000-05-28 13:23:02 +00:00
|
|
|
|
}
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2010-11-01 04:09:26 +00:00
|
|
|
|
Lisp_Object charset_list = FRAME_TERMINAL (it->f)->charset_list;
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2010-11-01 04:09:26 +00:00
|
|
|
|
if (char_charset (it->char_to_display, charset_list, NULL))
|
|
|
|
|
{
|
2016-09-13 22:29:26 +00:00
|
|
|
|
it->pixel_width = CHARACTER_WIDTH (it->char_to_display);
|
2010-11-01 04:09:26 +00:00
|
|
|
|
it->nglyphs = it->pixel_width;
|
|
|
|
|
if (it->glyph_row)
|
|
|
|
|
append_glyph (it);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Lisp_Object acronym = lookup_glyphless_char_display (-1, it);
|
|
|
|
|
|
2012-06-28 07:50:27 +00:00
|
|
|
|
eassert (it->what == IT_GLYPHLESS);
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
produce_glyphless_glyph (it, acronym);
|
2010-11-01 04:09:26 +00:00
|
|
|
|
}
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-04-16 12:51:06 +00:00
|
|
|
|
done:
|
2003-02-04 14:56:31 +00:00
|
|
|
|
/* Advance current_x by the pixel width as a convenience for
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
the caller. */
|
|
|
|
|
if (it->area == TEXT_AREA)
|
|
|
|
|
it->current_x += it->pixel_width;
|
1999-08-06 13:59:39 +00:00
|
|
|
|
it->ascent = it->max_ascent = it->phys_ascent = it->max_phys_ascent = 0;
|
|
|
|
|
it->descent = it->max_descent = it->phys_descent = it->max_phys_descent = 1;
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-10-26 12:00:50 +00:00
|
|
|
|
/* Append glyphs to IT's glyph_row for the composition IT->cmp_id.
|
|
|
|
|
Called from produce_composite_glyph for terminal frames if
|
|
|
|
|
IT->glyph_row != NULL. IT->face_id contains the character's
|
|
|
|
|
face. */
|
|
|
|
|
|
|
|
|
|
static void
|
2010-07-05 10:36:06 +00:00
|
|
|
|
append_composite_glyph (struct it *it)
|
2006-10-26 12:00:50 +00:00
|
|
|
|
{
|
|
|
|
|
struct glyph *glyph;
|
|
|
|
|
|
2012-06-28 07:50:27 +00:00
|
|
|
|
eassert (it->glyph_row);
|
2006-10-26 12:00:50 +00:00
|
|
|
|
glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area];
|
|
|
|
|
if (glyph < it->glyph_row->glyphs[1 + it->area])
|
|
|
|
|
{
|
2010-04-20 13:08:35 +00:00
|
|
|
|
/* If the glyph row is reversed, we need to prepend the glyph
|
|
|
|
|
rather than append it. */
|
|
|
|
|
if (it->glyph_row->reversed_p && it->area == TEXT_AREA)
|
|
|
|
|
{
|
|
|
|
|
struct glyph *g;
|
|
|
|
|
|
|
|
|
|
/* Make room for the new glyph. */
|
|
|
|
|
for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
|
|
|
|
|
g[1] = *g;
|
|
|
|
|
glyph = it->glyph_row->glyphs[it->area];
|
|
|
|
|
}
|
2006-10-26 12:00:50 +00:00
|
|
|
|
glyph->type = COMPOSITE_GLYPH;
|
2016-04-01 09:47:29 +00:00
|
|
|
|
eassert (it->pixel_width <= SHRT_MAX);
|
2006-10-26 12:00:50 +00:00
|
|
|
|
glyph->pixel_width = it->pixel_width;
|
2008-08-29 07:57:13 +00:00
|
|
|
|
glyph->u.cmp.id = it->cmp_it.id;
|
|
|
|
|
if (it->cmp_it.ch < 0)
|
|
|
|
|
{
|
|
|
|
|
glyph->u.cmp.automatic = 0;
|
|
|
|
|
glyph->u.cmp.id = it->cmp_it.id;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
glyph->u.cmp.automatic = 1;
|
|
|
|
|
glyph->u.cmp.id = it->cmp_it.id;
|
2010-09-27 05:27:28 +00:00
|
|
|
|
glyph->slice.cmp.from = it->cmp_it.from;
|
|
|
|
|
glyph->slice.cmp.to = it->cmp_it.to - 1;
|
2008-08-29 07:57:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-07-02 13:56:36 +00:00
|
|
|
|
glyph->avoid_cursor_p = it->avoid_cursor_p;
|
|
|
|
|
glyph->multibyte_p = it->multibyte_p;
|
2006-10-26 12:00:50 +00:00
|
|
|
|
glyph->face_id = it->face_id;
|
2016-07-02 13:56:36 +00:00
|
|
|
|
glyph->padding_p = false;
|
2006-10-26 12:00:50 +00:00
|
|
|
|
glyph->charpos = CHARPOS (it->position);
|
|
|
|
|
glyph->object = it->object;
|
2010-04-20 13:08:35 +00:00
|
|
|
|
if (it->bidi_p)
|
|
|
|
|
{
|
|
|
|
|
glyph->resolved_level = it->bidi_it.resolved_level;
|
2014-10-14 09:16:02 +00:00
|
|
|
|
eassert ((it->bidi_it.type & 7) == it->bidi_it.type);
|
2010-04-20 13:08:35 +00:00
|
|
|
|
glyph->bidi_type = it->bidi_it.type;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
glyph->resolved_level = 0;
|
|
|
|
|
glyph->bidi_type = UNKNOWN_BT;
|
|
|
|
|
}
|
2006-10-26 12:00:50 +00:00
|
|
|
|
|
|
|
|
|
++it->glyph_row->used[it->area];
|
|
|
|
|
++glyph;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Produce a composite glyph for iterator IT. IT->cmp_id is the ID of
|
|
|
|
|
the composition. We simply produces components of the composition
|
2009-10-04 02:58:53 +00:00
|
|
|
|
assuming that the terminal has a capability to layout/render it
|
|
|
|
|
correctly. */
|
2006-10-26 12:00:50 +00:00
|
|
|
|
|
|
|
|
|
static void
|
2010-07-05 10:36:06 +00:00
|
|
|
|
produce_composite_glyph (struct it *it)
|
2006-10-26 12:00:50 +00:00
|
|
|
|
{
|
2008-08-29 07:57:13 +00:00
|
|
|
|
if (it->cmp_it.ch < 0)
|
|
|
|
|
{
|
|
|
|
|
struct composition *cmp = composition_table[it->cmp_it.id];
|
|
|
|
|
|
2015-01-03 22:37:05 +00:00
|
|
|
|
it->pixel_width = cmp->width;
|
2008-08-29 07:57:13 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Lisp_Object gstring = composition_gstring_from_id (it->cmp_it.id);
|
2006-10-26 12:00:50 +00:00
|
|
|
|
|
2008-08-29 07:57:13 +00:00
|
|
|
|
it->pixel_width = composition_gstring_width (gstring, it->cmp_it.from,
|
|
|
|
|
it->cmp_it.to, NULL);
|
|
|
|
|
}
|
|
|
|
|
it->nglyphs = 1;
|
2006-10-26 12:00:50 +00:00
|
|
|
|
if (it->glyph_row)
|
|
|
|
|
append_composite_glyph (it);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2010-11-01 04:09:26 +00:00
|
|
|
|
/* Append a glyph for a glyphless character to IT->glyph_row. FACE_ID
|
2010-11-13 13:29:31 +00:00
|
|
|
|
is a face ID to be used for the glyph. What is actually appended
|
|
|
|
|
are glyphs of type CHAR_GLYPH whose characters are in STR (which
|
|
|
|
|
comes from it->nglyphs bytes). */
|
2010-11-01 04:09:26 +00:00
|
|
|
|
|
|
|
|
|
static void
|
2011-03-09 02:12:00 +00:00
|
|
|
|
append_glyphless_glyph (struct it *it, int face_id, const char *str)
|
2010-11-01 04:09:26 +00:00
|
|
|
|
{
|
|
|
|
|
struct glyph *glyph, *end;
|
|
|
|
|
int i;
|
|
|
|
|
|
2012-06-28 07:50:27 +00:00
|
|
|
|
eassert (it->glyph_row);
|
2010-11-01 04:09:26 +00:00
|
|
|
|
glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area];
|
|
|
|
|
end = it->glyph_row->glyphs[1 + it->area];
|
|
|
|
|
|
|
|
|
|
/* If the glyph row is reversed, we need to prepend the glyph rather
|
|
|
|
|
than append it. */
|
|
|
|
|
if (it->glyph_row->reversed_p && it->area == TEXT_AREA)
|
|
|
|
|
{
|
|
|
|
|
struct glyph *g;
|
|
|
|
|
int move_by = it->pixel_width;
|
|
|
|
|
|
|
|
|
|
/* Make room for the new glyphs. */
|
|
|
|
|
if (move_by > end - glyph) /* don't overstep end of this area */
|
|
|
|
|
move_by = end - glyph;
|
|
|
|
|
for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
|
|
|
|
|
g[move_by] = *g;
|
|
|
|
|
glyph = it->glyph_row->glyphs[it->area];
|
|
|
|
|
end = glyph + move_by;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (glyph >= end)
|
|
|
|
|
return;
|
|
|
|
|
glyph->type = CHAR_GLYPH;
|
|
|
|
|
glyph->pixel_width = 1;
|
2016-07-02 13:56:36 +00:00
|
|
|
|
glyph->avoid_cursor_p = it->avoid_cursor_p;
|
|
|
|
|
glyph->multibyte_p = it->multibyte_p;
|
2010-11-01 04:09:26 +00:00
|
|
|
|
glyph->face_id = face_id;
|
2016-07-02 13:56:36 +00:00
|
|
|
|
glyph->padding_p = false;
|
2010-11-01 04:09:26 +00:00
|
|
|
|
glyph->charpos = CHARPOS (it->position);
|
|
|
|
|
glyph->object = it->object;
|
|
|
|
|
if (it->bidi_p)
|
|
|
|
|
{
|
|
|
|
|
glyph->resolved_level = it->bidi_it.resolved_level;
|
2014-10-14 09:16:02 +00:00
|
|
|
|
eassert ((it->bidi_it.type & 7) == it->bidi_it.type);
|
2010-11-01 04:09:26 +00:00
|
|
|
|
glyph->bidi_type = it->bidi_it.type;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
glyph->resolved_level = 0;
|
|
|
|
|
glyph->bidi_type = UNKNOWN_BT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* BIDI Note: we put the glyphs of characters left to right, even in
|
|
|
|
|
the REVERSED_P case because we write to the terminal
|
|
|
|
|
left-to-right. */
|
|
|
|
|
for (i = 0; i < it->nglyphs && glyph < end; ++i)
|
|
|
|
|
{
|
|
|
|
|
if (i > 0)
|
|
|
|
|
glyph[0] = glyph[-1];
|
|
|
|
|
glyph->u.ch = str[i];
|
|
|
|
|
++it->glyph_row->used[it->area];
|
|
|
|
|
++glyph;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Produce glyphs for a glyphless character for iterator IT.
|
|
|
|
|
IT->glyphless_method specifies which method to use for displaying
|
|
|
|
|
the character. See the description of enum
|
2010-11-13 13:29:31 +00:00
|
|
|
|
glyphless_display_method in dispextern.h for the details.
|
2010-11-01 04:09:26 +00:00
|
|
|
|
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
ACRONYM, if non-nil, is an acronym string for the character.
|
2010-11-01 04:09:26 +00:00
|
|
|
|
|
|
|
|
|
The glyphs actually produced are of type CHAR_GLYPH. */
|
|
|
|
|
|
|
|
|
|
static void
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
produce_glyphless_glyph (struct it *it, Lisp_Object acronym)
|
2010-11-01 04:09:26 +00:00
|
|
|
|
{
|
2013-09-06 16:40:12 +00:00
|
|
|
|
int len, face_id = merge_glyphless_glyph_face (it);
|
2016-09-15 22:25:33 +00:00
|
|
|
|
char buf[sizeof "\\x" + max (6, (INT_WIDTH + 3) / 4)];
|
2011-03-09 02:12:00 +00:00
|
|
|
|
char const *str = " ";
|
2010-11-01 04:09:26 +00:00
|
|
|
|
|
|
|
|
|
if (it->glyphless_method == GLYPHLESS_DISPLAY_THIN_SPACE)
|
|
|
|
|
{
|
2010-11-13 13:29:31 +00:00
|
|
|
|
/* As there's no way to produce a thin space, we produce a space
|
|
|
|
|
of canonical width. */
|
2010-11-01 04:09:26 +00:00
|
|
|
|
len = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (it->glyphless_method == GLYPHLESS_DISPLAY_EMPTY_BOX)
|
|
|
|
|
{
|
2016-09-13 22:29:26 +00:00
|
|
|
|
len = CHARACTER_WIDTH (it->c);
|
2010-11-01 04:09:26 +00:00
|
|
|
|
if (len == 0)
|
|
|
|
|
len = 1;
|
2010-11-13 13:29:31 +00:00
|
|
|
|
else if (len > 4)
|
2010-11-01 04:09:26 +00:00
|
|
|
|
len = 4;
|
2012-06-26 02:33:51 +00:00
|
|
|
|
len = sprintf (buf, "[%.*s]", len, str);
|
2010-11-13 13:29:31 +00:00
|
|
|
|
str = buf;
|
2010-11-01 04:09:26 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (it->glyphless_method == GLYPHLESS_DISPLAY_ACRONYM)
|
|
|
|
|
{
|
|
|
|
|
if (! STRINGP (acronym) && CHAR_TABLE_P (Vglyphless_char_display))
|
|
|
|
|
acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c);
|
2011-04-18 23:21:31 +00:00
|
|
|
|
if (CONSP (acronym))
|
|
|
|
|
acronym = XCDR (acronym);
|
2010-11-01 04:09:26 +00:00
|
|
|
|
buf[0] = '[';
|
2011-01-23 02:56:06 +00:00
|
|
|
|
str = STRINGP (acronym) ? SSDATA (acronym) : "";
|
Simplify and cleanup character conversion stuff.
* lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe):
Remove prototypes.
* character.c (multibyte_char_to_unibyte)
(multibyte_char_to_unibyte_safe): Remove; no longer used.
* character.h (make_char): Remove; unused.
(CHAR_TO_BYTE8, CHAR_TO_BYTE_SAFE): Simplify.
(ASCII_BYTE_P): Remove; ASCII_CHAR_P does the same thing.
* buffer.c, charset.c, charset.h, cmds.c, coding.c, editfns.c:
* fileio.c, indent.c, insdel.c, keyboard.c, lread.c, print.c:
* search.c, term.c, xdisp.c, xterm.c: Related users changed.
2014-06-23 04:11:29 +00:00
|
|
|
|
for (len = 0; len < 6 && str[len] && ASCII_CHAR_P (str[len]); len++)
|
2010-11-01 04:09:26 +00:00
|
|
|
|
buf[1 + len] = str[len];
|
|
|
|
|
buf[1 + len] = ']';
|
|
|
|
|
len += 2;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2012-06-28 07:50:27 +00:00
|
|
|
|
eassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE);
|
2015-04-25 05:37:11 +00:00
|
|
|
|
len = sprintf (buf,
|
|
|
|
|
(it->c < 0x10000 ? "\\u%04X"
|
|
|
|
|
: it->c <= MAX_UNICODE_CHAR ? "\\U%06X"
|
|
|
|
|
: "\\x%06X"),
|
|
|
|
|
it->c + 0u);
|
2010-11-01 04:09:26 +00:00
|
|
|
|
}
|
|
|
|
|
str = buf;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
it->pixel_width = len;
|
|
|
|
|
it->nglyphs = len;
|
2011-03-23 08:09:13 +00:00
|
|
|
|
if (it->glyph_row)
|
2010-11-01 04:09:26 +00:00
|
|
|
|
append_glyphless_glyph (it, face_id, str);
|
|
|
|
|
}
|
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
|
Faces
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
2000-04-01 13:33:12 +00:00
|
|
|
|
/* Value is non-zero if attribute ATTR may be used. ATTR should be
|
|
|
|
|
one of the enumerators from enum no_color_bit, or a bit set built
|
|
|
|
|
from them. Some display attributes may not be used together with
|
|
|
|
|
color; the termcap capability `NC' specifies which ones. */
|
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
#define MAY_USE_WITH_COLORS_P(tty, ATTR) \
|
|
|
|
|
(tty->TN_max_colors > 0 \
|
|
|
|
|
? (tty->TN_no_color_video & (ATTR)) == 0 \
|
|
|
|
|
: 1)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2005-06-17 14:08:58 +00:00
|
|
|
|
/* Turn appearances of face FACE_ID on tty frame F on.
|
|
|
|
|
FACE_ID is a realized face ID number, in the face cache. */
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
|
|
|
|
static void
|
2010-07-05 10:36:06 +00:00
|
|
|
|
turn_on_face (struct frame *f, int face_id)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
|
|
|
|
struct face *face = FACE_FROM_ID (f, face_id);
|
2013-11-06 00:14:56 +00:00
|
|
|
|
unsigned long fg = face->foreground;
|
|
|
|
|
unsigned long bg = face->background;
|
Separate frame-local, tty-dependent parameters from tty-local parameters.
src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters. (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.
src/term.c: Update prototypes. Use tty_display_info instead of tty_output.
src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.
src/cm.h: Update prototypes.
src/dispextern.h: Ditto.
src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.
src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output. Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty. Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty. Use reference count to
decide if the tty should be closed.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.
src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.
src/lisp.h: Declare struct display. Update prototypes.
src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
2004-01-01 17:55:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2013-11-06 00:14:56 +00:00
|
|
|
|
/* Use reverse video if the face specifies that.
|
|
|
|
|
Do this first because TS_end_standout_mode may be the same
|
2001-04-25 18:31:33 +00:00
|
|
|
|
as TS_exit_attribute_mode, which turns all appearances off. */
|
2013-11-06 00:14:56 +00:00
|
|
|
|
if (MAY_USE_WITH_COLORS_P (tty, NC_REVERSE)
|
|
|
|
|
&& (inverse_video
|
|
|
|
|
? fg == FACE_TTY_DEFAULT_FG_COLOR || bg == FACE_TTY_DEFAULT_BG_COLOR
|
|
|
|
|
: fg == FACE_TTY_DEFAULT_BG_COLOR || bg == FACE_TTY_DEFAULT_FG_COLOR))
|
|
|
|
|
tty_toggle_highlight (tty);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2009-06-27 21:27:51 +00:00
|
|
|
|
if (face->tty_bold_p && MAY_USE_WITH_COLORS_P (tty, NC_BOLD))
|
|
|
|
|
OUTPUT1_IF (tty, tty->TS_enter_bold_mode);
|
|
|
|
|
|
2012-06-09 16:44:44 +00:00
|
|
|
|
if (face->tty_italic_p && MAY_USE_WITH_COLORS_P (tty, NC_ITALIC))
|
|
|
|
|
{
|
|
|
|
|
if (tty->TS_enter_italic_mode)
|
|
|
|
|
OUTPUT1 (tty, tty->TS_enter_italic_mode);
|
|
|
|
|
else
|
|
|
|
|
/* Italics mode is unavailable on many terminals. In that
|
|
|
|
|
case, map slant to dimmed text; we want italic text to
|
|
|
|
|
appear different and dimming is not otherwise used. */
|
|
|
|
|
OUTPUT1 (tty, tty->TS_enter_dim_mode);
|
|
|
|
|
}
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE))
|
|
|
|
|
OUTPUT1_IF (tty, tty->TS_enter_underline_mode);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TN_max_colors > 0)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
2011-03-09 02:12:00 +00:00
|
|
|
|
const char *ts;
|
|
|
|
|
char *p;
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2005-09-04 03:48:17 +00:00
|
|
|
|
ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground;
|
2013-11-06 00:14:56 +00:00
|
|
|
|
if (face_tty_specified_color (fg) && ts)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
p = tparam (ts, NULL, 0, fg, 0, 0, 0);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
OUTPUT (tty, p);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
xfree (p);
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-04 03:48:17 +00:00
|
|
|
|
ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background;
|
2013-11-06 00:14:56 +00:00
|
|
|
|
if (face_tty_specified_color (bg) && ts)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
p = tparam (ts, NULL, 0, bg, 0, 0, 0);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
OUTPUT (tty, p);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
xfree (p);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
|
|
|
|
/* Turn off appearances of face FACE_ID on tty frame F. */
|
|
|
|
|
|
|
|
|
|
static void
|
2010-07-05 10:36:06 +00:00
|
|
|
|
turn_off_face (struct frame *f, int face_id)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
|
|
|
|
struct face *face = FACE_FROM_ID (f, face_id);
|
Separate frame-local, tty-dependent parameters from tty-local parameters.
src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters. (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.
src/term.c: Update prototypes. Use tty_display_info instead of tty_output.
src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.
src/cm.h: Update prototypes.
src/dispextern.h: Ditto.
src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.
src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output. Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty. Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty. Use reference count to
decide if the tty should be closed.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.
src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.
src/lisp.h: Declare struct display. Update prototypes.
src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
2004-01-01 17:55:53 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_exit_attribute_mode)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
|
|
|
|
/* Capability "me" will turn off appearance modes double-bright,
|
|
|
|
|
half-bright, reverse-video, standout, underline. It may or
|
|
|
|
|
may not turn off alt-char-mode. */
|
|
|
|
|
if (face->tty_bold_p
|
2012-06-09 16:44:44 +00:00
|
|
|
|
|| face->tty_italic_p
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|| face->tty_reverse_p
|
|
|
|
|
|| face->tty_underline_p)
|
2000-08-16 12:14:15 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT1_IF (tty, tty->TS_exit_attribute_mode);
|
|
|
|
|
if (strcmp (tty->TS_exit_attribute_mode, tty->TS_end_standout_mode) == 0)
|
|
|
|
|
tty->standout_mode = 0;
|
2000-08-16 12:14:15 +00:00
|
|
|
|
}
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* If we don't have "me" we can only have those appearances
|
|
|
|
|
that have exit sequences defined. */
|
2001-10-20 10:33:48 +00:00
|
|
|
|
if (face->tty_underline_p)
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT_IF (tty, tty->TS_exit_underline_mode);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Switch back to default colors. */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TN_max_colors > 0
|
Changes for separate unspecified foreground and background colors
on character terminals:
* dispextern.h (FACE_TTY_DEFAULT_FG_COLOR)
(FACE_TTY_DEFAULT_BG_COLOR): New macros.
* xfaces.c (Qunspecified_fg, Qunspecified_bg): New variables.
(syms_of_xfaces): Initialize and staticpro them.
(tty_defined_color): If the color name is unspecified-fg or
unspecified-bg, return FACE_TTY_DEFAULT_FG_COLOR and
FACE_TTY_DEFAULT_BG_COLOR, respectively, as the pixel value.
(tty_color_name): If the color pixel value is either
FACE_TTY_DEFAULT_FG_COLOR or FACE_TTY_DEFAULT_BG_COLOR, return
Qunspecified_fg or Qunspecified_bg, respectively.
(Finternal_set_lisp_face_attribute): Allow values Qunspecified_fg
and Qunspecified_bg for foreground and background colors.
(realize_default_face): If the foreground and background colors
are not specified, default to Qunspecified_fg and Qunspecified_bg.
(realize_tty_face): By default, set the face colors to
FACE_TTY_DEFAULT_FG_COLOR and FACE_TTY_DEFAULT_BG_COLOR.
[MSDOS]: Handle FACE_TTY_DEFAULT_FG_COLOR and
FACE_TTY_DEFAULT_BG_COLOR when face colors are not defined.
Reverse the colors if the default colors were reversed.
* dispnew.c (init_display): Initialize the frame pixels of the
initial frame to FACE_TTY_DEFAULT_FG_COLOR and
FACE_TTY_DEFAULT_BG_COLOR.
* term.c (turn_on_face): If the default fore- and background
colors are reversed, enter inverse video mode. Don't send color
escape sequences for unspecified foreground and background colors.
(turn_off_face): Handle unspecified-fg and unspecified-bg colors.
* dosfns.c (unspecified_colors): New variable.
(msdos_stdcolor_idx): Handle unspecified-fg and unspecified-bg
color names, return FACE_TTY_DEFAULT_FG_COLOR and
FACE_TTY_DEFAULT_BG_COLOR, respectively.
(msdos_stdcolor_name): Handle FACE_TTY_DEFAULT_FG_COLOR and
FACE_TTY_DEFAULT_BG_COLOR, return Qunspecified_fg and
Qunspecified_bg, respectively.
* msdos.c (IT_set_face): Support FACE_TTY_DEFAULT_FG_COLOR and
FACE_TTY_DEFAULT_BG_COLOR as pixel values.
* faces.el (face-read-integer, read-face-attribute)
(color-defined-p, color-values): Allow color values unspecified-fg
and unspecified-bg, handle them as unspecified.
1999-12-15 13:14:38 +00:00
|
|
|
|
&& ((face->foreground != FACE_TTY_DEFAULT_COLOR
|
|
|
|
|
&& face->foreground != FACE_TTY_DEFAULT_FG_COLOR)
|
|
|
|
|
|| (face->background != FACE_TTY_DEFAULT_COLOR
|
|
|
|
|
&& face->background != FACE_TTY_DEFAULT_BG_COLOR)))
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
OUTPUT1_IF (tty, tty->TS_orig_pair);
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
}
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
|
|
|
|
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
/* Return true if the terminal on frame F supports all of the
|
2013-11-06 00:14:56 +00:00
|
|
|
|
capabilities in CAPS simultaneously. */
|
2002-05-26 07:23:47 +00:00
|
|
|
|
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
bool
|
2013-11-06 00:14:56 +00:00
|
|
|
|
tty_capable_p (struct tty_display_info *tty, unsigned int caps)
|
2002-05-26 07:23:47 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
#define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \
|
|
|
|
|
if ((caps & (cap)) && (!(TS) || !MAY_USE_WITH_COLORS_P(tty, NC_bit))) \
|
2002-05-26 07:23:47 +00:00
|
|
|
|
return 0;
|
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
TTY_CAPABLE_P_TRY (tty, TTY_CAP_INVERSE, tty->TS_standout_mode, NC_REVERSE);
|
|
|
|
|
TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE);
|
|
|
|
|
TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD);
|
|
|
|
|
TTY_CAPABLE_P_TRY (tty, TTY_CAP_DIM, tty->TS_enter_dim_mode, NC_DIM);
|
2012-06-09 16:44:44 +00:00
|
|
|
|
TTY_CAPABLE_P_TRY (tty, TTY_CAP_ITALIC, tty->TS_enter_italic_mode, NC_ITALIC);
|
2002-05-26 07:23:47 +00:00
|
|
|
|
|
|
|
|
|
/* We can do it! */
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
/* Return non-zero if the terminal is capable to display colors. */
|
|
|
|
|
|
|
|
|
|
DEFUN ("tty-display-color-p", Ftty_display_color_p, Stty_display_color_p,
|
2000-01-02 14:06:15 +00:00
|
|
|
|
0, 1, 0,
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
doc: /* Return non-nil if the tty device TERMINAL can display colors.
|
|
|
|
|
|
2009-04-22 03:43:06 +00:00
|
|
|
|
TERMINAL can be a terminal object, a frame, or nil (meaning the
|
|
|
|
|
selected frame's terminal). This function always returns nil if
|
2012-06-19 06:49:50 +00:00
|
|
|
|
TERMINAL does not refer to a text terminal. */)
|
2010-07-08 21:25:08 +00:00
|
|
|
|
(Lisp_Object terminal)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
struct terminal *t = decode_tty_terminal (terminal);
|
|
|
|
|
|
|
|
|
|
return (t && t->display_info.tty->TN_max_colors > 0) ? Qt : Qnil;
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-01-25 13:21:49 +00:00
|
|
|
|
/* Return the number of supported colors. */
|
|
|
|
|
DEFUN ("tty-display-color-cells", Ftty_display_color_cells,
|
|
|
|
|
Stty_display_color_cells, 0, 1, 0,
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
doc: /* Return the number of colors supported by the tty device TERMINAL.
|
|
|
|
|
|
2009-04-22 03:43:06 +00:00
|
|
|
|
TERMINAL can be a terminal object, a frame, or nil (meaning the
|
|
|
|
|
selected frame's terminal). This function always returns 0 if
|
2012-06-19 06:49:50 +00:00
|
|
|
|
TERMINAL does not refer to a text terminal. */)
|
2010-07-08 21:25:08 +00:00
|
|
|
|
(Lisp_Object terminal)
|
2002-01-25 13:21:49 +00:00
|
|
|
|
{
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
struct terminal *t = decode_tty_terminal (terminal);
|
|
|
|
|
|
Rename integerp->fixnum, etc, in preparation for bignums
* src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
src/process.c, src/profiler.c, src/search.c, src/sound.c,
src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
2018-07-07 03:56:17 +00:00
|
|
|
|
return make_fixnum (t ? t->display_info.tty->TN_max_colors : 0);
|
2002-01-25 13:21:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#ifndef DOS_NT
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2007-08-16 03:18:08 +00:00
|
|
|
|
/* Declare here rather than in the function, as in the rest of Emacs,
|
|
|
|
|
to work around an HPUX compiler bug (?). See
|
2017-11-26 06:45:41 +00:00
|
|
|
|
https://lists.gnu.org/r/emacs-devel/2007-08/msg00410.html */
|
2007-08-16 03:18:08 +00:00
|
|
|
|
static int default_max_colors;
|
|
|
|
|
static int default_no_color_video;
|
|
|
|
|
static char *default_orig_pair;
|
|
|
|
|
static char *default_set_foreground;
|
|
|
|
|
static char *default_set_background;
|
2007-08-15 03:20:17 +00:00
|
|
|
|
|
2002-01-14 13:45:36 +00:00
|
|
|
|
/* Save or restore the default color-related capabilities of this
|
|
|
|
|
terminal. */
|
|
|
|
|
static void
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
tty_default_color_capabilities (struct tty_display_info *tty, bool save)
|
2002-01-14 13:45:36 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (save)
|
|
|
|
|
{
|
2014-02-28 21:45:34 +00:00
|
|
|
|
dupstring (&default_orig_pair, tty->TS_orig_pair);
|
|
|
|
|
dupstring (&default_set_foreground, tty->TS_set_foreground);
|
|
|
|
|
dupstring (&default_set_background, tty->TS_set_background);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
default_max_colors = tty->TN_max_colors;
|
|
|
|
|
default_no_color_video = tty->TN_no_color_video;
|
2002-01-14 13:45:36 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_orig_pair = default_orig_pair;
|
|
|
|
|
tty->TS_set_foreground = default_set_foreground;
|
|
|
|
|
tty->TS_set_background = default_set_background;
|
|
|
|
|
tty->TN_max_colors = default_max_colors;
|
|
|
|
|
tty->TN_no_color_video = default_no_color_video;
|
2002-01-14 13:45:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Setup one of the standard tty color schemes according to MODE.
|
|
|
|
|
MODE's value is generally the number of colors which we want to
|
|
|
|
|
support; zero means set up for the default capabilities, the ones
|
2005-07-10 22:25:28 +00:00
|
|
|
|
we saw at init_tty time; -1 means turn off color support. */
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Separate frame-local, tty-dependent parameters from tty-local parameters.
src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters. (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.
src/term.c: Update prototypes. Use tty_display_info instead of tty_output.
src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.
src/cm.h: Update prototypes.
src/dispextern.h: Ditto.
src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.
src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output. Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty. Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty. Use reference count to
decide if the tty should be closed.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.
src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.
src/lisp.h: Declare struct display. Update prototypes.
src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
2004-01-01 17:55:53 +00:00
|
|
|
|
tty_setup_colors (struct tty_display_info *tty, int mode)
|
2002-01-14 13:45:36 +00:00
|
|
|
|
{
|
2004-04-16 12:51:06 +00:00
|
|
|
|
/* Canonicalize all negative values of MODE. */
|
|
|
|
|
if (mode < -1)
|
|
|
|
|
mode = -1;
|
|
|
|
|
|
2002-01-14 13:45:36 +00:00
|
|
|
|
switch (mode)
|
|
|
|
|
{
|
|
|
|
|
case -1: /* no colors at all */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TN_max_colors = 0;
|
|
|
|
|
tty->TN_no_color_video = 0;
|
|
|
|
|
tty->TS_set_foreground = tty->TS_set_background = tty->TS_orig_pair = NULL;
|
2002-01-14 13:45:36 +00:00
|
|
|
|
break;
|
|
|
|
|
case 0: /* default colors, if any */
|
|
|
|
|
default:
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty_default_color_capabilities (tty, 0);
|
2002-01-14 13:45:36 +00:00
|
|
|
|
break;
|
|
|
|
|
case 8: /* 8 standard ANSI colors */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_orig_pair = "\033[0m";
|
2002-01-14 13:45:36 +00:00
|
|
|
|
#ifdef TERMINFO
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_set_foreground = "\033[3%p1%dm";
|
|
|
|
|
tty->TS_set_background = "\033[4%p1%dm";
|
2002-01-14 13:45:36 +00:00
|
|
|
|
#else
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_set_foreground = "\033[3%dm";
|
|
|
|
|
tty->TS_set_background = "\033[4%dm";
|
2002-01-14 13:45:36 +00:00
|
|
|
|
#endif
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TN_max_colors = 8;
|
|
|
|
|
tty->TN_no_color_video = 0;
|
2002-01-14 13:45:36 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2010-07-05 10:36:06 +00:00
|
|
|
|
set_tty_color_mode (struct tty_display_info *tty, struct frame *f)
|
2002-01-14 13:45:36 +00:00
|
|
|
|
{
|
Make variable forwarding explicit rather the using special values.
Basically, this makes the structure of buffer-local values and object
forwarding explicit in the type of Lisp_Symbols rather than use
special Lisp_Objects for that. This tends to lead to slightly more
verbose code, but is more C-like, simpler, and makes it easier to make
sure we handled all cases, among other things by letting the compiler
help us check it.
* lisp.h (enum Lisp_Misc_Type, union Lisp_Misc):
Removing forwarding objects.
(enum Lisp_Fwd_Type, enum symbol_redirect, union Lisp_Fwd): New types.
(struct Lisp_Symbol): Make the various forms of variable-forwarding
explicit rather than hiding them inside Lisp_Object "values".
(XFWDTYPE): New macro.
(XINTFWD, XBOOLFWD, XOBJFWD, XKBOARD_OBJFWD): Redefine.
(XBUFFER_LOCAL_VALUE): Remove.
(SYMBOL_VAL, SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL)
(SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD): New macros.
(SYMBOL_VALUE, SET_SYMBOL_VALUE): Remove.
(struct Lisp_Intfwd, struct Lisp_Boolfwd, struct Lisp_Objfwd)
(struct Lisp_Buffer_Objfwd, struct Lisp_Kboard_Objfwd):
Remove the Lisp_Misc_* header.
(struct Lisp_Buffer_Local_Value): Redefine.
(BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): New macros.
(struct Lisp_Misc_Any): Add filler to get the right size.
(struct Lisp_Free): Use struct Lisp_Misc_Any rather than struct
Lisp_Intfwd.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_KBOARD): Allocate a forwarding object.
* data.c (do_blv_forwarding, store_blv_forwarding): New macros.
(let_shadows_global_binding_p): New function.
(union Lisp_Val_Fwd): New type.
(make_blv): New function.
(swap_in_symval_forwarding, indirect_variable, do_symval_forwarding)
(store_symval_forwarding, swap_in_global_binding, Fboundp)
(swap_in_symval_forwarding, find_symbol_value, Fset)
(let_shadows_buffer_binding_p, set_internal, default_value)
(Fset_default, Fmake_variable_buffer_local, Fmake_local_variable)
(Fkill_local_variable, Fmake_variable_frame_local)
(Flocal_variable_p, Flocal_variable_if_set_p)
(Fvariable_binding_locus):
* xdisp.c (select_frame_for_redisplay):
* lread.c (Fintern, Funintern, init_obarray, defvar_int)
(defvar_bool, defvar_lisp_nopro, defvar_lisp, defvar_kboard):
* frame.c (store_frame_param):
* eval.c (Fdefvaralias, Fuser_variable_p, specbind, unbind_to):
* bytecode.c (Fbyte_code) <varref, varset>: Adapt to the new symbol
value structure.
* buffer.c (PER_BUFFER_SYMBOL): Move from buffer.h.
(clone_per_buffer_values): Only adjust markers into the current buffer.
(reset_buffer_local_variables): PER_BUFFER_IDX is never -2.
(Fbuffer_local_value, set_buffer_internal_1)
(swap_out_buffer_local_variables):
Adapt to the new symbol value structure.
(DEFVAR_PER_BUFFER): Allocate a Lisp_Buffer_Objfwd object.
(defvar_per_buffer): Take a new arg for the fwd object.
(buffer_lisp_local_variables): Return a proper alist (different fix
for bug#4138).
* alloc.c (Fmake_symbol): Use SET_SYMBOL_VAL.
(Fgarbage_collect): Don't handle buffer_defaults specially.
(mark_object): Handle new symbol value structure rather than the old
special Lisp_Misc_* objects.
(gc_sweep) <symbols>: Free also the buffer-local-value objects.
* term.c (set_tty_color_mode):
* bidi.c (bidi_initialize): Don't access the ->value field directly.
* buffer.h (PER_BUFFER_VAR_OFFSET): Don't bother with
a buffer_local_flags.
* print.c (print_object): Get rid of impossible forwarding objects.
2010-04-20 01:50:52 +00:00
|
|
|
|
Lisp_Object tem, val;
|
2008-04-09 03:25:14 +00:00
|
|
|
|
Lisp_Object color_mode;
|
|
|
|
|
int mode;
|
|
|
|
|
Lisp_Object tty_color_mode_alist
|
|
|
|
|
= Fintern_soft (build_string ("tty-color-mode-alist"), Qnil);
|
2002-01-14 13:45:36 +00:00
|
|
|
|
|
Drop FGET and revert read access to Lisp_Objects slots of struct frame.
* frame.h (FGET): Remove.
(struct frame): Do not use INTERNAL_FIELD.
* buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
* fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
* print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
* xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2012-08-07 05:29:25 +00:00
|
|
|
|
tem = assq_no_quit (Qtty_color_mode, f->param_alist);
|
2008-04-09 03:25:14 +00:00
|
|
|
|
val = CONSP (tem) ? XCDR (tem) : Qnil;
|
2002-01-14 13:45:36 +00:00
|
|
|
|
|
Rename integerp->fixnum, etc, in preparation for bignums
* src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
src/process.c, src/profiler.c, src/search.c, src/sound.c,
src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
2018-07-07 03:56:17 +00:00
|
|
|
|
if (FIXNUMP (val))
|
2002-01-14 13:45:36 +00:00
|
|
|
|
color_mode = val;
|
Make variable forwarding explicit rather the using special values.
Basically, this makes the structure of buffer-local values and object
forwarding explicit in the type of Lisp_Symbols rather than use
special Lisp_Objects for that. This tends to lead to slightly more
verbose code, but is more C-like, simpler, and makes it easier to make
sure we handled all cases, among other things by letting the compiler
help us check it.
* lisp.h (enum Lisp_Misc_Type, union Lisp_Misc):
Removing forwarding objects.
(enum Lisp_Fwd_Type, enum symbol_redirect, union Lisp_Fwd): New types.
(struct Lisp_Symbol): Make the various forms of variable-forwarding
explicit rather than hiding them inside Lisp_Object "values".
(XFWDTYPE): New macro.
(XINTFWD, XBOOLFWD, XOBJFWD, XKBOARD_OBJFWD): Redefine.
(XBUFFER_LOCAL_VALUE): Remove.
(SYMBOL_VAL, SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL)
(SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD): New macros.
(SYMBOL_VALUE, SET_SYMBOL_VALUE): Remove.
(struct Lisp_Intfwd, struct Lisp_Boolfwd, struct Lisp_Objfwd)
(struct Lisp_Buffer_Objfwd, struct Lisp_Kboard_Objfwd):
Remove the Lisp_Misc_* header.
(struct Lisp_Buffer_Local_Value): Redefine.
(BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): New macros.
(struct Lisp_Misc_Any): Add filler to get the right size.
(struct Lisp_Free): Use struct Lisp_Misc_Any rather than struct
Lisp_Intfwd.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_KBOARD): Allocate a forwarding object.
* data.c (do_blv_forwarding, store_blv_forwarding): New macros.
(let_shadows_global_binding_p): New function.
(union Lisp_Val_Fwd): New type.
(make_blv): New function.
(swap_in_symval_forwarding, indirect_variable, do_symval_forwarding)
(store_symval_forwarding, swap_in_global_binding, Fboundp)
(swap_in_symval_forwarding, find_symbol_value, Fset)
(let_shadows_buffer_binding_p, set_internal, default_value)
(Fset_default, Fmake_variable_buffer_local, Fmake_local_variable)
(Fkill_local_variable, Fmake_variable_frame_local)
(Flocal_variable_p, Flocal_variable_if_set_p)
(Fvariable_binding_locus):
* xdisp.c (select_frame_for_redisplay):
* lread.c (Fintern, Funintern, init_obarray, defvar_int)
(defvar_bool, defvar_lisp_nopro, defvar_lisp, defvar_kboard):
* frame.c (store_frame_param):
* eval.c (Fdefvaralias, Fuser_variable_p, specbind, unbind_to):
* bytecode.c (Fbyte_code) <varref, varset>: Adapt to the new symbol
value structure.
* buffer.c (PER_BUFFER_SYMBOL): Move from buffer.h.
(clone_per_buffer_values): Only adjust markers into the current buffer.
(reset_buffer_local_variables): PER_BUFFER_IDX is never -2.
(Fbuffer_local_value, set_buffer_internal_1)
(swap_out_buffer_local_variables):
Adapt to the new symbol value structure.
(DEFVAR_PER_BUFFER): Allocate a Lisp_Buffer_Objfwd object.
(defvar_per_buffer): Take a new arg for the fwd object.
(buffer_lisp_local_variables): Return a proper alist (different fix
for bug#4138).
* alloc.c (Fmake_symbol): Use SET_SYMBOL_VAL.
(Fgarbage_collect): Don't handle buffer_defaults specially.
(mark_object): Handle new symbol value structure rather than the old
special Lisp_Misc_* objects.
(gc_sweep) <symbols>: Free also the buffer-local-value objects.
* term.c (set_tty_color_mode):
* bidi.c (bidi_initialize): Don't access the ->value field directly.
* buffer.h (PER_BUFFER_VAR_OFFSET): Don't bother with
a buffer_local_flags.
* print.c (print_object): Get rid of impossible forwarding objects.
2010-04-20 01:50:52 +00:00
|
|
|
|
else if (SYMBOLP (tty_color_mode_alist))
|
2002-01-14 13:45:36 +00:00
|
|
|
|
{
|
Make variable forwarding explicit rather the using special values.
Basically, this makes the structure of buffer-local values and object
forwarding explicit in the type of Lisp_Symbols rather than use
special Lisp_Objects for that. This tends to lead to slightly more
verbose code, but is more C-like, simpler, and makes it easier to make
sure we handled all cases, among other things by letting the compiler
help us check it.
* lisp.h (enum Lisp_Misc_Type, union Lisp_Misc):
Removing forwarding objects.
(enum Lisp_Fwd_Type, enum symbol_redirect, union Lisp_Fwd): New types.
(struct Lisp_Symbol): Make the various forms of variable-forwarding
explicit rather than hiding them inside Lisp_Object "values".
(XFWDTYPE): New macro.
(XINTFWD, XBOOLFWD, XOBJFWD, XKBOARD_OBJFWD): Redefine.
(XBUFFER_LOCAL_VALUE): Remove.
(SYMBOL_VAL, SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL)
(SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD): New macros.
(SYMBOL_VALUE, SET_SYMBOL_VALUE): Remove.
(struct Lisp_Intfwd, struct Lisp_Boolfwd, struct Lisp_Objfwd)
(struct Lisp_Buffer_Objfwd, struct Lisp_Kboard_Objfwd):
Remove the Lisp_Misc_* header.
(struct Lisp_Buffer_Local_Value): Redefine.
(BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): New macros.
(struct Lisp_Misc_Any): Add filler to get the right size.
(struct Lisp_Free): Use struct Lisp_Misc_Any rather than struct
Lisp_Intfwd.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_KBOARD): Allocate a forwarding object.
* data.c (do_blv_forwarding, store_blv_forwarding): New macros.
(let_shadows_global_binding_p): New function.
(union Lisp_Val_Fwd): New type.
(make_blv): New function.
(swap_in_symval_forwarding, indirect_variable, do_symval_forwarding)
(store_symval_forwarding, swap_in_global_binding, Fboundp)
(swap_in_symval_forwarding, find_symbol_value, Fset)
(let_shadows_buffer_binding_p, set_internal, default_value)
(Fset_default, Fmake_variable_buffer_local, Fmake_local_variable)
(Fkill_local_variable, Fmake_variable_frame_local)
(Flocal_variable_p, Flocal_variable_if_set_p)
(Fvariable_binding_locus):
* xdisp.c (select_frame_for_redisplay):
* lread.c (Fintern, Funintern, init_obarray, defvar_int)
(defvar_bool, defvar_lisp_nopro, defvar_lisp, defvar_kboard):
* frame.c (store_frame_param):
* eval.c (Fdefvaralias, Fuser_variable_p, specbind, unbind_to):
* bytecode.c (Fbyte_code) <varref, varset>: Adapt to the new symbol
value structure.
* buffer.c (PER_BUFFER_SYMBOL): Move from buffer.h.
(clone_per_buffer_values): Only adjust markers into the current buffer.
(reset_buffer_local_variables): PER_BUFFER_IDX is never -2.
(Fbuffer_local_value, set_buffer_internal_1)
(swap_out_buffer_local_variables):
Adapt to the new symbol value structure.
(DEFVAR_PER_BUFFER): Allocate a Lisp_Buffer_Objfwd object.
(defvar_per_buffer): Take a new arg for the fwd object.
(buffer_lisp_local_variables): Return a proper alist (different fix
for bug#4138).
* alloc.c (Fmake_symbol): Use SET_SYMBOL_VAL.
(Fgarbage_collect): Don't handle buffer_defaults specially.
(mark_object): Handle new symbol value structure rather than the old
special Lisp_Misc_* objects.
(gc_sweep) <symbols>: Free also the buffer-local-value objects.
* term.c (set_tty_color_mode):
* bidi.c (bidi_initialize): Don't access the ->value field directly.
* buffer.h (PER_BUFFER_VAR_OFFSET): Don't bother with
a buffer_local_flags.
* print.c (print_object): Get rid of impossible forwarding objects.
2010-04-20 01:50:52 +00:00
|
|
|
|
tem = Fassq (val, Fsymbol_value (tty_color_mode_alist));
|
2008-04-09 03:25:14 +00:00
|
|
|
|
color_mode = CONSP (tem) ? XCDR (tem) : Qnil;
|
2002-01-14 13:45:36 +00:00
|
|
|
|
}
|
Make variable forwarding explicit rather the using special values.
Basically, this makes the structure of buffer-local values and object
forwarding explicit in the type of Lisp_Symbols rather than use
special Lisp_Objects for that. This tends to lead to slightly more
verbose code, but is more C-like, simpler, and makes it easier to make
sure we handled all cases, among other things by letting the compiler
help us check it.
* lisp.h (enum Lisp_Misc_Type, union Lisp_Misc):
Removing forwarding objects.
(enum Lisp_Fwd_Type, enum symbol_redirect, union Lisp_Fwd): New types.
(struct Lisp_Symbol): Make the various forms of variable-forwarding
explicit rather than hiding them inside Lisp_Object "values".
(XFWDTYPE): New macro.
(XINTFWD, XBOOLFWD, XOBJFWD, XKBOARD_OBJFWD): Redefine.
(XBUFFER_LOCAL_VALUE): Remove.
(SYMBOL_VAL, SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL)
(SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD): New macros.
(SYMBOL_VALUE, SET_SYMBOL_VALUE): Remove.
(struct Lisp_Intfwd, struct Lisp_Boolfwd, struct Lisp_Objfwd)
(struct Lisp_Buffer_Objfwd, struct Lisp_Kboard_Objfwd):
Remove the Lisp_Misc_* header.
(struct Lisp_Buffer_Local_Value): Redefine.
(BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): New macros.
(struct Lisp_Misc_Any): Add filler to get the right size.
(struct Lisp_Free): Use struct Lisp_Misc_Any rather than struct
Lisp_Intfwd.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_KBOARD): Allocate a forwarding object.
* data.c (do_blv_forwarding, store_blv_forwarding): New macros.
(let_shadows_global_binding_p): New function.
(union Lisp_Val_Fwd): New type.
(make_blv): New function.
(swap_in_symval_forwarding, indirect_variable, do_symval_forwarding)
(store_symval_forwarding, swap_in_global_binding, Fboundp)
(swap_in_symval_forwarding, find_symbol_value, Fset)
(let_shadows_buffer_binding_p, set_internal, default_value)
(Fset_default, Fmake_variable_buffer_local, Fmake_local_variable)
(Fkill_local_variable, Fmake_variable_frame_local)
(Flocal_variable_p, Flocal_variable_if_set_p)
(Fvariable_binding_locus):
* xdisp.c (select_frame_for_redisplay):
* lread.c (Fintern, Funintern, init_obarray, defvar_int)
(defvar_bool, defvar_lisp_nopro, defvar_lisp, defvar_kboard):
* frame.c (store_frame_param):
* eval.c (Fdefvaralias, Fuser_variable_p, specbind, unbind_to):
* bytecode.c (Fbyte_code) <varref, varset>: Adapt to the new symbol
value structure.
* buffer.c (PER_BUFFER_SYMBOL): Move from buffer.h.
(clone_per_buffer_values): Only adjust markers into the current buffer.
(reset_buffer_local_variables): PER_BUFFER_IDX is never -2.
(Fbuffer_local_value, set_buffer_internal_1)
(swap_out_buffer_local_variables):
Adapt to the new symbol value structure.
(DEFVAR_PER_BUFFER): Allocate a Lisp_Buffer_Objfwd object.
(defvar_per_buffer): Take a new arg for the fwd object.
(buffer_lisp_local_variables): Return a proper alist (different fix
for bug#4138).
* alloc.c (Fmake_symbol): Use SET_SYMBOL_VAL.
(Fgarbage_collect): Don't handle buffer_defaults specially.
(mark_object): Handle new symbol value structure rather than the old
special Lisp_Misc_* objects.
(gc_sweep) <symbols>: Free also the buffer-local-value objects.
* term.c (set_tty_color_mode):
* bidi.c (bidi_initialize): Don't access the ->value field directly.
* buffer.h (PER_BUFFER_VAR_OFFSET): Don't bother with
a buffer_local_flags.
* print.c (print_object): Get rid of impossible forwarding objects.
2010-04-20 01:50:52 +00:00
|
|
|
|
else
|
|
|
|
|
color_mode = Qnil;
|
2004-04-16 12:51:06 +00:00
|
|
|
|
|
More macro renamings for bignum
* src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
src/category.c, src/ccl.c, src/character.c, src/character.h,
src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
2018-08-08 00:08:53 +00:00
|
|
|
|
mode = TYPE_RANGED_FIXNUMP (int, color_mode) ? XFIXNUM (color_mode) : 0;
|
2002-01-14 13:45:36 +00:00
|
|
|
|
|
2008-04-09 03:25:14 +00:00
|
|
|
|
if (mode != tty->previous_color_mode)
|
2002-01-14 13:45:36 +00:00
|
|
|
|
{
|
2008-04-09 03:25:14 +00:00
|
|
|
|
tty->previous_color_mode = mode;
|
|
|
|
|
tty_setup_colors (tty , mode);
|
|
|
|
|
/* This recomputes all the faces given the new color definitions. */
|
2012-07-30 06:43:46 +00:00
|
|
|
|
safe_call (1, intern ("tty-set-up-initial-frame-faces"));
|
2002-01-14 13:45:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#endif /* !DOS_NT */
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2011-04-14 05:04:02 +00:00
|
|
|
|
DEFUN ("tty-type", Ftty_type, Stty_type, 0, 1, 0,
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
doc: /* Return the type of the tty device that TERMINAL uses.
|
2006-05-20 17:12:43 +00:00
|
|
|
|
Returns nil if TERMINAL is not on a tty device.
|
2005-06-21 15:42:45 +00:00
|
|
|
|
|
2009-04-22 03:43:06 +00:00
|
|
|
|
TERMINAL can be a terminal object, a frame, or nil (meaning the
|
|
|
|
|
selected frame's terminal). */)
|
2010-07-08 21:25:08 +00:00
|
|
|
|
(Lisp_Object terminal)
|
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
* lisp/frame.el (make-frame-on-display): Update doc.
(make-frame): Handle display-id parameter. Update doc.
(frames-on-display-list): Update for display ids.
(framep-on-display): Ditto.
(suspend-frame): Use display-name, not frame-tty-name.
(selected-display): New function.
* lisp/server.el (server-delete-client): Use delete-display, not delete-tty.
(server-tty-live-p, server-handle-delete-tty): Removed.
(server-handle-delete-frame): Delete tty clients, if needed.
(server-process-filter): Set the display parameter, and use it when appropriate.
(server-handle-suspend-tty): Use the display parameter.
(server-start, server-unload-hook): Removed obsolete delete-tty hook.
* lisp/talk.el (talk): Always use talk-add-display.
(talk-add-tty-frame, talk-handle-delete-tty): Removed.
(talk-handle-delete-frame): New function.
(talk-add-display): Open a new frame only if parameter was not a frame.
* src/dispextern.h (get_display, Fdisplay_tty_type): New prototypes.
(Fframe_tty_type): Removed.
* src/dispnew.c (init_display): Use Fdisplay_tty_type, not Fframe_tty_type.
* src/frame.c (Qdisplay_id, Qdisplay_live_p): New symbols.
(make_terminal_frame): Get display as a parameter.
(Fmake_terminal_frame): Get/create display here; pass it to
make_terminal_frame.
(Fframe_display): New function.
(Fdelete_frame): Stop if the hook deleted the frame.
(syms_of_frame): Register new stuff.
* src/frame.h (Qdisplay_id, Qdisplay_live_p, make_terminal_frame):
Updated prototypes.
* src/keyboard.c (interrupt_signal): Updated comment.
* src/term.c (Vdelete_tty_after_functions): Removed variable.
(Qframe_tty_name, Qframe_tty_type): Removed.
(next_display_id): New var.
(tty_ring_bell): Don't do anything on suspended frames.
(Ftty_display_color_p, Ftty_display_color_cells): Doc update.
(get_display): New function.
(get_tty_display): Use it.
(get_named_tty_display): Ignore suspended displays.
(Fframe_tty_name): Renamed to Fdisplay_name. Handle all kinds of
displays.
(Fframe_tty_type): Renamed to Fdisplay_tty_type.
(init_initial_display): Set display name.
(term_init): Allow more displays on the same device. Set display name.
(Fdelete_tty): Removed.
(delete_tty): Don't run hooks.
(create_display): Set display id.
(delete_display): Free display name.
(Fdelete_display, Fdisplay_live_p, Fdisplay_list): New functions.
(Fsuspend_tty): Call hook with display id. Doc update.
(Fresume_tty): Refuse to resume when there is already an active display
on the same device. Call hook with display id. Doc update.
(syms_of_term): Reflect above changes.
* src/termhooks.h (struct display): Added `id' and `name' members.
(DISPLAY_ACTIVE_P): New macro.
* src/xfns.c (check_x_display_info): Handle display ids.
(Fx_create_frame): Try to get display from `display-id' parameter.
* src/xterm.c (x_term_init): Set display name.
(x_delete_display): Handle the case when `font_table' is NULL.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-207
2004-07-04 04:48:55 +00:00
|
|
|
|
{
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
struct terminal *t = decode_tty_terminal (terminal);
|
2006-05-20 17:12:43 +00:00
|
|
|
|
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
return (t && t->display_info.tty->type
|
|
|
|
|
? build_string (t->display_info.tty->type) : Qnil);
|
A few more bugfixes and new features.
(Sigh.) I obviously need to remember to separate individual changes
to multiple commits.
src/emacsclient.c: Improved error handling.
(decode_options): Changed frame option (again) from -f to -t.
(print_help_and_exit): Ditto.
(copy_from_to): Check EINTR after write, not EAGAIN. Removed SIGIO hack.
(pty_conversation): Handle errors transmitted through the socket.
Handle pty errors by not reading from it anymore.
(main): Restore correct errno after socket_status failed. Send -tty
on -t, not -pty.
lisp/server.el (server-process-filter): Watch -tty, not -pty.
Use make-frame-on-tty instead of make-terminal-frame.
Don't set newframe to t if make-frame-on-tty failed.
Don't delete frames here. Print correct message when there are no
files to edit, but a new frame was requested.
(server-sentinel): Delete the frame after the process.
(server-handle-delete-frame): New function for delete-frame-functions.
(server-start): Add server-handle-delete-frame to delete-frame-functions.
(server-buffer-done): Don't delete frames here.
src/alloc.c (mark_ttys): Add prototype.
(Fgarbage_collect): Call mark_ttys.
src/emacs.c: (shut_down_emacs): Don't flush stdout before
reset_sys_modes().
src/process.c (add_keyboard_wait_descriptor_called_flag): Removed.
(add_keyboard_wait_descriptor): Removed stdin hack.
src/sysdep.c: Unconditionally include sysselect.h.
(old_fcntl_flags): Changed to an array.
(init_sigio, reset_sigio): Use it.
(narrow_foreground_group, widen_foreground_group): Use setpgid, not
setpgrp.
(old_fcntl_owner): Changed to an array.
(init_sys_modes, reset_sys_modes): Use it. Fix fsync() and reset_sigio() calls.
src/term.c (Qframe_tty_name, Qframe_tty_type): New variables.
(syms_of_term): Initialize them.
(Fframe_tty_name, Fframe_tty_type): New functions.
(term_init): Call add_keyboard_wait_descriptor().
(Fdelete_tty): New function.
(delete_tty): Call delete_keyboard_wait_descriptor().
(get_current_tty): Removed.
(mark_ttys): New function.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-28
2003-12-31 05:09:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
DEFUN ("controlling-tty-p", Fcontrolling_tty_p, Scontrolling_tty_p, 0, 1, 0,
|
2008-08-23 16:55:52 +00:00
|
|
|
|
doc: /* Return non-nil if TERMINAL is the controlling tty of the Emacs process.
|
2005-06-21 15:42:45 +00:00
|
|
|
|
|
2009-04-22 03:43:06 +00:00
|
|
|
|
TERMINAL can be a terminal object, a frame, or nil (meaning the
|
|
|
|
|
selected frame's terminal). This function always returns nil if
|
|
|
|
|
TERMINAL is not on a tty device. */)
|
2010-07-08 21:25:08 +00:00
|
|
|
|
(Lisp_Object terminal)
|
2004-07-10 21:21:04 +00:00
|
|
|
|
{
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
struct terminal *t = decode_tty_terminal (terminal);
|
2004-07-10 21:21:04 +00:00
|
|
|
|
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
return (t && !strcmp (t->display_info.tty->name, DEV_TTY) ? Qt : Qnil);
|
2004-07-10 21:21:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-06-21 15:42:45 +00:00
|
|
|
|
DEFUN ("tty-no-underline", Ftty_no_underline, Stty_no_underline, 0, 1, 0,
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
doc: /* Declare that the tty used by TERMINAL does not handle underlining.
|
2005-06-21 15:42:45 +00:00
|
|
|
|
This is used to override the terminfo data, for certain terminals that
|
|
|
|
|
do not really do underlining, but say that they do. This function has
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
no effect if used on a non-tty terminal.
|
2005-06-21 15:42:45 +00:00
|
|
|
|
|
2009-04-22 03:43:06 +00:00
|
|
|
|
TERMINAL can be a terminal object, a frame or nil (meaning the
|
|
|
|
|
selected frame's terminal). This function always returns nil if
|
2012-06-19 06:49:50 +00:00
|
|
|
|
TERMINAL does not refer to a text terminal. */)
|
2010-07-08 21:25:08 +00:00
|
|
|
|
(Lisp_Object terminal)
|
2005-06-21 15:42:45 +00:00
|
|
|
|
{
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
struct terminal *t = decode_live_terminal (terminal);
|
2005-06-21 15:42:45 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
if (t->type == output_termcap)
|
|
|
|
|
t->display_info.tty->TS_enter_underline_mode = 0;
|
2005-06-21 15:42:45 +00:00
|
|
|
|
return Qnil;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-19 06:49:50 +00:00
|
|
|
|
DEFUN ("tty-top-frame", Ftty_top_frame, Stty_top_frame, 0, 1, 0,
|
|
|
|
|
doc: /* Return the topmost terminal frame on TERMINAL.
|
|
|
|
|
TERMINAL can be a terminal object, a frame or nil (meaning the
|
|
|
|
|
selected frame's terminal). This function returns nil if TERMINAL
|
|
|
|
|
does not refer to a text terminal. Otherwise, it returns the
|
|
|
|
|
top-most frame on the text terminal. */)
|
|
|
|
|
(Lisp_Object terminal)
|
|
|
|
|
{
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
struct terminal *t = decode_live_terminal (terminal);
|
2012-06-19 06:49:50 +00:00
|
|
|
|
|
|
|
|
|
if (t->type == output_termcap)
|
|
|
|
|
return t->display_info.tty->top_frame;
|
|
|
|
|
return Qnil;
|
|
|
|
|
}
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DEFUN ("suspend-tty", Fsuspend_tty, Ssuspend_tty, 0, 1, 0,
|
|
|
|
|
doc: /* Suspend the terminal device TTY.
|
|
|
|
|
|
|
|
|
|
The device is restored to its default state, and Emacs ceases all
|
|
|
|
|
access to the tty device. Frames that use the device are not deleted,
|
|
|
|
|
but input is not read from them and if they change, their display is
|
|
|
|
|
not updated.
|
|
|
|
|
|
2009-04-22 03:43:06 +00:00
|
|
|
|
TTY may be a terminal object, a frame, or nil for the terminal device
|
|
|
|
|
of the currently selected frame.
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
2007-09-04 23:28:49 +00:00
|
|
|
|
This function runs `suspend-tty-functions' after suspending the
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
device. The functions are run with one arg, the id of the suspended
|
|
|
|
|
terminal device.
|
|
|
|
|
|
|
|
|
|
`suspend-tty' does nothing if it is called on a device that is already
|
|
|
|
|
suspended.
|
|
|
|
|
|
|
|
|
|
A suspended tty may be resumed by calling `resume-tty' on it. */)
|
2010-07-08 21:25:08 +00:00
|
|
|
|
(Lisp_Object tty)
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
{
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
struct terminal *t = decode_tty_terminal (tty);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
FILE *f;
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
if (!t)
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
error ("Attempt to suspend a non-text terminal device");
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
f = t->display_info.tty->input;
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
if (f)
|
|
|
|
|
{
|
2007-09-21 20:19:10 +00:00
|
|
|
|
/* First run `suspend-tty-functions' and then clean up the tty
|
|
|
|
|
state because `suspend-tty-functions' might need to change
|
|
|
|
|
the tty state. */
|
Count MANY function args more reliably
* alloc.c (Fgc_status, purecopy, unbind_to, garbage_collect_1):
* buffer.c (Fbuffer_list, Fkill_buffer):
* callint.c (read_file_name, Fcall_interactively):
* charset.c (Fset_charset_priority, syms_of_charset):
* chartab.c (uniprop_encode_value_numeric):
* coding.c (syms_of_coding):
* composite.c (syms_of_composite):
* data.c (wrong_range):
* dbusbind.c (syms_of_dbusbind):
* dired.c (file_attributes):
* editfns.c (Fdecode_time, update_buffer_properties, format2):
* eval.c (run_hook_with_args_2, apply1, call1, call2, call3)
(call4, call5, call6, call7):
* fileio.c (Finsert_file_contents, choose_write_coding_system)
(Fcar_less_than_car, build_annotations, auto_save_error):
* filelock.c (get_boot_time):
* fns.c (internal_equal, nconc2, Fyes_or_no_p, Fwidget_apply):
(maybe_resize_hash_table, secure_hash):
* font.c (font_style_to_value, font_open_by_name, Flist_fonts):
* fontset.c (fontset_add, Fset_fontset_font):
* ftfont.c (ftfont_lookup_cache):
* gtkutil.c (xg_get_font):
* insdel.c (signal_before_change, signal_after_change):
* keymap.c (append_key):
* lread.c (load_warn_old_style_backquotes, Fload, init_lread):
* minibuf.c (Fread_buffer):
* print.c (print_preprocess):
* process.c (Fformat_network_address, Fmake_network_process)
(server_accept_connection):
* sound.c (Fplay_sound_internal):
* term.c (Fsuspend_tty, Fresume_tty):
* window.c (window_list):
* xdisp.c (run_redisplay_end_trigger_hook, add_to_log)
(message_with_string):
* xfaces.c (Fx_list_fonts):
* xfont.c (syms_of_xfont):
* xselect.c (x_handle_selection_request)
(x_handle_selection_clear, x_clear_frame_selections)
(x_clipboard_manager_error_1):
Prefer CALLMANY and CALLN to counting args by hand.
* doc.c (reread_doc_file): Remove unused code.
* fns.c (concat2, concat3): Redo to avoid need for local-var vector.
(cmpfn_user_defined, hashfn_user_defined, Fmaphash):
Prefer call1 and call2 to Ffuncall.
* keyboard.c (safe_run_hook_funcall, safe_run_hooks):
Use struct literal rather than a local var, for simplicity.
* keymap.c (where_is_internal): Use NULL rather than a pointer
to unused args.
* lisp.h (CALLMANY, CALLN): New macros.
* sound.c (Fplay_sound_internal): Coalesce duplicate code.
Fixes: bug#19634
2015-01-25 16:33:41 +00:00
|
|
|
|
Lisp_Object term;
|
|
|
|
|
XSETTERMINAL (term, t);
|
|
|
|
|
CALLN (Frun_hook_with_args, intern ("suspend-tty-functions"), term);
|
2007-09-21 20:19:10 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
reset_sys_modes (t->display_info.tty);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
delete_keyboard_wait_descriptor (fileno (f));
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#ifndef MSDOS
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
fclose (f);
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
if (f != t->display_info.tty->output)
|
|
|
|
|
fclose (t->display_info.tty->output);
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#endif
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
t->display_info.tty->input = 0;
|
|
|
|
|
t->display_info.tty->output = 0;
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
if (FRAMEP (t->display_info.tty->top_frame))
|
Drop async_visible and async_iconified fields of struct frame.
This is possible because async input is gone; for details, see
http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
* frame.h (struct frame): Remove async_visible and async_iconified
members, convert garbaged to unsigned bitfield. Adjust comments.
(FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
(SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
* frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
* w32term.c: Ditto.
(w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
properly. Likewise for obscured.
* xterm.c: Ditto.
(handle_one_xevent): Save visible state go generate ICONIFY_EVENT
properly.
* nsterm.m: Ditto.
(windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2013-01-24 05:41:28 +00:00
|
|
|
|
SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 0);
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-05-20 12:00:16 +00:00
|
|
|
|
/* Clear display hooks to prevent further output. */
|
|
|
|
|
clear_tty_hooks (t);
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
return Qnil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DEFUN ("resume-tty", Fresume_tty, Sresume_tty, 0, 1, 0,
|
|
|
|
|
doc: /* Resume the previously suspended terminal device TTY.
|
|
|
|
|
The terminal is opened and reinitialized. Frames that are on the
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
suspended terminal are revived.
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
It is an error to resume a terminal while another terminal is active
|
|
|
|
|
on the same device.
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
2007-09-04 23:28:49 +00:00
|
|
|
|
This function runs `resume-tty-functions' after resuming the terminal.
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
The functions are run with one arg, the id of the resumed terminal
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
device.
|
|
|
|
|
|
|
|
|
|
`resume-tty' does nothing if it is called on a device that is not
|
|
|
|
|
suspended.
|
|
|
|
|
|
2009-04-22 03:43:06 +00:00
|
|
|
|
TTY may be a terminal object, a frame, or nil (meaning the selected
|
|
|
|
|
frame's terminal). */)
|
2010-07-08 21:25:08 +00:00
|
|
|
|
(Lisp_Object tty)
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
{
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
struct terminal *t = decode_tty_terminal (tty);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
int fd;
|
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
if (!t)
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
error ("Attempt to resume a non-text terminal device");
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
if (!t->display_info.tty->input)
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
{
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
if (get_named_terminal (t->display_info.tty->name))
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
error ("Cannot resume display while another display is active on the same device");
|
|
|
|
|
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#ifdef MSDOS
|
|
|
|
|
t->display_info.tty->output = stdout;
|
|
|
|
|
t->display_info.tty->input = stdin;
|
|
|
|
|
#else /* !MSDOS */
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
fd = emacs_open (t->display_info.tty->name, O_RDWR | O_NOCTTY, 0);
|
2013-07-18 08:35:27 +00:00
|
|
|
|
t->display_info.tty->input = t->display_info.tty->output
|
|
|
|
|
= fd < 0 ? 0 : fdopen (fd, "w+");
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
2013-07-18 08:35:27 +00:00
|
|
|
|
if (! t->display_info.tty->input)
|
|
|
|
|
{
|
|
|
|
|
int open_errno = errno;
|
|
|
|
|
emacs_close (fd);
|
|
|
|
|
report_file_errno ("Cannot reopen tty device",
|
|
|
|
|
build_string (t->display_info.tty->name),
|
|
|
|
|
open_errno);
|
|
|
|
|
}
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
2013-01-11 02:40:58 +00:00
|
|
|
|
if (!O_IGNORE_CTTY && strcmp (t->display_info.tty->name, DEV_TTY) != 0)
|
2006-03-26 16:05:17 +00:00
|
|
|
|
dissociate_if_controlling_tty (fd);
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#endif
|
2007-09-22 12:41:29 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
add_keyboard_wait_descriptor (fd);
|
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
if (FRAMEP (t->display_info.tty->top_frame))
|
2009-01-30 23:45:27 +00:00
|
|
|
|
{
|
|
|
|
|
struct frame *f = XFRAME (t->display_info.tty->top_frame);
|
|
|
|
|
int width, height;
|
|
|
|
|
int old_height = FRAME_COLS (f);
|
2014-08-10 08:26:28 +00:00
|
|
|
|
int old_width = FRAME_TOTAL_LINES (f);
|
2009-01-30 23:45:27 +00:00
|
|
|
|
|
|
|
|
|
/* Check if terminal/window size has changed while the frame
|
|
|
|
|
was suspended. */
|
|
|
|
|
get_tty_size (fileno (t->display_info.tty->input), &width, &height);
|
|
|
|
|
if (width != old_width || height != old_height)
|
2014-08-10 08:26:28 +00:00
|
|
|
|
change_frame_size (f, width, height - FRAME_MENU_BAR_LINES (f),
|
|
|
|
|
0, 0, 0, 0);
|
Drop async_visible and async_iconified fields of struct frame.
This is possible because async input is gone; for details, see
http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
* frame.h (struct frame): Remove async_visible and async_iconified
members, convert garbaged to unsigned bitfield. Adjust comments.
(FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
(SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
* frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
* w32term.c: Ditto.
(w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
properly. Likewise for obscured.
* xterm.c: Ditto.
(handle_one_xevent): Save visible state go generate ICONIFY_EVENT
properly.
* nsterm.m: Ditto.
(windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2013-01-24 05:41:28 +00:00
|
|
|
|
SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
|
2009-01-30 23:45:27 +00:00
|
|
|
|
}
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
2011-05-18 00:26:48 +00:00
|
|
|
|
set_tty_hooks (t);
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
init_sys_modes (t->display_info.tty);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
Count MANY function args more reliably
* alloc.c (Fgc_status, purecopy, unbind_to, garbage_collect_1):
* buffer.c (Fbuffer_list, Fkill_buffer):
* callint.c (read_file_name, Fcall_interactively):
* charset.c (Fset_charset_priority, syms_of_charset):
* chartab.c (uniprop_encode_value_numeric):
* coding.c (syms_of_coding):
* composite.c (syms_of_composite):
* data.c (wrong_range):
* dbusbind.c (syms_of_dbusbind):
* dired.c (file_attributes):
* editfns.c (Fdecode_time, update_buffer_properties, format2):
* eval.c (run_hook_with_args_2, apply1, call1, call2, call3)
(call4, call5, call6, call7):
* fileio.c (Finsert_file_contents, choose_write_coding_system)
(Fcar_less_than_car, build_annotations, auto_save_error):
* filelock.c (get_boot_time):
* fns.c (internal_equal, nconc2, Fyes_or_no_p, Fwidget_apply):
(maybe_resize_hash_table, secure_hash):
* font.c (font_style_to_value, font_open_by_name, Flist_fonts):
* fontset.c (fontset_add, Fset_fontset_font):
* ftfont.c (ftfont_lookup_cache):
* gtkutil.c (xg_get_font):
* insdel.c (signal_before_change, signal_after_change):
* keymap.c (append_key):
* lread.c (load_warn_old_style_backquotes, Fload, init_lread):
* minibuf.c (Fread_buffer):
* print.c (print_preprocess):
* process.c (Fformat_network_address, Fmake_network_process)
(server_accept_connection):
* sound.c (Fplay_sound_internal):
* term.c (Fsuspend_tty, Fresume_tty):
* window.c (window_list):
* xdisp.c (run_redisplay_end_trigger_hook, add_to_log)
(message_with_string):
* xfaces.c (Fx_list_fonts):
* xfont.c (syms_of_xfont):
* xselect.c (x_handle_selection_request)
(x_handle_selection_clear, x_clear_frame_selections)
(x_clipboard_manager_error_1):
Prefer CALLMANY and CALLN to counting args by hand.
* doc.c (reread_doc_file): Remove unused code.
* fns.c (concat2, concat3): Redo to avoid need for local-var vector.
(cmpfn_user_defined, hashfn_user_defined, Fmaphash):
Prefer call1 and call2 to Ffuncall.
* keyboard.c (safe_run_hook_funcall, safe_run_hooks):
Use struct literal rather than a local var, for simplicity.
* keymap.c (where_is_internal): Use NULL rather than a pointer
to unused args.
* lisp.h (CALLMANY, CALLN): New macros.
* sound.c (Fplay_sound_internal): Coalesce duplicate code.
Fixes: bug#19634
2015-01-25 16:33:41 +00:00
|
|
|
|
/* Run `resume-tty-functions'. */
|
|
|
|
|
Lisp_Object term;
|
|
|
|
|
XSETTERMINAL (term, t);
|
|
|
|
|
CALLN (Frun_hook_with_args, intern ("resume-tty-functions"), term);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-05-20 12:00:16 +00:00
|
|
|
|
set_tty_hooks (t);
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
return Qnil;
|
|
|
|
|
}
|
2005-06-21 15:42:45 +00:00
|
|
|
|
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
|
Mouse
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
2007-05-20 05:13:28 +00:00
|
|
|
|
#ifdef HAVE_GPM
|
2011-04-14 02:52:33 +00:00
|
|
|
|
|
|
|
|
|
#ifndef HAVE_WINDOW_SYSTEM
|
2007-05-30 19:28:11 +00:00
|
|
|
|
void
|
|
|
|
|
term_mouse_moveto (int x, int y)
|
2007-05-30 05:19:55 +00:00
|
|
|
|
{
|
2007-07-11 15:22:11 +00:00
|
|
|
|
/* TODO: how to set mouse position?
|
2007-05-30 05:19:55 +00:00
|
|
|
|
const char *name;
|
|
|
|
|
int fd;
|
|
|
|
|
name = (const char *) ttyname (0);
|
Use emacs_open more consistently when opening files.
This handles EINTR more consistently now, and makes it easier
to introduce other uniform changes to file descriptor handling.
* src/systdio.h: New file.
* src/buffer.c (mmap_init):
* cygw32.c (chdir_to_default_directory):
* dispnew.c (Fopen_termscript):
* emacs.c (Fdaemon_initialized):
* fileio.c (Fdo_auto_save):
* image.c (slurp_file, png_load_body, jpeg_load_body):
* keyboard.c (Fopen_dribble_file):
* lread.c (Fload):
* print.c (Fredirect_debugging_output):
* sysdep.c (get_up_time, procfs_ttyname, procfs_get_total_memory):
* termcap.c (tgetent):
* unexaix.c, unexcoff.c (unexec, adjust_lnnoptrs):
* unexcw.c, unexelf.c, unexhp9k800.c, unexmacosx.c (unexec):
* w32term.c (w32_initialize) [CYGWIN]:
* xfaces.c (Fx_load_color_file):
Use emacs_open instead of plain open, and emacs_fopen instead of
plain fopen.
* dispnew.c, fileio.c, image.c, keyboard.c, lread.c, print.c, sysdep.c:
* xfaces.c: Include sysstdio.h rather than stdio.h, for emacs_fopen.
* callproc.c (default_output_mode): New constant.
(Fcall_process): Use it to call emacs_open instead of plain creat.
* dispnew.c (Fopen_termscript): Fix minor race in opening termscript.
* sysdep.c (emacs_open): Add commentary and don't call file name "path".
(emacs_fopen): New function.
* unexaix.c, unexcoff.c, unexelf.c, unexhp9k800.c, unexmacosx.c:
Include <lisp.h>, for emacs_open.
* unexelf.c (fatal): Remove decl; not needed with <lisp.h> included.
2013-07-06 02:40:50 +00:00
|
|
|
|
fd = emacs_open (name, O_WRONLY, 0);
|
2007-06-03 00:55:34 +00:00
|
|
|
|
SOME_FUNCTION (x, y, fd);
|
Fix races with threads and file descriptors.
* configure.ac (PTY_TTY_NAME_SPRINTF): Use emacs_close, not close.
* src/callproc.c (Fcall_process_region):
* src/dired.c (open_directory):
* src/emacs.c (main, Fdaemon_initialized):
* src/image.c (x_find_image_file):
* src/inotify.c (Finotify_rm_watch):
* src/lread.c (Flocate_file_internal):
* src/process.c (Fnetwork_interface_list, Fnetwork_interface_info):
* src/term.c (term_mouse_moveto, init_tty):
* src/termcap.c (tgetent):
* src/unexaix.c, src/unexcoff.c (report_error, report_error_1, adjust_lnnoptrs)
* src/unexaix.c, src/unexcoff.c, src/unexcw.c, src/unexelf.c (unexec):
* src/unexhp9k800.c, src/unexmacosx.c (unexec):
* src/callproc.c (Fcall_process_region):
Use emacs_close, not close.
* src/sysdep.c (POSIX_CLOSE_RESTART, posix_close) [!POSIX_CLOSE_RESTART]:
New macro and function, which emulates the POSIX_CLOSE_RESTART macro
and posix_close function on current platforms (which all lack them).
(emacs_close): Use it. This should fix the races on GNU/Linux and
on AIX and on future platforms that support POSIX_CLOSE_RESTART,
and it should avoid closing random victim file descriptors on
other platforms.
2013-07-12 02:03:47 +00:00
|
|
|
|
emacs_close (fd);
|
2007-05-30 05:19:55 +00:00
|
|
|
|
last_mouse_x = x;
|
2007-06-03 00:55:34 +00:00
|
|
|
|
last_mouse_y = y; */
|
2007-05-30 05:19:55 +00:00
|
|
|
|
}
|
2011-04-14 02:52:33 +00:00
|
|
|
|
#endif /* HAVE_WINDOW_SYSTEM */
|
2007-05-30 05:19:55 +00:00
|
|
|
|
|
2010-11-02 19:35:12 +00:00
|
|
|
|
/* Implementation of draw_row_with_mouse_face for TTY/GPM. */
|
|
|
|
|
void
|
|
|
|
|
tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row,
|
|
|
|
|
int start_hpos, int end_hpos,
|
|
|
|
|
enum draw_glyphs_face draw)
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
{
|
2010-11-02 19:35:12 +00:00
|
|
|
|
int nglyphs = end_hpos - start_hpos;
|
|
|
|
|
struct frame *f = XFRAME (WINDOW_FRAME (w));
|
2007-05-20 23:29:14 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (f);
|
2010-11-02 19:35:12 +00:00
|
|
|
|
int face_id = tty->mouse_highlight.mouse_face_face_id;
|
|
|
|
|
int save_x, save_y, pos_x, pos_y;
|
2007-05-20 23:29:14 +00:00
|
|
|
|
|
2010-11-02 19:35:12 +00:00
|
|
|
|
if (end_hpos >= row->used[TEXT_AREA])
|
|
|
|
|
nglyphs = row->used[TEXT_AREA] - start_hpos;
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
2010-11-02 19:35:12 +00:00
|
|
|
|
pos_y = row->y + WINDOW_TOP_EDGE_Y (w);
|
|
|
|
|
pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos + WINDOW_LEFT_EDGE_X (w);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
2010-11-02 19:35:12 +00:00
|
|
|
|
/* Save current cursor co-ordinates. */
|
|
|
|
|
save_y = curY (tty);
|
|
|
|
|
save_x = curX (tty);
|
|
|
|
|
cursor_to (f, pos_y, pos_x);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
2010-11-02 19:35:12 +00:00
|
|
|
|
if (draw == DRAW_MOUSE_FACE)
|
|
|
|
|
tty_write_glyphs_with_face (f, row->glyphs[TEXT_AREA] + start_hpos,
|
|
|
|
|
nglyphs, face_id);
|
|
|
|
|
else if (draw == DRAW_NORMAL_TEXT)
|
|
|
|
|
write_glyphs (f, row->glyphs[TEXT_AREA] + start_hpos, nglyphs);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
2010-11-02 19:35:12 +00:00
|
|
|
|
cursor_to (f, save_y, save_x);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
static bool
|
Drop FRAME_PTR typedef.
* composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h:
* ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c:
* menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h:
* nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h:
* w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h:
* w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c:
* xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c:
All related users changed.
2013-08-03 03:29:03 +00:00
|
|
|
|
term_mouse_movement (struct frame *frame, Gpm_Event *event)
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
{
|
|
|
|
|
/* Has the mouse moved off the glyph it was on at the last sighting? */
|
|
|
|
|
if (event->x != last_mouse_x || event->y != last_mouse_y)
|
|
|
|
|
{
|
|
|
|
|
frame->mouse_moved = 1;
|
2010-11-02 19:35:12 +00:00
|
|
|
|
note_mouse_highlight (frame, event->x, event->y);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
/* Remember which glyph we're now on. */
|
|
|
|
|
last_mouse_x = event->x;
|
|
|
|
|
last_mouse_y = event->y;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 21:17:42 +00:00
|
|
|
|
/* Return the Time that corresponds to T. Wrap around on overflow. */
|
|
|
|
|
static Time
|
|
|
|
|
timeval_to_Time (struct timeval const *t)
|
|
|
|
|
{
|
|
|
|
|
Time s_1000, ms;
|
|
|
|
|
|
|
|
|
|
s_1000 = t->tv_sec;
|
|
|
|
|
s_1000 *= 1000;
|
|
|
|
|
ms = t->tv_usec / 1000;
|
|
|
|
|
return s_1000 + ms;
|
|
|
|
|
}
|
|
|
|
|
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
/* Return the current position of the mouse.
|
|
|
|
|
|
|
|
|
|
Set *f to the frame the mouse is in, or zero if the mouse is in no
|
|
|
|
|
Emacs frame. If it is set to zero, all the other arguments are
|
|
|
|
|
garbage.
|
|
|
|
|
|
|
|
|
|
Set *bar_window to Qnil, and *x and *y to the column and
|
|
|
|
|
row of the character cell the mouse is over.
|
|
|
|
|
|
2011-03-09 02:15:18 +00:00
|
|
|
|
Set *timeptr to the time the mouse was at the returned position.
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
2007-06-03 00:55:34 +00:00
|
|
|
|
This clears mouse_moved until the next motion
|
2007-05-30 05:19:55 +00:00
|
|
|
|
event arrives. */
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
static void
|
Drop FRAME_PTR typedef.
* composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h:
* ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c:
* menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h:
* nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h:
* w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h:
* w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c:
* xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c:
All related users changed.
2013-08-03 03:29:03 +00:00
|
|
|
|
term_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
enum scroll_bar_part *part, Lisp_Object *x,
|
Be more systematic about user-interface timestamps.
Before, the code sometimes used 'Time', sometimes 'unsigned long',
and sometimes 'EMACS_UINT', to represent these timestamps. This
change causes it to use 'Time' uniformly, as that's what X uses.
This makes the code easier to follow, and makes it easier to catch
integer overflow bugs such as Bug#8664.
* frame.c (Fmouse_position, Fmouse_pixel_position):
Use Time, not unsigned long, for user-interface timestamps.
* keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
(button_down_time, make_lispy_position, make_lispy_movement): Likewise.
* keyboard.h (last_event_timestamp): Likewise.
* menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
* menu.h (xmenu_show): Likewise.
* term.c (term_mouse_position): Likewise.
* termhooks.h (struct input_event.timestamp): Likewise.
(struct terminal.mouse_position_hook): Likewise.
* xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
* xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
* systime.h (Time): New decl. Pull it in from <X11/X.h> if
HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
what it was before.
* menu.h, termhooks.h: Include "systime.h", for Time.
2011-05-12 20:23:33 +00:00
|
|
|
|
Lisp_Object *y, Time *timeptr)
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
{
|
|
|
|
|
struct timeval now;
|
|
|
|
|
|
|
|
|
|
*fp = SELECTED_FRAME ();
|
2007-05-30 05:19:55 +00:00
|
|
|
|
(*fp)->mouse_moved = 0;
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
|
|
|
|
*bar_window = Qnil;
|
2014-09-24 07:17:51 +00:00
|
|
|
|
*part = scroll_bar_above_handle;
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
2007-06-03 00:55:34 +00:00
|
|
|
|
XSETINT (*x, last_mouse_x);
|
2007-05-30 05:19:55 +00:00
|
|
|
|
XSETINT (*y, last_mouse_y);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
gettimeofday(&now, 0);
|
2012-06-22 21:17:42 +00:00
|
|
|
|
*timeptr = timeval_to_Time (&now);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Prepare a mouse-event in *RESULT for placement in the input queue.
|
|
|
|
|
|
|
|
|
|
If the event is a button press, then note that we have grabbed
|
|
|
|
|
the mouse. */
|
|
|
|
|
|
|
|
|
|
static Lisp_Object
|
|
|
|
|
term_mouse_click (struct input_event *result, Gpm_Event *event,
|
|
|
|
|
struct frame *f)
|
|
|
|
|
{
|
|
|
|
|
struct timeval now;
|
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
|
|
result->kind = GPM_CLICK_EVENT;
|
|
|
|
|
for (i = 0, j = GPM_B_LEFT; i < 3; i++, j >>= 1 )
|
|
|
|
|
{
|
|
|
|
|
if (event->buttons & j) {
|
|
|
|
|
result->code = i; /* button number */
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gettimeofday(&now, 0);
|
2012-06-22 21:17:42 +00:00
|
|
|
|
result->timestamp = timeval_to_Time (&now);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
|
|
|
|
if (event->type & GPM_UP)
|
|
|
|
|
result->modifiers = up_modifier;
|
|
|
|
|
else if (event->type & GPM_DOWN)
|
|
|
|
|
result->modifiers = down_modifier;
|
|
|
|
|
else
|
|
|
|
|
result->modifiers = 0;
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
if (event->type & GPM_SINGLE)
|
|
|
|
|
result->modifiers |= click_modifier;
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
if (event->type & GPM_DOUBLE)
|
|
|
|
|
result->modifiers |= double_modifier;
|
|
|
|
|
|
|
|
|
|
if (event->type & GPM_TRIPLE)
|
|
|
|
|
result->modifiers |= triple_modifier;
|
|
|
|
|
|
|
|
|
|
if (event->type & GPM_DRAG)
|
|
|
|
|
result->modifiers |= drag_modifier;
|
|
|
|
|
|
2007-06-03 00:55:34 +00:00
|
|
|
|
if (!(event->type & (GPM_MOVE | GPM_DRAG))) {
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
|
|
|
|
/* 1 << KG_SHIFT */
|
|
|
|
|
if (event->modifiers & (1 << 0))
|
|
|
|
|
result->modifiers |= shift_modifier;
|
|
|
|
|
|
|
|
|
|
/* 1 << KG_CTRL */
|
|
|
|
|
if (event->modifiers & (1 << 2))
|
|
|
|
|
result->modifiers |= ctrl_modifier;
|
|
|
|
|
|
|
|
|
|
/* 1 << KG_ALT || KG_ALTGR */
|
|
|
|
|
if (event->modifiers & (1 << 3)
|
|
|
|
|
|| event->modifiers & (1 << 1))
|
|
|
|
|
result->modifiers |= meta_modifier;
|
|
|
|
|
}
|
|
|
|
|
|
2007-06-03 00:55:34 +00:00
|
|
|
|
XSETINT (result->x, event->x);
|
|
|
|
|
XSETINT (result->y, event->y);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
XSETFRAME (result->frame_or_window, f);
|
|
|
|
|
result->arg = Qnil;
|
|
|
|
|
return Qnil;
|
|
|
|
|
}
|
|
|
|
|
|
2008-02-27 22:49:29 +00:00
|
|
|
|
int
|
2017-02-19 02:16:37 +00:00
|
|
|
|
handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event,
|
|
|
|
|
struct input_event *hold_quit)
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
{
|
2007-05-20 23:29:14 +00:00
|
|
|
|
struct frame *f = XFRAME (tty->top_frame);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
struct input_event ie;
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
bool do_help = 0;
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
|
|
EVENT_INIT (ie);
|
|
|
|
|
ie.kind = NO_EVENT;
|
|
|
|
|
ie.arg = Qnil;
|
|
|
|
|
|
2007-06-03 00:55:34 +00:00
|
|
|
|
if (event->type & (GPM_MOVE | GPM_DRAG)) {
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
previous_help_echo_string = help_echo_string;
|
|
|
|
|
help_echo_string = Qnil;
|
|
|
|
|
|
2007-09-28 19:47:02 +00:00
|
|
|
|
Gpm_DrawPointer (event->x, event->y, fileno (tty->output));
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
2007-06-03 00:55:34 +00:00
|
|
|
|
if (!term_mouse_movement (f, event))
|
|
|
|
|
help_echo_string = previous_help_echo_string;
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
|
|
|
|
/* If the contents of the global variable help_echo_string
|
|
|
|
|
has changed, generate a HELP_EVENT. */
|
|
|
|
|
if (!NILP (help_echo_string)
|
|
|
|
|
|| !NILP (previous_help_echo_string))
|
|
|
|
|
do_help = 1;
|
|
|
|
|
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
f->mouse_moved = 0;
|
|
|
|
|
term_mouse_click (&ie, event, f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
if (ie.kind != NO_EVENT)
|
|
|
|
|
{
|
|
|
|
|
kbd_buffer_store_event_hold (&ie, hold_quit);
|
|
|
|
|
count++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (do_help
|
|
|
|
|
&& !(hold_quit && hold_quit->kind != NO_EVENT))
|
|
|
|
|
{
|
|
|
|
|
Lisp_Object frame;
|
|
|
|
|
|
|
|
|
|
if (f)
|
|
|
|
|
XSETFRAME (frame, f);
|
|
|
|
|
else
|
|
|
|
|
frame = Qnil;
|
|
|
|
|
|
|
|
|
|
gen_help_event (help_echo_string, frame, help_echo_window,
|
|
|
|
|
help_echo_object, help_echo_pos);
|
|
|
|
|
count++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return count;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-28 19:47:02 +00:00
|
|
|
|
DEFUN ("gpm-mouse-start", Fgpm_mouse_start, Sgpm_mouse_start,
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
0, 0, 0,
|
2007-09-21 17:10:48 +00:00
|
|
|
|
doc: /* Open a connection to Gpm.
|
2007-09-28 19:47:02 +00:00
|
|
|
|
Gpm-mouse can only be activated for one tty at a time. */)
|
2010-07-08 21:25:08 +00:00
|
|
|
|
(void)
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
{
|
2007-09-21 17:10:48 +00:00
|
|
|
|
struct frame *f = SELECTED_FRAME ();
|
|
|
|
|
struct tty_display_info *tty
|
|
|
|
|
= ((f)->output_method == output_termcap
|
|
|
|
|
? (f)->terminal->display_info.tty : NULL);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
Gpm_Connect connection;
|
|
|
|
|
|
2007-09-28 19:47:02 +00:00
|
|
|
|
if (!tty)
|
|
|
|
|
error ("Gpm-mouse only works in the GNU/Linux console");
|
2007-09-28 20:07:54 +00:00
|
|
|
|
if (gpm_tty == tty)
|
|
|
|
|
return Qnil; /* Already activated, nothing to do. */
|
|
|
|
|
if (gpm_tty)
|
|
|
|
|
error ("Gpm-mouse can only be activated for one tty at a time");
|
2007-09-21 17:10:48 +00:00
|
|
|
|
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
connection.eventMask = ~0;
|
|
|
|
|
connection.defaultMask = ~GPM_HARD;
|
|
|
|
|
connection.maxMod = ~0;
|
|
|
|
|
connection.minMod = 0;
|
2007-06-03 00:55:34 +00:00
|
|
|
|
gpm_zerobased = 1;
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
|
|
|
|
if (Gpm_Open (&connection, 0) < 0)
|
2007-09-28 19:47:02 +00:00
|
|
|
|
error ("Gpm-mouse failed to connect to the gpm daemon");
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2007-09-21 17:10:48 +00:00
|
|
|
|
gpm_tty = tty;
|
2007-09-27 21:19:54 +00:00
|
|
|
|
/* `init_sys_modes' arranges for mouse movements sent through gpm_fd
|
|
|
|
|
to generate SIGIOs. Apparently we need to call reset_sys_modes
|
|
|
|
|
before calling init_sys_modes. */
|
2007-05-20 23:29:14 +00:00
|
|
|
|
reset_sys_modes (tty);
|
|
|
|
|
init_sys_modes (tty);
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
add_gpm_wait_descriptor (gpm_fd);
|
2007-09-28 19:47:02 +00:00
|
|
|
|
return Qnil;
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-09-12 04:10:59 +00:00
|
|
|
|
void
|
2009-03-27 16:14:23 +00:00
|
|
|
|
close_gpm (int fd)
|
2008-09-12 04:10:59 +00:00
|
|
|
|
{
|
2009-03-27 16:14:23 +00:00
|
|
|
|
if (fd >= 0)
|
|
|
|
|
delete_gpm_wait_descriptor (fd);
|
2008-09-12 04:10:59 +00:00
|
|
|
|
while (Gpm_Close()); /* close all the stack */
|
|
|
|
|
gpm_tty = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-28 19:47:02 +00:00
|
|
|
|
DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop,
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
0, 0, 0,
|
|
|
|
|
doc: /* Close a connection to Gpm. */)
|
2010-07-08 21:25:08 +00:00
|
|
|
|
(void)
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
{
|
2007-09-28 20:07:54 +00:00
|
|
|
|
struct frame *f = SELECTED_FRAME ();
|
|
|
|
|
struct tty_display_info *tty
|
|
|
|
|
= ((f)->output_method == output_termcap
|
|
|
|
|
? (f)->terminal->display_info.tty : NULL);
|
|
|
|
|
|
|
|
|
|
if (!tty || gpm_tty != tty)
|
|
|
|
|
return Qnil; /* Not activated on this terminal, nothing to do. */
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
2009-03-27 16:14:23 +00:00
|
|
|
|
close_gpm (gpm_fd);
|
2007-09-28 19:47:02 +00:00
|
|
|
|
return Qnil;
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
}
|
2007-05-20 05:13:28 +00:00
|
|
|
|
#endif /* HAVE_GPM */
|
(write_glyphs_with_face): New function.
[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
(mouse_face_face_id, term_gpm, pos_x, pos_y)
(last_mouse_x, last_mouse_y): New variables.
(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
(term_mouse_highlight, term_mouse_movement, term_mouse_position)
(term_mouse_click, handle_one_term_event, Fterm_open_connection)
(Fterm_close_connection): New functions.
(term_init): Initialise mouse_face_window.
2007-05-20 02:27:53 +00:00
|
|
|
|
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
|
Menus
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
2013-11-29 01:22:40 +00:00
|
|
|
|
#if !defined (MSDOS)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
|
|
|
|
/* TTY menu implementation and main ideas are borrowed from msdos.c.
|
|
|
|
|
|
|
|
|
|
However, unlike on MSDOS, where the menu text is drawn directly to
|
2013-09-19 11:28:37 +00:00
|
|
|
|
the display video memory, on a TTY we use display_string (see
|
|
|
|
|
display_tty_menu_item in xdisp.c) to put the glyphs produced from
|
2013-10-14 15:37:12 +00:00
|
|
|
|
the menu items into the frame's 'desired_matrix' glyph matrix, and
|
|
|
|
|
then call update_frame_with_menu to deliver the results to the
|
|
|
|
|
glass. The previous contents of the screen, in the form of the
|
|
|
|
|
current_matrix, is stashed away, and used to restore screen
|
2012-06-02 14:57:51 +00:00
|
|
|
|
contents when the menu selection changes or when the final
|
|
|
|
|
selection is made and the menu should be popped down.
|
|
|
|
|
|
2012-08-11 14:34:55 +00:00
|
|
|
|
The idea of this implementation was suggested by Gerd Moellmann. */
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
|
|
|
|
#define TTYM_FAILURE -1
|
|
|
|
|
#define TTYM_SUCCESS 1
|
|
|
|
|
#define TTYM_NO_SELECT 2
|
|
|
|
|
#define TTYM_IA_SELECT 3
|
2013-10-08 14:28:37 +00:00
|
|
|
|
#define TTYM_NEXT 4
|
|
|
|
|
#define TTYM_PREV 5
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
|
|
|
|
/* These hold text of the current and the previous menu help messages. */
|
|
|
|
|
static const char *menu_help_message, *prev_menu_help_message;
|
|
|
|
|
/* Pane number and item number of the menu item which generated the
|
|
|
|
|
last menu help message. */
|
|
|
|
|
static int menu_help_paneno, menu_help_itemno;
|
|
|
|
|
|
|
|
|
|
typedef struct tty_menu_struct
|
|
|
|
|
{
|
|
|
|
|
int count;
|
|
|
|
|
char **text;
|
|
|
|
|
struct tty_menu_struct **submenu;
|
2013-09-26 08:10:53 +00:00
|
|
|
|
int *panenumber; /* Also used as enabled flag. */
|
Fix minor problems found by static checking.
* dispnew.c (save_current_matrix): Omit unnecessary casts.
* dispnew.c (update_frame_with_menu): Mark debug local as used.
* keyboard.c, keyboard.h (Qmouse_movement): Now static.
* keyboard.c (read_menu_command): Remove unused local.
* lisp.h (read_menu_command): New decl.
* menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for
benefit of STRING_CHAR_AND_LENGTH. All uses changed.
Return ptrdiff_t, not int.
* term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t,
not int, for benefit of xpalloc.
(tty_menu_create, tty_menu_make_room): Simplify by using xzalloc
and xpalloc.
(have_menus_p): Remove; unused.
(tty_menu_add_pane, tty_menu_add_selection): Change signedness of
local char * pointer to pacify STRING_CHAR_AND_LENGTH.
(tty_menu_add_selection, tty_menu_locate, tty_meny_destroy):
Now static.
(save_and_enable_current_matrix): Omit unnecessary casts.
(read_menu_input): Omit local extern decl (now in lisp.h).
Don't access uninitialized storage if mouse_get_xy fails.
(tty_menu_activate): Mark local as initialized, for lint.
(tty_menu_activate, tty_meny_show): Remove unused locals.
2013-10-08 20:04:40 +00:00
|
|
|
|
ptrdiff_t allocated;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
int panecount;
|
|
|
|
|
int width;
|
|
|
|
|
const char **help_text;
|
|
|
|
|
} tty_menu;
|
|
|
|
|
|
|
|
|
|
/* Create a brand new menu structure. */
|
|
|
|
|
|
2018-04-28 23:49:24 +00:00
|
|
|
|
static tty_menu * ATTRIBUTE_MALLOC
|
2012-06-02 14:57:51 +00:00
|
|
|
|
tty_menu_create (void)
|
|
|
|
|
{
|
Fix minor problems found by static checking.
* dispnew.c (save_current_matrix): Omit unnecessary casts.
* dispnew.c (update_frame_with_menu): Mark debug local as used.
* keyboard.c, keyboard.h (Qmouse_movement): Now static.
* keyboard.c (read_menu_command): Remove unused local.
* lisp.h (read_menu_command): New decl.
* menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for
benefit of STRING_CHAR_AND_LENGTH. All uses changed.
Return ptrdiff_t, not int.
* term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t,
not int, for benefit of xpalloc.
(tty_menu_create, tty_menu_make_room): Simplify by using xzalloc
and xpalloc.
(have_menus_p): Remove; unused.
(tty_menu_add_pane, tty_menu_add_selection): Change signedness of
local char * pointer to pacify STRING_CHAR_AND_LENGTH.
(tty_menu_add_selection, tty_menu_locate, tty_meny_destroy):
Now static.
(save_and_enable_current_matrix): Omit unnecessary casts.
(read_menu_input): Omit local extern decl (now in lisp.h).
Don't access uninitialized storage if mouse_get_xy fails.
(tty_menu_activate): Mark local as initialized, for lint.
(tty_menu_activate, tty_meny_show): Remove unused locals.
2013-10-08 20:04:40 +00:00
|
|
|
|
return xzalloc (sizeof *tty_menu_create ());
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Allocate some (more) memory for MENU ensuring that there is room for one
|
Fix minor problems found by static checking.
* dispnew.c (save_current_matrix): Omit unnecessary casts.
* dispnew.c (update_frame_with_menu): Mark debug local as used.
* keyboard.c, keyboard.h (Qmouse_movement): Now static.
* keyboard.c (read_menu_command): Remove unused local.
* lisp.h (read_menu_command): New decl.
* menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for
benefit of STRING_CHAR_AND_LENGTH. All uses changed.
Return ptrdiff_t, not int.
* term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t,
not int, for benefit of xpalloc.
(tty_menu_create, tty_menu_make_room): Simplify by using xzalloc
and xpalloc.
(have_menus_p): Remove; unused.
(tty_menu_add_pane, tty_menu_add_selection): Change signedness of
local char * pointer to pacify STRING_CHAR_AND_LENGTH.
(tty_menu_add_selection, tty_menu_locate, tty_meny_destroy):
Now static.
(save_and_enable_current_matrix): Omit unnecessary casts.
(read_menu_input): Omit local extern decl (now in lisp.h).
Don't access uninitialized storage if mouse_get_xy fails.
(tty_menu_activate): Mark local as initialized, for lint.
(tty_menu_activate, tty_meny_show): Remove unused locals.
2013-10-08 20:04:40 +00:00
|
|
|
|
more item. */
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
tty_menu_make_room (tty_menu *menu)
|
|
|
|
|
{
|
Fix minor problems found by static checking.
* dispnew.c (save_current_matrix): Omit unnecessary casts.
* dispnew.c (update_frame_with_menu): Mark debug local as used.
* keyboard.c, keyboard.h (Qmouse_movement): Now static.
* keyboard.c (read_menu_command): Remove unused local.
* lisp.h (read_menu_command): New decl.
* menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for
benefit of STRING_CHAR_AND_LENGTH. All uses changed.
Return ptrdiff_t, not int.
* term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t,
not int, for benefit of xpalloc.
(tty_menu_create, tty_menu_make_room): Simplify by using xzalloc
and xpalloc.
(have_menus_p): Remove; unused.
(tty_menu_add_pane, tty_menu_add_selection): Change signedness of
local char * pointer to pacify STRING_CHAR_AND_LENGTH.
(tty_menu_add_selection, tty_menu_locate, tty_meny_destroy):
Now static.
(save_and_enable_current_matrix): Omit unnecessary casts.
(read_menu_input): Omit local extern decl (now in lisp.h).
Don't access uninitialized storage if mouse_get_xy fails.
(tty_menu_activate): Mark local as initialized, for lint.
(tty_menu_activate, tty_meny_show): Remove unused locals.
2013-10-08 20:04:40 +00:00
|
|
|
|
if (menu->allocated == menu->count)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
Fix minor problems found by static checking.
* dispnew.c (save_current_matrix): Omit unnecessary casts.
* dispnew.c (update_frame_with_menu): Mark debug local as used.
* keyboard.c, keyboard.h (Qmouse_movement): Now static.
* keyboard.c (read_menu_command): Remove unused local.
* lisp.h (read_menu_command): New decl.
* menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for
benefit of STRING_CHAR_AND_LENGTH. All uses changed.
Return ptrdiff_t, not int.
* term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t,
not int, for benefit of xpalloc.
(tty_menu_create, tty_menu_make_room): Simplify by using xzalloc
and xpalloc.
(have_menus_p): Remove; unused.
(tty_menu_add_pane, tty_menu_add_selection): Change signedness of
local char * pointer to pacify STRING_CHAR_AND_LENGTH.
(tty_menu_add_selection, tty_menu_locate, tty_meny_destroy):
Now static.
(save_and_enable_current_matrix): Omit unnecessary casts.
(read_menu_input): Omit local extern decl (now in lisp.h).
Don't access uninitialized storage if mouse_get_xy fails.
(tty_menu_activate): Mark local as initialized, for lint.
(tty_menu_activate, tty_meny_show): Remove unused locals.
2013-10-08 20:04:40 +00:00
|
|
|
|
ptrdiff_t allocated = menu->allocated;
|
|
|
|
|
menu->text = xpalloc (menu->text, &allocated, 1, -1, sizeof *menu->text);
|
|
|
|
|
menu->text = xrealloc (menu->text, allocated * sizeof *menu->text);
|
|
|
|
|
menu->submenu = xrealloc (menu->submenu,
|
|
|
|
|
allocated * sizeof *menu->submenu);
|
|
|
|
|
menu->panenumber = xrealloc (menu->panenumber,
|
|
|
|
|
allocated * sizeof *menu->panenumber);
|
|
|
|
|
menu->help_text = xrealloc (menu->help_text,
|
|
|
|
|
allocated * sizeof *menu->help_text);
|
|
|
|
|
menu->allocated = allocated;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Search the given menu structure for a given pane number. */
|
|
|
|
|
|
|
|
|
|
static tty_menu *
|
|
|
|
|
tty_menu_search_pane (tty_menu *menu, int pane)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
tty_menu *try;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < menu->count; i++)
|
|
|
|
|
if (menu->submenu[i])
|
|
|
|
|
{
|
|
|
|
|
if (pane == menu->panenumber[i])
|
|
|
|
|
return menu->submenu[i];
|
2013-11-06 00:14:56 +00:00
|
|
|
|
try = tty_menu_search_pane (menu->submenu[i], pane);
|
|
|
|
|
if (try)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
return try;
|
|
|
|
|
}
|
|
|
|
|
return (tty_menu *) 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Determine how much screen space a given menu needs. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
tty_menu_calc_size (tty_menu *menu, int *width, int *height)
|
|
|
|
|
{
|
|
|
|
|
int i, h2, w2, maxsubwidth, maxheight;
|
|
|
|
|
|
2013-09-19 12:03:40 +00:00
|
|
|
|
maxsubwidth = menu->width;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
maxheight = menu->count;
|
|
|
|
|
for (i = 0; i < menu->count; i++)
|
|
|
|
|
{
|
|
|
|
|
if (menu->submenu[i])
|
|
|
|
|
{
|
|
|
|
|
tty_menu_calc_size (menu->submenu[i], &w2, &h2);
|
|
|
|
|
if (w2 > maxsubwidth) maxsubwidth = w2;
|
|
|
|
|
if (i + h2 > maxheight) maxheight = i + h2;
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-09-19 12:03:40 +00:00
|
|
|
|
*width = maxsubwidth;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
*height = maxheight;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-25 14:51:39 +00:00
|
|
|
|
static void
|
|
|
|
|
mouse_get_xy (int *x, int *y)
|
|
|
|
|
{
|
|
|
|
|
struct frame *sf = SELECTED_FRAME ();
|
2013-09-26 08:10:53 +00:00
|
|
|
|
Lisp_Object lmx = Qnil, lmy = Qnil, lisp_dummy;
|
2013-09-25 14:51:39 +00:00
|
|
|
|
enum scroll_bar_part part_dummy;
|
|
|
|
|
Time time_dummy;
|
|
|
|
|
|
|
|
|
|
if (FRAME_TERMINAL (sf)->mouse_position_hook)
|
|
|
|
|
(*FRAME_TERMINAL (sf)->mouse_position_hook) (&sf, -1,
|
|
|
|
|
&lisp_dummy, &part_dummy,
|
|
|
|
|
&lmx, &lmy,
|
|
|
|
|
&time_dummy);
|
|
|
|
|
if (!NILP (lmx))
|
|
|
|
|
{
|
More macro renamings for bignum
* src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
src/category.c, src/ccl.c, src/character.c, src/character.h,
src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
2018-08-08 00:08:53 +00:00
|
|
|
|
*x = XFIXNUM (lmx);
|
|
|
|
|
*y = XFIXNUM (lmy);
|
2013-09-25 14:51:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-14 15:37:12 +00:00
|
|
|
|
/* Display MENU at (X,Y) using FACES, starting with FIRST_ITEM
|
|
|
|
|
(zero-based). */
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
|
|
|
|
static void
|
2013-09-17 12:47:37 +00:00
|
|
|
|
tty_menu_display (tty_menu *menu, int x, int y, int pn, int *faces,
|
2013-11-06 00:14:56 +00:00
|
|
|
|
int mx, int my, int first_item, bool disp_help)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
2013-09-25 15:07:19 +00:00
|
|
|
|
int i, face, width, enabled, mousehere, row, col;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
struct frame *sf = SELECTED_FRAME ();
|
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (sf);
|
2013-10-11 11:01:48 +00:00
|
|
|
|
/* Don't try to display more menu items than the console can display
|
|
|
|
|
using the available screen lines. Exclude the echo area line, as
|
|
|
|
|
it will be overwritten by the help-echo anyway. */
|
2014-08-10 08:26:28 +00:00
|
|
|
|
int max_items = min (menu->count - first_item, FRAME_TOTAL_LINES (sf) - 1 - y);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
|
|
|
|
menu_help_message = NULL;
|
|
|
|
|
|
|
|
|
|
width = menu->width;
|
2013-09-05 11:00:55 +00:00
|
|
|
|
col = cursorX (tty);
|
|
|
|
|
row = cursorY (tty);
|
2013-10-11 11:01:48 +00:00
|
|
|
|
for (i = 0; i < max_items; i++)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
2013-09-17 15:31:37 +00:00
|
|
|
|
int max_width = width + 2; /* +2 for padding blanks on each side */
|
2013-10-14 15:37:12 +00:00
|
|
|
|
int j = i + first_item;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
2013-10-14 15:37:12 +00:00
|
|
|
|
if (menu->submenu[j])
|
2013-09-17 15:31:37 +00:00
|
|
|
|
max_width += 2; /* for displaying " >" after the item */
|
2012-06-02 14:57:51 +00:00
|
|
|
|
enabled
|
2013-10-14 15:37:12 +00:00
|
|
|
|
= (!menu->submenu[j] && menu->panenumber[j]) || (menu->submenu[j]);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
mousehere = (y + i == my && x <= mx && mx < x + max_width);
|
|
|
|
|
face = faces[enabled + mousehere * 2];
|
|
|
|
|
/* Display the menu help string for the i-th menu item even if
|
|
|
|
|
the menu item is currently disabled. That's what the GUI
|
|
|
|
|
code does. */
|
|
|
|
|
if (disp_help && enabled + mousehere * 2 >= 2)
|
|
|
|
|
{
|
2013-10-14 15:37:12 +00:00
|
|
|
|
menu_help_message = menu->help_text[j];
|
2012-06-02 14:57:51 +00:00
|
|
|
|
menu_help_paneno = pn - 1;
|
2013-10-14 15:37:12 +00:00
|
|
|
|
menu_help_itemno = j;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
2014-04-29 15:33:37 +00:00
|
|
|
|
/* Take note of the coordinates of the active menu item, to
|
|
|
|
|
display the cursor there. */
|
|
|
|
|
if (mousehere)
|
|
|
|
|
{
|
|
|
|
|
row = y + i;
|
|
|
|
|
col = x;
|
|
|
|
|
}
|
2013-10-14 15:37:12 +00:00
|
|
|
|
display_tty_menu_item (menu->text[j], max_width, face, x, y + i,
|
|
|
|
|
menu->submenu[j] != NULL);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
2014-06-04 09:16:46 +00:00
|
|
|
|
update_frame_with_menu (sf, row, col);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* --------------------------- X Menu emulation ---------------------- */
|
|
|
|
|
|
|
|
|
|
/* Create a new pane and place it on the outer-most level. */
|
|
|
|
|
|
2013-09-05 11:00:55 +00:00
|
|
|
|
static int
|
|
|
|
|
tty_menu_add_pane (tty_menu *menu, const char *txt)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
int len;
|
|
|
|
|
|
|
|
|
|
tty_menu_make_room (menu);
|
|
|
|
|
menu->submenu[menu->count] = tty_menu_create ();
|
|
|
|
|
menu->text[menu->count] = (char *)txt;
|
|
|
|
|
menu->panenumber[menu->count] = ++menu->panecount;
|
|
|
|
|
menu->help_text[menu->count] = NULL;
|
|
|
|
|
menu->count++;
|
|
|
|
|
|
|
|
|
|
/* Update the menu width, if necessary. */
|
2014-07-14 15:06:52 +00:00
|
|
|
|
len = menu_item_width ((const unsigned char *) txt);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
if (len > menu->width)
|
|
|
|
|
menu->width = len;
|
|
|
|
|
|
|
|
|
|
return menu->panecount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Create a new item in a menu pane. */
|
|
|
|
|
|
2013-11-06 00:14:56 +00:00
|
|
|
|
static bool
|
2012-06-02 14:57:51 +00:00
|
|
|
|
tty_menu_add_selection (tty_menu *menu, int pane,
|
2013-11-06 00:14:56 +00:00
|
|
|
|
char *txt, bool enable, char const *help_text)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
int len;
|
|
|
|
|
|
|
|
|
|
if (pane)
|
2013-11-06 00:14:56 +00:00
|
|
|
|
{
|
|
|
|
|
menu = tty_menu_search_pane (menu, pane);
|
|
|
|
|
if (! menu)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2012-06-02 14:57:51 +00:00
|
|
|
|
tty_menu_make_room (menu);
|
|
|
|
|
menu->submenu[menu->count] = (tty_menu *) 0;
|
|
|
|
|
menu->text[menu->count] = txt;
|
|
|
|
|
menu->panenumber[menu->count] = enable;
|
|
|
|
|
menu->help_text[menu->count] = help_text;
|
|
|
|
|
menu->count++;
|
|
|
|
|
|
|
|
|
|
/* Update the menu width, if necessary. */
|
2014-07-14 15:06:52 +00:00
|
|
|
|
len = menu_item_width ((const unsigned char *) txt);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
if (len > menu->width)
|
|
|
|
|
menu->width = len;
|
|
|
|
|
|
2013-11-06 00:14:56 +00:00
|
|
|
|
return 1;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Decide where the menu would be placed if requested at (X,Y). */
|
|
|
|
|
|
Fix minor problems found by static checking.
* dispnew.c (save_current_matrix): Omit unnecessary casts.
* dispnew.c (update_frame_with_menu): Mark debug local as used.
* keyboard.c, keyboard.h (Qmouse_movement): Now static.
* keyboard.c (read_menu_command): Remove unused local.
* lisp.h (read_menu_command): New decl.
* menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for
benefit of STRING_CHAR_AND_LENGTH. All uses changed.
Return ptrdiff_t, not int.
* term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t,
not int, for benefit of xpalloc.
(tty_menu_create, tty_menu_make_room): Simplify by using xzalloc
and xpalloc.
(have_menus_p): Remove; unused.
(tty_menu_add_pane, tty_menu_add_selection): Change signedness of
local char * pointer to pacify STRING_CHAR_AND_LENGTH.
(tty_menu_add_selection, tty_menu_locate, tty_meny_destroy):
Now static.
(save_and_enable_current_matrix): Omit unnecessary casts.
(read_menu_input): Omit local extern decl (now in lisp.h).
Don't access uninitialized storage if mouse_get_xy fails.
(tty_menu_activate): Mark local as initialized, for lint.
(tty_menu_activate, tty_meny_show): Remove unused locals.
2013-10-08 20:04:40 +00:00
|
|
|
|
static void
|
2012-06-02 14:57:51 +00:00
|
|
|
|
tty_menu_locate (tty_menu *menu, int x, int y,
|
|
|
|
|
int *ulx, int *uly, int *width, int *height)
|
|
|
|
|
{
|
|
|
|
|
tty_menu_calc_size (menu, width, height);
|
|
|
|
|
*ulx = x + 1;
|
|
|
|
|
*uly = y;
|
|
|
|
|
*width += 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct tty_menu_state
|
|
|
|
|
{
|
2012-08-11 14:34:55 +00:00
|
|
|
|
struct glyph_matrix *screen_behind;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
tty_menu *menu;
|
|
|
|
|
int pane;
|
|
|
|
|
int x, y;
|
|
|
|
|
};
|
|
|
|
|
|
2013-09-24 16:07:35 +00:00
|
|
|
|
/* Save away the contents of frame F's current frame matrix, and
|
|
|
|
|
enable all its rows. Value is a glyph matrix holding the contents
|
|
|
|
|
of F's current frame matrix with all its glyph rows enabled. */
|
|
|
|
|
|
Support menus on text-mode terminals.
src/xterm.h (xw_popup_dialog): Add prototype.
src/xmenu.c (Fx_popup_dialog): Function moved to menu.c.
(xmenu_show): Block input here, instead in Fx_popup_menu.
(xw_popup_dialog): New function, with X-specific bits of popup
dialogs.
src/xdisp.c (deep_copy_glyph_row, display_tty_menu_item): New
functions.
src/window.c (Fset_window_configuration): Use run-time tests of the
frame type instead of compile-time conditionals, when menu-bar
lines are considered.
src/w32term.h (w32con_hide_cursor, w32con_show_cursor)
(w32_popup_dialog): New prototypes.
src/w32menu.c (Fx_popup_dialog): Function deleted.
(w32_popup_dialog): New function, with w32 specific bits of popup
dialogs. Block input here.
src/w32inevt.c (w32_console_read_socket): Minor change to add
debugging TTY events.
src/w32fns.c (show_hourglass): If returning early because the frame
is not a GUI frame, unblock input.
src/w32console.c (w32con_hide_cursor, w32con_show_cursor, cursorX)
(cursorY): New functions.
src/termhooks.h (cursorX, cursorY): Prototypes of functions on
WINDOWSNT, macros that call curX and curY elsewhere.
src/termchar.h (struct tty_display_info) <showing_menu>: New flag.
src/term.c (tty_hide_cursor, tty_show_cursor) [WINDOWSNT]: Call w32
specific function to hide and show cursor on a text-mode terminal.
(tty_menu_struct, struct tty_menu_state): New structures.
(tty_menu_create, tty_menu_make_room, tty_menu_search_pane)
(tty_menu_calc_size, mouse_get_xy, tty_menu_display)
(have_menus_p, tty_menu_add_pane, tty_menu_add_selection)
(tty_menu_locate, save_and_enable_current_matrix)
(restore_desired_matrix, screen_update, read_menu_input)
(tty_menu_activate, tty_menu_destroy, tty_menu_help_callback)
(tty_pop_down_menu, tty_menu_last_menubar_item)
(tty_menu_new_item_coords, tty_menu_show): New functions.
(syms_of_term): New DEFSYMs for tty-menu-* symbols.
src/nsterm.h (ns_popup_dialog): Adjust prototype.
src/nsmenu.m (ns_menu_show): Block and unblock input here, instead
of in x-popup-menu.
(ns_popup_dialog): Adapt order of arguments to the other
*_menu_show implementations.
(Fx_popup_dialog): Function deleted.
src/msdos.c (x_set_menu_bar_lines): Delete unused function.
src/menu.h (tty_menu_show, menu_item_width): provide prototypes.
src/menu.c (have_boxes): New function.
(single_keymap_panes): Use it instead of a compile-time
conditional.
(single_menu_item): Use run-time tests of the frame type instead
of compile-time conditionals.
(encode_menu_string): New function.
(list_of_items, list_of_panes): Use it instead of ENCODE_STRING
the macro, since different types of frame need different encoding
of menu items.
(digest_single_submenu): Use run-time tests of frame type instead
of, or in addition to, compile-time conditionals.
(menu_item_width, Fmenu_bar_menu_at_x_y): New functions.
(Fx_popup_menu): Detect when the function is called from keyboard
on a TTY. Don't barf when invoked on a text-mode frame. Check
frame type at run time, instead of compile-time conditionals for
invoking terminal-specific menu-show functions. Call
tty_menu_show on text-mode frames.
(Fx_popup_dialog): Moved here from xmenu.c. Test frame types at
run time to determine which alternative to invoke; support dialogs
on TTYs.
src/keyboard.h <Qmouse_movement>: Declare.
src/keyboard.c <Qmouse_movement>: Now extern.
<Qecho_keystrokes>: New static variable.
(read_key_sequence): Accept an additional argument, a flag to
prevent redisplay during reading of the key sequence. All callers
changed.
(read_menu_command): New function.
(read_char): When COMMANDFLAG is -2, do not redisplay and do not
autosave.
(toolkit_menubar_in_use): New function.
(make_lispy_event): Use it instead of a compile-time test.
src/fns.c (Fyes_or_no_p) [HAVE_MENUS]: Don't condition on
window-system being available.
src/editfns.c (Fmessage_box) [HAVE_MENUS]: Don't condition the call
to x-popup-dialog on the frame type, they all now support popup
dialogs.
src/dispnew.c (save_current_matrix): Save the margin areas.
(restore_current_matrix): Restore margin areas.
(update_frame_with_menu): New function.
src/dispextern.h (display_tty_menu_item, update_frame_with_menu):
Add prototypes.
src/alloc.c (make_save_ptr): Now compiled unconditionally.
lisp/tmm.el (tmm-menubar): Adapt doc string to TTY menus
functionality.
lisp/tooltip.el (tooltip-mode): Don't error out on TTYs.
lisp/menu-bar.el (popup-menu, popup-menu-normalize-position): Moved
here from mouse.el.
(popup-menu): Support menu-bar navigation on TTYs using C-f/C-b
and arrow keys.
(tty-menu-navigation-map): New map for TTY menu navigation.
lisp/loadup.el ("tooltip"): Load even if x-show-tip is not available.
lisp/frame.el (display-mouse-p): Report text-mode mouse as available
on w32.
(display-popup-menus-p): Report availability if mouse is
available; don't condition on window-system.
lisp/faces.el (tty-menu-enabled-face, tty-menu-disabled-face)
(tty-menu-selected-face): New faces.
configure.ac (HAVE_MENUS): Define unconditionally.
doc/emacs/screen.texi (Menu Bar): Adapt to TTY menus.
doc/emacs/frames.texi (Frames): Mention menu support on text terminals.
doc/emacs/files.texi (Visiting): Mention the "File" menu-bar menu.
doc/emacs/display.texi (Standard Faces): Mention TTY faces for menus.
doc/lispref/keymaps.texi (Defining Menus, Mouse Menus, Menu Bar): Modify
wording to the effect that menus are supported on TTYs.
doc/lisprefframes.texi (Pop-Up Menus, Dialog Boxes)
(Display Feature Testing): Update for menu support on TTYs.
etc/NEWS: Mention the new features.
2013-10-08 17:49:20 +00:00
|
|
|
|
static struct glyph_matrix *
|
2013-09-24 16:07:35 +00:00
|
|
|
|
save_and_enable_current_matrix (struct frame *f)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
struct glyph_matrix *saved = xzalloc (sizeof *saved);
|
|
|
|
|
saved->nrows = f->current_matrix->nrows;
|
|
|
|
|
saved->rows = xzalloc (saved->nrows * sizeof *saved->rows);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < saved->nrows; ++i)
|
|
|
|
|
{
|
|
|
|
|
struct glyph_row *from = f->current_matrix->rows + i;
|
|
|
|
|
struct glyph_row *to = saved->rows + i;
|
|
|
|
|
ptrdiff_t nbytes = from->used[TEXT_AREA] * sizeof (struct glyph);
|
|
|
|
|
|
|
|
|
|
to->glyphs[TEXT_AREA] = xmalloc (nbytes);
|
|
|
|
|
memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes);
|
|
|
|
|
to->used[TEXT_AREA] = from->used[TEXT_AREA];
|
|
|
|
|
/* Make sure every row is enabled, or else update_frame will not
|
|
|
|
|
redraw them. (Rows that are identical to what is already on
|
|
|
|
|
screen will not be redrawn anyway.) */
|
Use bool for boolean, focusing on headers.
* configure.ac (PTY_OPEN, GC_MARK_SECONDARY_STACK):
Use bool for boolean.
* lib-src/emacsclient.c, lib-src/etags.c, lib-src/hexl.c (FALSE, TRUE):
Remove. All uses replaced with uncapitalized version.
* lib-src/emacsclient.c (message):
* lib-src/etags.c (make_tag, pfnote, consider_token, make_C_tag, lang_names):
* lib-src/hexl.c (un_flag, iso_flag, endian):
* lib-src/pop.c (pop_debug, pop_open, pop_multi_first, pop_multi_next)
(pop_trash):
Use bool for boolean.
* lib-src/etags.c (bool): Remove.
* lib-src/etags.c (globals, members, declarations, no_line_directive)
(no_duplicates): Use 'int' for boolean values that getopt requires
to be 'int'. Formerly, these were 'bool' and 'bool' was 'int',
but we can no longer rely on this implementation.
* lib-src/pop.h (struct _popserver): Use bool_bf for boolean bit-fields.
* lwlib/xlwmenuP.h (XlwMenu_part): Use bool_bf for boolean bit-fields.
* src/atimer.h, src/lisp.h, src/syssignal.h, src/syswait.h, src/unexelf.c:
No need to include <stdbool.h>, since conf_post.h does it now.
* src/buffer.h (BUF_COMPUTE_UNCHANGED, DECODE_POSITION)
(BUFFER_CHECK_INDIRECTION, GET_OVERLAYS_AT, PER_BUFFER_VALUE_P)
(SET_PER_BUFFER_VALUE_P):
* src/ccl.c, src/ccl.h (setup_ccl_program):
* src/ccl.h (CHECK_CCL_PROGRAM):
* src/character.h (MAKE_CHAR_UNIBYTE, CHECK_CHARACTER_CAR)
(CHECK_CHARACTER_CDR, CHAR_STRING_ADVANCE, NEXT_CHAR_BOUNDARY)
(PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE)
(FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE)
(FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE)
(FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH)
(DEC_BOTH, BUF_INC_POS, BUF_DEC_POS):
* src/charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID)
(CHECK_CHARSET_GET_ATTR, CHECK_CHARSET_GET_CHARSET)
(CHARSET_FAST_MAP_SET):
* src/coding.c (decode_coding_ccl, encode_coding_ccl):
* src/coding.h (CHECK_CODING_SYSTEM, CHECK_CODING_SYSTEM_GET_SPEC)
(CHECK_CODING_SYSTEM_GET_ID, SJIS_TO_JIS, SJIS_TO_JIS2)
(JIS_TO_SJIS, JIS_TO_SJIS2, ENCODE_FILE, DECODE_FILE)
(ENCODE_SYSTEM, DECODE_SYSTEM, ENCODE_UTF_8)
(decode_coding_c_string):
* src/composite.h (COMPOSITION_DECODE_REFS, COMPOSITION_DECODE_RULE):
* src/conf_post.h (has_attribute):
* src/dispextern.h (trace_redisplay_p):
(INC_TEXT_POS, DEC_TEXT_POS, SET_GLYPH_FROM_GLYPH_CODE)
(SET_CHAR_GLYPH, SET_CHAR_GLYPH_FROM_GLYPH)
(SET_GLYPH_FROM_CHAR_GLYPH):
(WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P)
(FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_SUITABLE_FOR_CHAR_P)
(PRODUCE_GLYPHS, reset_mouse_highlight, in_display_vector_p)
(cursor_in_mouse_face_p):
* src/dispnew.c (adjust_glyph_matrix, clear_glyph_matrix_rows)
(blank_row, prepare_desired_row)
(build_frame_matrix_from_leaf_window, make_current)
(mirror_make_current, mirrored_line_dance, mirror_line_dance)
(update_window, scrolling_window, update_frame_line):
* src/disptab.h (GLYPH_FOLLOW_ALIASES):
* src/editfns.c (Fformat):
* src/font.h (FONT_WEIGHT_SYMBOLIC, FONT_SLANT_SYMBOLIC)
(FONT_WIDTH_SYMBOLIC, FONT_WEIGHT_FOR_FACE, FONT_SLANT_FOR_FACE)
(FONT_WIDTH_FOR_FACE, FONT_WEIGHT_NAME_NUMERIC)
(FONT_SLANT_NAME_NUMERIC, FONT_WIDTH_NAME_NUMERIC)
(FONT_SET_STYLE, CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY)
(CHECK_FONT_OBJECT, CHECK_FONT_GET_OBJECT, FONT_ADD_LOG)
(FONT_DEFERRED_LOG):
* src/frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_WINDOW_P):
(FRAME_EXTERNAL_TOOL_BAR, FRAME_EXTERNAL_MENU_BAR, FOR_EACH_FRAME)
(FRAME_MOUSE_UPDATE):
* src/fringe.c (Fdefine_fringe_bitmap):
* src/image.c (x_create_bitmap_from_data, x_create_bitmap_mask)
(x_create_bitmap_from_xpm_data, xpm_load_image):
* src/intervals.h (INTERVAL_HAS_PARENT, INTERVAL_PARENT)
(set_interval_parent, RESET_INTERVAL, COPY_INTERVAL_CACHE)
(MERGE_INTERVAL_CACHE):
* src/keymap.h (KEYMAPP):
* src/lisp.h (eassert, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE)
(STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE, DEFSYM, PSEUDOVECTORP)
(CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER)
(CHECK_NUMBER_COERCE_MARKER, CHECK_NUMBER_OR_FLOAT_COERCE_MARKER)
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_BUFFER_DEFAULTS, DEFVAR_KBOARD, QUIT)
(RETURN_UNGCPRO, USE_SAFE_ALLOCA, SAFE_NALLOCA, SAFE_FREE)
(SAFE_ALLOCA_LISP, FOR_EACH_ALIST_VALUE, functionp):
* src/syntax.h (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX)
(UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD)
(SETUP_BUFFER_SYNTAX_TABLE):
* src/systime.h (timespec_valid_p):
* src/term.c (save_and_enable_current_matrix):
* src/window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P):
* src/xdisp.c (in_display_vector_p, display_tool_bar_line)
(redisplay_internal, try_window_reusing_current_matrix)
(sync_frame_with_window_matrix_rows, try_window_id)
(display_menu_bar, display_tty_menu_item, display_mode_line)
(coords_in_mouse_face_p, cursor_in_mouse_face_p):
* src/xmenu.c (xmenu_show):
* src/xterm.c (use_xim, x_term_init):
* src/xterm.h (XSync, GTK_CHECK_VERSION, use_xim, SET_SCROLL_BAR_X_WIDGET)
(struct x_bitmap_record):
Use bool for booleans.
* src/ccl.c (struct buffer_text):
* src/ccl.h (struct ccl_program):
* src/charset.h (struct charset):
* src/cm.h (struct cm):
* src/coding.h (struct iso_2022_spec, struct coding_system):
* src/dispextern.h (struct glyph, struct glyph_matrix, struct glyph_row)
(struct glyph_string, struct face, struct face_cache)
(struct bidi_string_data, struct bidi_it)
(struct draw_fringe_bitmap_params, struct it, Mouse_HLInfo)
(struct image):
* src/editfns.c (Fformat):
* src/frame.h (struct frame):
* src/fringe.c (struct fringe_bitmap):
* src/intervals.h (struct interval):
* src/keyboard.h (struct kboard):
* src/lisp.h (struct Lisp_Symbol, struct Lisp_Misc_Any, struct Lisp_Marker)
(struct Lisp_Overlay, struct Lisp_Save_Value, struct Lisp_Free)
(struct Lisp_Buffer_Local_Value, union specbinding):
* src/macfont.m (struct macfont_info):
* src/process.h (struct Lisp_Process):
* src/termchar.h (struct tty_display_info):
* src/window.h (struct window):
* src/xterm.h (struct x_output):
Use bool_bf for boolean bit-fields.
* src/ccl.c (setup_ccl_program): Now returns bool instead of -1 or 0.
All callers changed.
* src/ccl.h (struct ccl_program): Remove unused members private_state,
src_multibyte, dst_multibyte, cr_consumed, suppress_error,
eight_bit_control.
(struct ccl_spec): Remove unused members cr_carryover,
eight_bit_carryover.
* src/conf_post.h: Include <stdbool.h>.
(bool_bf): New type.
* src/dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY):
* src/interval.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE)
Surround statement macro with proper 'do { ... } while (false)' brackets.
(SET_MATRIX_ROW_ENABLED_P): Assume 2nd arg is bool.
(PRODUCE_GLYPHS): Simplify use of boolean.
* src/fileio.c (Fcopy_file):
If I is an integer, prefer 'if (I != 0)' to 'if (I)'.
* src/lisp.h (UNGCPRO): Return void, not int.
(FOR_EACH_TAIL): Use void expression, not int expression.
* src/region-cache.c: Reindent.
* src/region-cache.h: Copy comments from region-cache.c, to fix
incorrect remarks about booleans.
2013-12-14 21:36:44 +00:00
|
|
|
|
to->enabled_p = true;
|
2013-09-24 16:07:35 +00:00
|
|
|
|
to->hash = from->hash;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return saved;
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-11 14:34:55 +00:00
|
|
|
|
/* Restore the contents of frame F's desired frame matrix from SAVED,
|
|
|
|
|
and free memory associated with SAVED. */
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
2012-08-11 14:34:55 +00:00
|
|
|
|
static void
|
|
|
|
|
restore_desired_matrix (struct frame *f, struct glyph_matrix *saved)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < saved->nrows; ++i)
|
|
|
|
|
{
|
|
|
|
|
struct glyph_row *from = saved->rows + i;
|
|
|
|
|
struct glyph_row *to = f->desired_matrix->rows + i;
|
|
|
|
|
ptrdiff_t nbytes = from->used[TEXT_AREA] * sizeof (struct glyph);
|
|
|
|
|
|
2013-09-19 10:06:12 +00:00
|
|
|
|
eassert (to->glyphs[TEXT_AREA] != from->glyphs[TEXT_AREA]);
|
2012-08-11 14:34:55 +00:00
|
|
|
|
memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes);
|
|
|
|
|
to->used[TEXT_AREA] = from->used[TEXT_AREA];
|
2013-09-19 11:28:37 +00:00
|
|
|
|
to->enabled_p = from->enabled_p;
|
|
|
|
|
to->hash = from->hash;
|
2012-08-11 14:34:55 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
free_saved_screen (struct glyph_matrix *saved)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (!saved)
|
2014-03-20 14:09:37 +00:00
|
|
|
|
return; /* Already freed! */
|
2012-08-11 14:34:55 +00:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < saved->nrows; ++i)
|
|
|
|
|
{
|
|
|
|
|
struct glyph_row *from = saved->rows + i;
|
|
|
|
|
|
|
|
|
|
xfree (from->glyphs[TEXT_AREA]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
xfree (saved->rows);
|
|
|
|
|
xfree (saved);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Update the display of frame F from its saved contents. */
|
|
|
|
|
static void
|
|
|
|
|
screen_update (struct frame *f, struct glyph_matrix *mtx)
|
|
|
|
|
{
|
|
|
|
|
restore_desired_matrix (f, mtx);
|
2014-06-04 09:16:46 +00:00
|
|
|
|
update_frame_with_menu (f, -1, -1);
|
2012-08-11 14:34:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-10-14 15:37:12 +00:00
|
|
|
|
typedef enum {
|
|
|
|
|
MI_QUIT_MENU = -1,
|
|
|
|
|
MI_CONTINUE = 0,
|
|
|
|
|
MI_ITEM_SELECTED = 1,
|
|
|
|
|
MI_NEXT_ITEM = 2,
|
|
|
|
|
MI_PREV_ITEM = 3,
|
|
|
|
|
MI_SCROLL_FORWARD = 4,
|
|
|
|
|
MI_SCROLL_BACK = 5
|
|
|
|
|
} mi_result;
|
2013-09-18 11:33:22 +00:00
|
|
|
|
|
2013-10-14 15:37:12 +00:00
|
|
|
|
/* Read user input and return X and Y coordinates where that input
|
|
|
|
|
puts us. We only consider mouse movement and click events, and
|
|
|
|
|
keyboard movement commands; the rest are ignored. */
|
|
|
|
|
static mi_result
|
2013-09-23 13:15:29 +00:00
|
|
|
|
read_menu_input (struct frame *sf, int *x, int *y, int min_y, int max_y,
|
|
|
|
|
bool *first_time)
|
2012-08-11 14:34:55 +00:00
|
|
|
|
{
|
2013-09-17 12:47:37 +00:00
|
|
|
|
if (*first_time)
|
|
|
|
|
{
|
|
|
|
|
*first_time = false;
|
|
|
|
|
sf->mouse_moved = 1;
|
|
|
|
|
}
|
2013-10-08 14:37:20 +00:00
|
|
|
|
else
|
2012-08-11 14:34:55 +00:00
|
|
|
|
{
|
2013-09-22 15:23:06 +00:00
|
|
|
|
Lisp_Object cmd;
|
2013-11-06 00:14:56 +00:00
|
|
|
|
bool usable_input = 1;
|
2013-10-14 15:37:12 +00:00
|
|
|
|
mi_result st = MI_CONTINUE;
|
2013-09-24 16:07:35 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (sf);
|
2013-09-25 14:51:39 +00:00
|
|
|
|
Lisp_Object saved_mouse_tracking = do_mouse_tracking;
|
2013-09-21 14:53:04 +00:00
|
|
|
|
|
2013-09-24 16:07:35 +00:00
|
|
|
|
/* Signal the keyboard reading routines we are displaying a menu
|
|
|
|
|
on this terminal. */
|
|
|
|
|
tty->showing_menu = 1;
|
2013-09-25 14:51:39 +00:00
|
|
|
|
/* We want mouse movements be reported by read_menu_command. */
|
|
|
|
|
do_mouse_tracking = Qt;
|
2013-09-22 15:23:06 +00:00
|
|
|
|
do {
|
|
|
|
|
cmd = read_menu_command ();
|
2013-09-25 14:51:39 +00:00
|
|
|
|
} while (NILP (cmd));
|
2013-09-24 16:07:35 +00:00
|
|
|
|
tty->showing_menu = 0;
|
2013-09-25 14:51:39 +00:00
|
|
|
|
do_mouse_tracking = saved_mouse_tracking;
|
2013-09-22 15:23:06 +00:00
|
|
|
|
|
2014-01-25 08:25:51 +00:00
|
|
|
|
if (EQ (cmd, Qt) || EQ (cmd, Qtty_menu_exit)
|
|
|
|
|
/* If some input switched frames under our feet, exit the
|
|
|
|
|
menu, since the menu faces are no longer valid, and the
|
|
|
|
|
menu is no longer relevant anyway. */
|
|
|
|
|
|| sf != SELECTED_FRAME ())
|
2013-10-14 15:37:12 +00:00
|
|
|
|
return MI_QUIT_MENU;
|
2013-09-25 14:51:39 +00:00
|
|
|
|
if (EQ (cmd, Qtty_menu_mouse_movement))
|
Fix minor problems found by static checking.
* dispnew.c (save_current_matrix): Omit unnecessary casts.
* dispnew.c (update_frame_with_menu): Mark debug local as used.
* keyboard.c, keyboard.h (Qmouse_movement): Now static.
* keyboard.c (read_menu_command): Remove unused local.
* lisp.h (read_menu_command): New decl.
* menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for
benefit of STRING_CHAR_AND_LENGTH. All uses changed.
Return ptrdiff_t, not int.
* term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t,
not int, for benefit of xpalloc.
(tty_menu_create, tty_menu_make_room): Simplify by using xzalloc
and xpalloc.
(have_menus_p): Remove; unused.
(tty_menu_add_pane, tty_menu_add_selection): Change signedness of
local char * pointer to pacify STRING_CHAR_AND_LENGTH.
(tty_menu_add_selection, tty_menu_locate, tty_meny_destroy):
Now static.
(save_and_enable_current_matrix): Omit unnecessary casts.
(read_menu_input): Omit local extern decl (now in lisp.h).
Don't access uninitialized storage if mouse_get_xy fails.
(tty_menu_activate): Mark local as initialized, for lint.
(tty_menu_activate, tty_meny_show): Remove unused locals.
2013-10-08 20:04:40 +00:00
|
|
|
|
mouse_get_xy (x, y);
|
2013-09-25 14:51:39 +00:00
|
|
|
|
else if (EQ (cmd, Qtty_menu_next_menu))
|
2013-10-08 14:28:37 +00:00
|
|
|
|
{
|
|
|
|
|
usable_input = 0;
|
2013-10-14 15:37:12 +00:00
|
|
|
|
st = MI_NEXT_ITEM;
|
2013-10-08 14:28:37 +00:00
|
|
|
|
}
|
2013-09-23 13:15:29 +00:00
|
|
|
|
else if (EQ (cmd, Qtty_menu_prev_menu))
|
2013-10-08 14:28:37 +00:00
|
|
|
|
{
|
|
|
|
|
usable_input = 0;
|
2013-10-14 15:37:12 +00:00
|
|
|
|
st = MI_PREV_ITEM;
|
2013-10-08 14:28:37 +00:00
|
|
|
|
}
|
2013-09-23 13:15:29 +00:00
|
|
|
|
else if (EQ (cmd, Qtty_menu_next_item))
|
|
|
|
|
{
|
|
|
|
|
if (*y < max_y)
|
|
|
|
|
*y += 1;
|
2013-10-11 14:42:05 +00:00
|
|
|
|
else
|
2013-10-14 15:37:12 +00:00
|
|
|
|
st = MI_SCROLL_FORWARD;
|
2013-09-23 13:15:29 +00:00
|
|
|
|
}
|
|
|
|
|
else if (EQ (cmd, Qtty_menu_prev_item))
|
|
|
|
|
{
|
|
|
|
|
if (*y > min_y)
|
|
|
|
|
*y -= 1;
|
2013-10-11 14:42:05 +00:00
|
|
|
|
else
|
2013-10-14 15:37:12 +00:00
|
|
|
|
st = MI_SCROLL_BACK;
|
2013-09-23 13:15:29 +00:00
|
|
|
|
}
|
|
|
|
|
else if (EQ (cmd, Qtty_menu_select))
|
2013-10-14 15:37:12 +00:00
|
|
|
|
st = MI_ITEM_SELECTED;
|
2013-09-23 13:15:29 +00:00
|
|
|
|
else if (!EQ (cmd, Qtty_menu_ignore))
|
2013-09-25 14:51:39 +00:00
|
|
|
|
usable_input = 0;
|
2013-09-21 14:53:04 +00:00
|
|
|
|
if (usable_input)
|
|
|
|
|
sf->mouse_moved = 1;
|
2013-09-18 11:33:22 +00:00
|
|
|
|
return st;
|
2012-08-11 14:34:55 +00:00
|
|
|
|
}
|
2013-10-14 15:37:12 +00:00
|
|
|
|
return MI_CONTINUE;
|
2012-08-11 14:34:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Display menu, wait for user's response, and return that response. */
|
2013-10-08 14:28:37 +00:00
|
|
|
|
static int
|
2012-06-02 14:57:51 +00:00
|
|
|
|
tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
|
|
|
|
|
int x0, int y0, char **txt,
|
2013-10-08 14:28:37 +00:00
|
|
|
|
void (*help_callback)(char const *, int, int),
|
2013-11-06 00:14:56 +00:00
|
|
|
|
bool kbd_navigation)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
struct tty_menu_state *state;
|
2013-11-06 00:14:56 +00:00
|
|
|
|
int statecount, x, y, i;
|
|
|
|
|
bool leave, onepane;
|
2016-06-08 17:33:34 +00:00
|
|
|
|
int result UNINIT;
|
2014-03-20 14:09:37 +00:00
|
|
|
|
int title_faces[4]; /* Face to display the menu title. */
|
2012-06-02 14:57:51 +00:00
|
|
|
|
int faces[4], buffers_num_deleted = 0;
|
|
|
|
|
struct frame *sf = SELECTED_FRAME ();
|
2013-09-18 08:26:03 +00:00
|
|
|
|
struct tty_display_info *tty = FRAME_TTY (sf);
|
2013-09-17 12:47:37 +00:00
|
|
|
|
bool first_time;
|
Fix minor problems found by static checking.
* dispnew.c (save_current_matrix): Omit unnecessary casts.
* dispnew.c (update_frame_with_menu): Mark debug local as used.
* keyboard.c, keyboard.h (Qmouse_movement): Now static.
* keyboard.c (read_menu_command): Remove unused local.
* lisp.h (read_menu_command): New decl.
* menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for
benefit of STRING_CHAR_AND_LENGTH. All uses changed.
Return ptrdiff_t, not int.
* term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t,
not int, for benefit of xpalloc.
(tty_menu_create, tty_menu_make_room): Simplify by using xzalloc
and xpalloc.
(have_menus_p): Remove; unused.
(tty_menu_add_pane, tty_menu_add_selection): Change signedness of
local char * pointer to pacify STRING_CHAR_AND_LENGTH.
(tty_menu_add_selection, tty_menu_locate, tty_meny_destroy):
Now static.
(save_and_enable_current_matrix): Omit unnecessary casts.
(read_menu_input): Omit local extern decl (now in lisp.h).
Don't access uninitialized storage if mouse_get_xy fails.
(tty_menu_activate): Mark local as initialized, for lint.
(tty_menu_activate, tty_meny_show): Remove unused locals.
2013-10-08 20:04:40 +00:00
|
|
|
|
Lisp_Object selectface;
|
2013-10-14 15:37:12 +00:00
|
|
|
|
int first_item = 0;
|
2014-04-29 15:33:37 +00:00
|
|
|
|
int col, row;
|
2015-09-24 18:04:42 +00:00
|
|
|
|
Lisp_Object prev_inhibit_redisplay = Vinhibit_redisplay;
|
Use SAFE_ALLOCA etc. to avoid unbounded stack allocation.
This follows up on the recent thread in emacs-devel on alloca; see:
http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html
This patch also cleans up alloca-related glitches noted while
examining the code looking for unbounded alloca.
* alloc.c (listn):
* callproc.c (init_callproc):
Rewrite to avoid need for alloca.
* buffer.c (mouse_face_overlay_overlaps)
(report_overlay_modification):
* buffer.h (GET_OVERLAYS_AT):
* coding.c (make_subsidiaries):
* doc.c (Fsnarf_documentation):
* editfns.c (Fuser_full_name):
* fileio.c (Ffile_name_directory, Fexpand_file_name)
(search_embedded_absfilename, Fsubstitute_in_file_name):
* fns.c (Fmake_hash_table):
* font.c (font_vconcat_entity_vectors, font_update_drivers):
* fontset.c (fontset_pattern_regexp, Ffontset_info):
* frame.c (Fmake_terminal_frame, x_set_frame_parameters)
(xrdb_get_resource, x_get_resource_string):
* ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf):
* ftxfont.c (ftxfont_draw):
* image.c (xbm_load, xpm_load, jpeg_load_body):
* keyboard.c (echo_add_key, menu_bar_items, tool_bar_items):
* keymap.c (Fdescribe_buffer_bindings, describe_map):
* lread.c (openp):
* menu.c (digest_single_submenu, find_and_call_menu_selection)
(find_and_return_menu_selection):
* print.c (PRINTFINISH):
* process.c (Fformat_network_address):
* scroll.c (do_scrolling, do_direct_scrolling, scrolling_1):
* search.c (search_buffer, Fmatch_data, Fregexp_quote):
* sound.c (wav_play, au_play):
* syntax.c (skip_chars):
* term.c (tty_menu_activate, tty_menu_show):
* textprop.c (get_char_property_and_overlay):
* window.c (Fset_window_configuration):
* xdisp.c (safe__call, next_overlay_change, vmessage)
(compute_overhangs_and_x, draw_glyphs, note_mouse_highlight):
* xfaces.c (face_at_buffer_position):
* xmenu.c (x_menu_show):
Use SAFE_ALLOCA etc. instead of plain alloca, since the
allocation size isn't bounded.
* callint.c (Fcall_interactively): Redo memory_full check
so that it can be done at compile-time on some platforms.
* coding.c (MAX_LOOKUP_MAX): New constant.
(get_translation_table): Use it.
* callproc.c (call_process): Use SAFE_NALLOCA instead of
SAFE_ALLOCA, to catch integer overflows on size calculation.
(exec_failed) [!DOS_NT]: New function.
(child_setup) [!DOS_NT]: Use it.
* editfns.c (Ftranspose_regions):
Hoist USE_SAFE_ALLOC + SAFE_FREE out of 'if'.
* editfns.c (check_translation):
Allocate larger buffers on the heap.
* eval.c (internal_lisp_condition_case):
Check for MAX_ALLOCA overflow.
* fns.c (sort_vector): Use SAFE_ALLOCA_LISP rather than Fmake_vector.
(Fbase64_encode_region, Fbase64_decode_region):
Avoid unnecessary calls to SAFE_FREE before 'error'.
* buffer.c (mouse_face_overlay_overlaps):
* editfns.c (Fget_pos_property, check_translation):
* eval.c (Ffuncall):
* font.c (font_unparse_xlfd, font_find_for_lface):
* ftfont.c (ftfont_drive_otf):
* keyboard.c (echo_add_key, read_decoded_event_from_main_queue)
(menu_bar_items, tool_bar_items):
* sound.c (Fplay_sound_internal):
* xdisp.c (load_overlay_strings, dump_glyph_row):
Use an ordinary auto buffer rather than alloca, since the
allocation size is fixed and small.
* ftfont.c: Include <c-strcase.h>.
(matching_prefix): New function.
(get_adstyle_property): Use it, to avoid need for alloca.
* keyboard.c (echo_add_key):
* keymap.c (describe_map): Use ptrdiff_t, not int.
* keyboard.c (echo_add_key): Prefer sizeof to strlen.
* keymap.c (Fdescribe_buffer_bindings): Use SBYTES, not SCHARS,
when counting bytes.
* lisp.h (xlispstrdupa): Remove, replacing with ...
(SAFE_ALLOCA_STRING): ... new macro with different API.
This fixes a portability problem, namely, alloca result
passed to another function. All uses changed.
(SAFE_ALLOCA, SAFE_ALLOCA_LISP): Check for MAX_ALLOCA,
not MAX_ALLOCA - 1.
* regex.c (REGEX_USE_SAFE_ALLOCA, REGEX_SAFE_FREE)
(REGEX_ALLOCATE): New macros.
(REGEX_REALLOCATE, REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK)
(REGEX_FREE_STACK, FREE_VARIABLES, re_match_2_internal):
Use them.
* xdisp.c (message3): Use SAFE_ALLOCA_STRING rather than doing it
by hand.
(decode_mode_spec_coding): Store directly into buf rather than
into an alloca temporary and copying the temporary to the buf.
Fixes: debbugs:18410
2014-09-07 07:04:01 +00:00
|
|
|
|
USE_SAFE_ALLOCA;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
|
|
|
|
/* Don't allow non-positive x0 and y0, lest the menu will wrap
|
|
|
|
|
around the display. */
|
|
|
|
|
if (x0 <= 0)
|
|
|
|
|
x0 = 1;
|
|
|
|
|
if (y0 <= 0)
|
|
|
|
|
y0 = 1;
|
|
|
|
|
|
Use SAFE_ALLOCA etc. to avoid unbounded stack allocation.
This follows up on the recent thread in emacs-devel on alloca; see:
http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html
This patch also cleans up alloca-related glitches noted while
examining the code looking for unbounded alloca.
* alloc.c (listn):
* callproc.c (init_callproc):
Rewrite to avoid need for alloca.
* buffer.c (mouse_face_overlay_overlaps)
(report_overlay_modification):
* buffer.h (GET_OVERLAYS_AT):
* coding.c (make_subsidiaries):
* doc.c (Fsnarf_documentation):
* editfns.c (Fuser_full_name):
* fileio.c (Ffile_name_directory, Fexpand_file_name)
(search_embedded_absfilename, Fsubstitute_in_file_name):
* fns.c (Fmake_hash_table):
* font.c (font_vconcat_entity_vectors, font_update_drivers):
* fontset.c (fontset_pattern_regexp, Ffontset_info):
* frame.c (Fmake_terminal_frame, x_set_frame_parameters)
(xrdb_get_resource, x_get_resource_string):
* ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf):
* ftxfont.c (ftxfont_draw):
* image.c (xbm_load, xpm_load, jpeg_load_body):
* keyboard.c (echo_add_key, menu_bar_items, tool_bar_items):
* keymap.c (Fdescribe_buffer_bindings, describe_map):
* lread.c (openp):
* menu.c (digest_single_submenu, find_and_call_menu_selection)
(find_and_return_menu_selection):
* print.c (PRINTFINISH):
* process.c (Fformat_network_address):
* scroll.c (do_scrolling, do_direct_scrolling, scrolling_1):
* search.c (search_buffer, Fmatch_data, Fregexp_quote):
* sound.c (wav_play, au_play):
* syntax.c (skip_chars):
* term.c (tty_menu_activate, tty_menu_show):
* textprop.c (get_char_property_and_overlay):
* window.c (Fset_window_configuration):
* xdisp.c (safe__call, next_overlay_change, vmessage)
(compute_overhangs_and_x, draw_glyphs, note_mouse_highlight):
* xfaces.c (face_at_buffer_position):
* xmenu.c (x_menu_show):
Use SAFE_ALLOCA etc. instead of plain alloca, since the
allocation size isn't bounded.
* callint.c (Fcall_interactively): Redo memory_full check
so that it can be done at compile-time on some platforms.
* coding.c (MAX_LOOKUP_MAX): New constant.
(get_translation_table): Use it.
* callproc.c (call_process): Use SAFE_NALLOCA instead of
SAFE_ALLOCA, to catch integer overflows on size calculation.
(exec_failed) [!DOS_NT]: New function.
(child_setup) [!DOS_NT]: Use it.
* editfns.c (Ftranspose_regions):
Hoist USE_SAFE_ALLOC + SAFE_FREE out of 'if'.
* editfns.c (check_translation):
Allocate larger buffers on the heap.
* eval.c (internal_lisp_condition_case):
Check for MAX_ALLOCA overflow.
* fns.c (sort_vector): Use SAFE_ALLOCA_LISP rather than Fmake_vector.
(Fbase64_encode_region, Fbase64_decode_region):
Avoid unnecessary calls to SAFE_FREE before 'error'.
* buffer.c (mouse_face_overlay_overlaps):
* editfns.c (Fget_pos_property, check_translation):
* eval.c (Ffuncall):
* font.c (font_unparse_xlfd, font_find_for_lface):
* ftfont.c (ftfont_drive_otf):
* keyboard.c (echo_add_key, read_decoded_event_from_main_queue)
(menu_bar_items, tool_bar_items):
* sound.c (Fplay_sound_internal):
* xdisp.c (load_overlay_strings, dump_glyph_row):
Use an ordinary auto buffer rather than alloca, since the
allocation size is fixed and small.
* ftfont.c: Include <c-strcase.h>.
(matching_prefix): New function.
(get_adstyle_property): Use it, to avoid need for alloca.
* keyboard.c (echo_add_key):
* keymap.c (describe_map): Use ptrdiff_t, not int.
* keyboard.c (echo_add_key): Prefer sizeof to strlen.
* keymap.c (Fdescribe_buffer_bindings): Use SBYTES, not SCHARS,
when counting bytes.
* lisp.h (xlispstrdupa): Remove, replacing with ...
(SAFE_ALLOCA_STRING): ... new macro with different API.
This fixes a portability problem, namely, alloca result
passed to another function. All uses changed.
(SAFE_ALLOCA, SAFE_ALLOCA_LISP): Check for MAX_ALLOCA,
not MAX_ALLOCA - 1.
* regex.c (REGEX_USE_SAFE_ALLOCA, REGEX_SAFE_FREE)
(REGEX_ALLOCATE): New macros.
(REGEX_REALLOCATE, REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK)
(REGEX_FREE_STACK, FREE_VARIABLES, re_match_2_internal):
Use them.
* xdisp.c (message3): Use SAFE_ALLOCA_STRING rather than doing it
by hand.
(decode_mode_spec_coding): Store directly into buf rather than
into an alloca temporary and copying the temporary to the buf.
Fixes: debbugs:18410
2014-09-07 07:04:01 +00:00
|
|
|
|
SAFE_NALLOCA (state, 1, menu->panecount);
|
2012-08-11 14:34:55 +00:00
|
|
|
|
memset (state, 0, sizeof (*state));
|
2012-06-02 14:57:51 +00:00
|
|
|
|
faces[0]
|
Add support for per-window face remapping
Extend face specifications to support the notion of filtering to a
specific context and add a filter that limits a face specification to
windows having a certain parameter.
* src/xfaces.c:
(evaluate_face_filter,filter_face_ref): New functions.
(merge_face_ref): Ignore filtered face specifications.
(Fx_list_fonts,get_lface_attributes,merge_face_vectors)
(merge_named_face,merge_face_ref,merge_face_ref)
(Finternal_merge_in_global_face,Fface_font,lookup_named_face)
(lookup_basic_face,Fface_attributes_as_vector)
(x_supports_face_attributes_p)
(Fdisplay_supports_face_attributes_p,realize_named_face)
(compute_char_face,face_at_buffer_position)
(face_at_buffer_position,face_at_buffer_position)
(face_at_buffer_position)
(face_for_overlay_string,face_at_string_position,merge_faces):
Pass window to face machinery.
(syms_of_xfaces): Add :window and :filtered
* src/xdisp.c (init_iterator, handle_face_prop)
(handle_single_display_spec, merge_escape_glyph_face)
(merge_glyphless_glyph_face, get_next_display_element)
(next_element_from_display_vector, append_space_for_newline)
(extend_face_to_end_of_line,highlight_trailing_whitespace)
(maybe_produce_line_number)
(display_line, calc_line_height_property): Pass window to
face machinery.
* src/term.c (tty_menu_activate): Adjust to new face core
function signature.
* src/msdos.c (XMenuActivate): Adjust to new face core
function signature.
* src/fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face):
Pass window to face machinery.
* src/font.c (font_range, Finternal_char_font): Pass window to
face machinery.
* src/dispnew.c (spec_glyph_lookup_face): Pass window to
face machinery.
* src/dispextern.h:
(lookup_named_face,lookup_basic_face)
(lookup_derived_face,merge_faces):
Add struct window arguments to prototypes.
2018-06-07 23:20:06 +00:00
|
|
|
|
= lookup_derived_face (NULL, sf, intern ("tty-menu-disabled-face"),
|
2012-06-02 14:57:51 +00:00
|
|
|
|
DEFAULT_FACE_ID, 1);
|
|
|
|
|
faces[1]
|
Add support for per-window face remapping
Extend face specifications to support the notion of filtering to a
specific context and add a filter that limits a face specification to
windows having a certain parameter.
* src/xfaces.c:
(evaluate_face_filter,filter_face_ref): New functions.
(merge_face_ref): Ignore filtered face specifications.
(Fx_list_fonts,get_lface_attributes,merge_face_vectors)
(merge_named_face,merge_face_ref,merge_face_ref)
(Finternal_merge_in_global_face,Fface_font,lookup_named_face)
(lookup_basic_face,Fface_attributes_as_vector)
(x_supports_face_attributes_p)
(Fdisplay_supports_face_attributes_p,realize_named_face)
(compute_char_face,face_at_buffer_position)
(face_at_buffer_position,face_at_buffer_position)
(face_at_buffer_position)
(face_for_overlay_string,face_at_string_position,merge_faces):
Pass window to face machinery.
(syms_of_xfaces): Add :window and :filtered
* src/xdisp.c (init_iterator, handle_face_prop)
(handle_single_display_spec, merge_escape_glyph_face)
(merge_glyphless_glyph_face, get_next_display_element)
(next_element_from_display_vector, append_space_for_newline)
(extend_face_to_end_of_line,highlight_trailing_whitespace)
(maybe_produce_line_number)
(display_line, calc_line_height_property): Pass window to
face machinery.
* src/term.c (tty_menu_activate): Adjust to new face core
function signature.
* src/msdos.c (XMenuActivate): Adjust to new face core
function signature.
* src/fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face):
Pass window to face machinery.
* src/font.c (font_range, Finternal_char_font): Pass window to
face machinery.
* src/dispnew.c (spec_glyph_lookup_face): Pass window to
face machinery.
* src/dispextern.h:
(lookup_named_face,lookup_basic_face)
(lookup_derived_face,merge_faces):
Add struct window arguments to prototypes.
2018-06-07 23:20:06 +00:00
|
|
|
|
= lookup_derived_face (NULL, sf, intern ("tty-menu-enabled-face"),
|
2012-06-02 14:57:51 +00:00
|
|
|
|
DEFAULT_FACE_ID, 1);
|
|
|
|
|
selectface = intern ("tty-menu-selected-face");
|
Add support for per-window face remapping
Extend face specifications to support the notion of filtering to a
specific context and add a filter that limits a face specification to
windows having a certain parameter.
* src/xfaces.c:
(evaluate_face_filter,filter_face_ref): New functions.
(merge_face_ref): Ignore filtered face specifications.
(Fx_list_fonts,get_lface_attributes,merge_face_vectors)
(merge_named_face,merge_face_ref,merge_face_ref)
(Finternal_merge_in_global_face,Fface_font,lookup_named_face)
(lookup_basic_face,Fface_attributes_as_vector)
(x_supports_face_attributes_p)
(Fdisplay_supports_face_attributes_p,realize_named_face)
(compute_char_face,face_at_buffer_position)
(face_at_buffer_position,face_at_buffer_position)
(face_at_buffer_position)
(face_for_overlay_string,face_at_string_position,merge_faces):
Pass window to face machinery.
(syms_of_xfaces): Add :window and :filtered
* src/xdisp.c (init_iterator, handle_face_prop)
(handle_single_display_spec, merge_escape_glyph_face)
(merge_glyphless_glyph_face, get_next_display_element)
(next_element_from_display_vector, append_space_for_newline)
(extend_face_to_end_of_line,highlight_trailing_whitespace)
(maybe_produce_line_number)
(display_line, calc_line_height_property): Pass window to
face machinery.
* src/term.c (tty_menu_activate): Adjust to new face core
function signature.
* src/msdos.c (XMenuActivate): Adjust to new face core
function signature.
* src/fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face):
Pass window to face machinery.
* src/font.c (font_range, Finternal_char_font): Pass window to
face machinery.
* src/dispnew.c (spec_glyph_lookup_face): Pass window to
face machinery.
* src/dispextern.h:
(lookup_named_face,lookup_basic_face)
(lookup_derived_face,merge_faces):
Add struct window arguments to prototypes.
2018-06-07 23:20:06 +00:00
|
|
|
|
faces[2] = lookup_derived_face (NULL, sf, selectface,
|
2012-06-02 14:57:51 +00:00
|
|
|
|
faces[0], 1);
|
Add support for per-window face remapping
Extend face specifications to support the notion of filtering to a
specific context and add a filter that limits a face specification to
windows having a certain parameter.
* src/xfaces.c:
(evaluate_face_filter,filter_face_ref): New functions.
(merge_face_ref): Ignore filtered face specifications.
(Fx_list_fonts,get_lface_attributes,merge_face_vectors)
(merge_named_face,merge_face_ref,merge_face_ref)
(Finternal_merge_in_global_face,Fface_font,lookup_named_face)
(lookup_basic_face,Fface_attributes_as_vector)
(x_supports_face_attributes_p)
(Fdisplay_supports_face_attributes_p,realize_named_face)
(compute_char_face,face_at_buffer_position)
(face_at_buffer_position,face_at_buffer_position)
(face_at_buffer_position)
(face_for_overlay_string,face_at_string_position,merge_faces):
Pass window to face machinery.
(syms_of_xfaces): Add :window and :filtered
* src/xdisp.c (init_iterator, handle_face_prop)
(handle_single_display_spec, merge_escape_glyph_face)
(merge_glyphless_glyph_face, get_next_display_element)
(next_element_from_display_vector, append_space_for_newline)
(extend_face_to_end_of_line,highlight_trailing_whitespace)
(maybe_produce_line_number)
(display_line, calc_line_height_property): Pass window to
face machinery.
* src/term.c (tty_menu_activate): Adjust to new face core
function signature.
* src/msdos.c (XMenuActivate): Adjust to new face core
function signature.
* src/fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face):
Pass window to face machinery.
* src/font.c (font_range, Finternal_char_font): Pass window to
face machinery.
* src/dispnew.c (spec_glyph_lookup_face): Pass window to
face machinery.
* src/dispextern.h:
(lookup_named_face,lookup_basic_face)
(lookup_derived_face,merge_faces):
Add struct window arguments to prototypes.
2018-06-07 23:20:06 +00:00
|
|
|
|
faces[3] = lookup_derived_face (NULL, sf, selectface,
|
2012-06-02 14:57:51 +00:00
|
|
|
|
faces[1], 1);
|
|
|
|
|
|
|
|
|
|
/* Make sure the menu title is always displayed with
|
2013-09-05 08:33:03 +00:00
|
|
|
|
`tty-menu-selected-face', no matter where the mouse pointer is. */
|
2012-06-02 14:57:51 +00:00
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
title_faces[i] = faces[3];
|
|
|
|
|
|
|
|
|
|
statecount = 1;
|
|
|
|
|
|
|
|
|
|
/* Don't let the title for the "Buffers" popup menu include a
|
|
|
|
|
digit (which is ugly).
|
|
|
|
|
|
|
|
|
|
This is a terrible kludge, but I think the "Buffers" case is
|
|
|
|
|
the only one where the title includes a number, so it doesn't
|
|
|
|
|
seem to be necessary to make this more general. */
|
|
|
|
|
if (strncmp (menu->text[0], "Buffers 1", 9) == 0)
|
|
|
|
|
{
|
|
|
|
|
menu->text[0][7] = '\0';
|
|
|
|
|
buffers_num_deleted = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-24 18:04:42 +00:00
|
|
|
|
/* Inhibit redisplay for as long as the menu is active, to avoid
|
|
|
|
|
messing the screen if some timer calls sit-for or a similar
|
|
|
|
|
function. */
|
|
|
|
|
Vinhibit_redisplay = Qt;
|
|
|
|
|
|
2012-08-11 14:34:55 +00:00
|
|
|
|
/* Force update of the current frame, so that the desired and the
|
|
|
|
|
current matrices are identical. */
|
2014-06-04 09:16:46 +00:00
|
|
|
|
update_frame_with_menu (sf, -1, -1);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
state[0].menu = menu;
|
2013-09-24 16:07:35 +00:00
|
|
|
|
state[0].screen_behind = save_and_enable_current_matrix (sf);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
2013-09-17 12:47:37 +00:00
|
|
|
|
/* Display the menu title. We subtract 1 from x0 and y0 because we
|
|
|
|
|
want to interpret them as zero-based column and row coordinates,
|
|
|
|
|
and also because we want the first item of the menu, not its
|
|
|
|
|
title, to appear at x0,y0. */
|
2013-10-14 15:37:12 +00:00
|
|
|
|
tty_menu_display (menu, x0 - 1, y0 - 1, 1, title_faces, x0 - 1, y0 - 1, 0, 0);
|
2013-10-03 20:13:15 +00:00
|
|
|
|
|
|
|
|
|
/* Turn off the cursor. Otherwise it shows through the menu
|
|
|
|
|
panes, which is ugly. */
|
2014-05-01 15:59:42 +00:00
|
|
|
|
col = cursorX (tty);
|
|
|
|
|
row = cursorY (tty);
|
2013-10-03 20:13:15 +00:00
|
|
|
|
tty_hide_cursor (tty);
|
2014-05-01 15:59:42 +00:00
|
|
|
|
|
2012-06-02 14:57:51 +00:00
|
|
|
|
if (buffers_num_deleted)
|
|
|
|
|
menu->text[0][7] = ' ';
|
2013-11-06 00:14:56 +00:00
|
|
|
|
onepane = menu->count == 1 && menu->submenu[0];
|
|
|
|
|
if (onepane)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
menu->width = menu->submenu[0]->width;
|
|
|
|
|
state[0].menu = menu->submenu[0];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
state[0].menu = menu;
|
|
|
|
|
}
|
|
|
|
|
state[0].x = x0 - 1;
|
|
|
|
|
state[0].y = y0;
|
|
|
|
|
state[0].pane = onepane;
|
|
|
|
|
|
2012-08-11 14:34:55 +00:00
|
|
|
|
x = state[0].x;
|
|
|
|
|
y = state[0].y;
|
2013-09-17 12:47:37 +00:00
|
|
|
|
first_time = true;
|
2012-08-11 14:34:55 +00:00
|
|
|
|
|
2012-06-02 14:57:51 +00:00
|
|
|
|
leave = 0;
|
|
|
|
|
while (!leave)
|
|
|
|
|
{
|
2013-10-14 15:37:12 +00:00
|
|
|
|
mi_result input_status;
|
2013-10-11 11:01:48 +00:00
|
|
|
|
int min_y = state[0].y;
|
2014-08-10 08:26:28 +00:00
|
|
|
|
int max_y = min (min_y + state[0].menu->count, FRAME_TOTAL_LINES (sf) - 1) - 1;
|
2013-09-05 11:00:55 +00:00
|
|
|
|
|
2013-09-23 13:15:29 +00:00
|
|
|
|
input_status = read_menu_input (sf, &x, &y, min_y, max_y, &first_time);
|
2013-09-21 14:53:04 +00:00
|
|
|
|
if (input_status)
|
|
|
|
|
{
|
2013-10-08 14:28:37 +00:00
|
|
|
|
leave = 1;
|
2013-10-14 15:37:12 +00:00
|
|
|
|
switch (input_status)
|
2013-09-22 11:07:12 +00:00
|
|
|
|
{
|
2013-10-14 15:37:12 +00:00
|
|
|
|
case MI_QUIT_MENU:
|
2013-09-22 11:07:12 +00:00
|
|
|
|
/* Remove the last help-echo, so that it doesn't
|
|
|
|
|
re-appear after "Quit". */
|
|
|
|
|
show_help_echo (Qnil, Qnil, Qnil, Qnil);
|
|
|
|
|
result = TTYM_NO_SELECT;
|
2013-10-14 15:37:12 +00:00
|
|
|
|
break;
|
|
|
|
|
case MI_NEXT_ITEM:
|
2013-10-08 14:28:37 +00:00
|
|
|
|
if (kbd_navigation)
|
|
|
|
|
result = TTYM_NEXT;
|
|
|
|
|
else
|
|
|
|
|
leave = 0;
|
2013-10-14 15:37:12 +00:00
|
|
|
|
break;
|
|
|
|
|
case MI_PREV_ITEM:
|
2013-10-08 14:28:37 +00:00
|
|
|
|
if (kbd_navigation)
|
|
|
|
|
result = TTYM_PREV;
|
|
|
|
|
else
|
|
|
|
|
leave = 0;
|
2013-10-14 15:37:12 +00:00
|
|
|
|
break;
|
|
|
|
|
case MI_SCROLL_FORWARD:
|
|
|
|
|
if (y - min_y == state[0].menu->count - 1 - first_item)
|
|
|
|
|
{
|
|
|
|
|
y = min_y;
|
|
|
|
|
first_item = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
first_item++;
|
|
|
|
|
leave = 0;
|
|
|
|
|
break;
|
|
|
|
|
case MI_SCROLL_BACK:
|
|
|
|
|
if (first_item == 0)
|
|
|
|
|
{
|
|
|
|
|
y = max_y;
|
|
|
|
|
first_item = state[0].menu->count - 1 - (y - min_y);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
first_item--;
|
|
|
|
|
leave = 0;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
/* MI_ITEM_SELECTED is handled below, so nothing to do. */
|
|
|
|
|
break;
|
2013-10-08 14:28:37 +00:00
|
|
|
|
}
|
2013-09-21 14:53:04 +00:00
|
|
|
|
}
|
2013-10-14 15:37:12 +00:00
|
|
|
|
if (sf->mouse_moved && input_status != MI_QUIT_MENU)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
sf->mouse_moved = 0;
|
|
|
|
|
result = TTYM_IA_SELECT;
|
|
|
|
|
for (i = 0; i < statecount; i++)
|
|
|
|
|
if (state[i].x <= x && x < state[i].x + state[i].menu->width + 2)
|
|
|
|
|
{
|
2013-10-14 15:37:12 +00:00
|
|
|
|
int dy = y - state[i].y + first_item;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
if (0 <= dy && dy < state[i].menu->count)
|
|
|
|
|
{
|
|
|
|
|
if (!state[i].menu->submenu[dy])
|
|
|
|
|
{
|
|
|
|
|
if (state[i].menu->panenumber[dy])
|
|
|
|
|
result = TTYM_SUCCESS;
|
|
|
|
|
else
|
|
|
|
|
result = TTYM_IA_SELECT;
|
|
|
|
|
}
|
|
|
|
|
*pane = state[i].pane - 1;
|
|
|
|
|
*selidx = dy;
|
|
|
|
|
/* We hit some part of a menu, so drop extra menus that
|
|
|
|
|
have been opened. That does not include an open and
|
|
|
|
|
active submenu. */
|
|
|
|
|
if (i != statecount - 2
|
2014-03-20 14:09:37 +00:00
|
|
|
|
|| state[i].menu->submenu[dy] != state[i + 1].menu)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
while (i != statecount - 1)
|
|
|
|
|
{
|
|
|
|
|
statecount--;
|
2013-09-05 11:00:55 +00:00
|
|
|
|
screen_update (sf, state[statecount].screen_behind);
|
2012-08-11 14:34:55 +00:00
|
|
|
|
state[statecount].screen_behind = NULL;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
if (i == statecount - 1 && state[i].menu->submenu[dy])
|
|
|
|
|
{
|
|
|
|
|
tty_menu_display (state[i].menu,
|
|
|
|
|
state[i].x,
|
2013-09-17 12:47:37 +00:00
|
|
|
|
state[i].y,
|
2012-06-02 14:57:51 +00:00
|
|
|
|
state[i].pane,
|
2013-10-14 15:37:12 +00:00
|
|
|
|
faces, x, y, first_item, 1);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
state[statecount].menu = state[i].menu->submenu[dy];
|
|
|
|
|
state[statecount].pane = state[i].menu->panenumber[dy];
|
2012-08-11 14:34:55 +00:00
|
|
|
|
state[statecount].screen_behind
|
2013-09-24 16:07:35 +00:00
|
|
|
|
= save_and_enable_current_matrix (sf);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
state[statecount].x
|
|
|
|
|
= state[i].x + state[i].menu->width + 2;
|
|
|
|
|
state[statecount].y = y;
|
|
|
|
|
statecount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
tty_menu_display (state[statecount - 1].menu,
|
|
|
|
|
state[statecount - 1].x,
|
2013-09-17 12:47:37 +00:00
|
|
|
|
state[statecount - 1].y,
|
2012-06-02 14:57:51 +00:00
|
|
|
|
state[statecount - 1].pane,
|
2013-10-14 15:37:12 +00:00
|
|
|
|
faces, x, y, first_item, 1);
|
2014-04-29 15:33:37 +00:00
|
|
|
|
/* The call to display help-echo below will move the cursor,
|
|
|
|
|
so remember its current position as computed by
|
|
|
|
|
tty_menu_display. */
|
|
|
|
|
col = cursorX (tty);
|
|
|
|
|
row = cursorY (tty);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
2013-09-22 11:07:12 +00:00
|
|
|
|
|
|
|
|
|
/* Display the help-echo message for the currently-selected menu
|
|
|
|
|
item. */
|
|
|
|
|
if ((menu_help_message || prev_menu_help_message)
|
|
|
|
|
&& menu_help_message != prev_menu_help_message)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
2013-09-22 11:07:12 +00:00
|
|
|
|
help_callback (menu_help_message,
|
|
|
|
|
menu_help_paneno, menu_help_itemno);
|
2014-04-29 15:33:37 +00:00
|
|
|
|
/* Move the cursor to the beginning of the current menu
|
|
|
|
|
item, so that screen readers and other accessibility aids
|
|
|
|
|
know where the active region is. */
|
2014-05-01 15:59:42 +00:00
|
|
|
|
cursor_to (sf, row, col);
|
2013-09-22 11:07:12 +00:00
|
|
|
|
prev_menu_help_message = menu_help_message;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
2014-06-04 09:16:46 +00:00
|
|
|
|
/* Both tty_menu_display and help_callback invoke update_end,
|
|
|
|
|
which calls tty_show_cursor. Re-hide it, so it doesn't show
|
|
|
|
|
through the menus. */
|
|
|
|
|
tty_hide_cursor (tty);
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fflush_unlocked (tty->output);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-09-17 12:47:37 +00:00
|
|
|
|
sf->mouse_moved = 0;
|
2012-08-11 14:34:55 +00:00
|
|
|
|
screen_update (sf, state[0].screen_behind);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
while (statecount--)
|
2012-08-11 14:34:55 +00:00
|
|
|
|
free_saved_screen (state[statecount].screen_behind);
|
2014-03-20 14:09:37 +00:00
|
|
|
|
tty_show_cursor (tty); /* Turn cursor back on. */
|
Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 18:21:20 +00:00
|
|
|
|
fflush_unlocked (tty->output);
|
2013-09-18 08:26:03 +00:00
|
|
|
|
|
|
|
|
|
/* Clean up any mouse events that are waiting inside Emacs event queue.
|
2012-06-02 14:57:51 +00:00
|
|
|
|
These events are likely to be generated before the menu was even
|
|
|
|
|
displayed, probably because the user pressed and released the button
|
|
|
|
|
(which invoked the menu) too quickly. If we don't remove these events,
|
|
|
|
|
Emacs will process them after we return and surprise the user. */
|
|
|
|
|
discard_mouse_events ();
|
2013-09-05 11:00:55 +00:00
|
|
|
|
if (!kbd_buffer_events_waiting ())
|
2012-06-02 14:57:51 +00:00
|
|
|
|
clear_input_pending ();
|
Use SAFE_ALLOCA etc. to avoid unbounded stack allocation.
This follows up on the recent thread in emacs-devel on alloca; see:
http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html
This patch also cleans up alloca-related glitches noted while
examining the code looking for unbounded alloca.
* alloc.c (listn):
* callproc.c (init_callproc):
Rewrite to avoid need for alloca.
* buffer.c (mouse_face_overlay_overlaps)
(report_overlay_modification):
* buffer.h (GET_OVERLAYS_AT):
* coding.c (make_subsidiaries):
* doc.c (Fsnarf_documentation):
* editfns.c (Fuser_full_name):
* fileio.c (Ffile_name_directory, Fexpand_file_name)
(search_embedded_absfilename, Fsubstitute_in_file_name):
* fns.c (Fmake_hash_table):
* font.c (font_vconcat_entity_vectors, font_update_drivers):
* fontset.c (fontset_pattern_regexp, Ffontset_info):
* frame.c (Fmake_terminal_frame, x_set_frame_parameters)
(xrdb_get_resource, x_get_resource_string):
* ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf):
* ftxfont.c (ftxfont_draw):
* image.c (xbm_load, xpm_load, jpeg_load_body):
* keyboard.c (echo_add_key, menu_bar_items, tool_bar_items):
* keymap.c (Fdescribe_buffer_bindings, describe_map):
* lread.c (openp):
* menu.c (digest_single_submenu, find_and_call_menu_selection)
(find_and_return_menu_selection):
* print.c (PRINTFINISH):
* process.c (Fformat_network_address):
* scroll.c (do_scrolling, do_direct_scrolling, scrolling_1):
* search.c (search_buffer, Fmatch_data, Fregexp_quote):
* sound.c (wav_play, au_play):
* syntax.c (skip_chars):
* term.c (tty_menu_activate, tty_menu_show):
* textprop.c (get_char_property_and_overlay):
* window.c (Fset_window_configuration):
* xdisp.c (safe__call, next_overlay_change, vmessage)
(compute_overhangs_and_x, draw_glyphs, note_mouse_highlight):
* xfaces.c (face_at_buffer_position):
* xmenu.c (x_menu_show):
Use SAFE_ALLOCA etc. instead of plain alloca, since the
allocation size isn't bounded.
* callint.c (Fcall_interactively): Redo memory_full check
so that it can be done at compile-time on some platforms.
* coding.c (MAX_LOOKUP_MAX): New constant.
(get_translation_table): Use it.
* callproc.c (call_process): Use SAFE_NALLOCA instead of
SAFE_ALLOCA, to catch integer overflows on size calculation.
(exec_failed) [!DOS_NT]: New function.
(child_setup) [!DOS_NT]: Use it.
* editfns.c (Ftranspose_regions):
Hoist USE_SAFE_ALLOC + SAFE_FREE out of 'if'.
* editfns.c (check_translation):
Allocate larger buffers on the heap.
* eval.c (internal_lisp_condition_case):
Check for MAX_ALLOCA overflow.
* fns.c (sort_vector): Use SAFE_ALLOCA_LISP rather than Fmake_vector.
(Fbase64_encode_region, Fbase64_decode_region):
Avoid unnecessary calls to SAFE_FREE before 'error'.
* buffer.c (mouse_face_overlay_overlaps):
* editfns.c (Fget_pos_property, check_translation):
* eval.c (Ffuncall):
* font.c (font_unparse_xlfd, font_find_for_lface):
* ftfont.c (ftfont_drive_otf):
* keyboard.c (echo_add_key, read_decoded_event_from_main_queue)
(menu_bar_items, tool_bar_items):
* sound.c (Fplay_sound_internal):
* xdisp.c (load_overlay_strings, dump_glyph_row):
Use an ordinary auto buffer rather than alloca, since the
allocation size is fixed and small.
* ftfont.c: Include <c-strcase.h>.
(matching_prefix): New function.
(get_adstyle_property): Use it, to avoid need for alloca.
* keyboard.c (echo_add_key):
* keymap.c (describe_map): Use ptrdiff_t, not int.
* keyboard.c (echo_add_key): Prefer sizeof to strlen.
* keymap.c (Fdescribe_buffer_bindings): Use SBYTES, not SCHARS,
when counting bytes.
* lisp.h (xlispstrdupa): Remove, replacing with ...
(SAFE_ALLOCA_STRING): ... new macro with different API.
This fixes a portability problem, namely, alloca result
passed to another function. All uses changed.
(SAFE_ALLOCA, SAFE_ALLOCA_LISP): Check for MAX_ALLOCA,
not MAX_ALLOCA - 1.
* regex.c (REGEX_USE_SAFE_ALLOCA, REGEX_SAFE_FREE)
(REGEX_ALLOCATE): New macros.
(REGEX_REALLOCATE, REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK)
(REGEX_FREE_STACK, FREE_VARIABLES, re_match_2_internal):
Use them.
* xdisp.c (message3): Use SAFE_ALLOCA_STRING rather than doing it
by hand.
(decode_mode_spec_coding): Store directly into buf rather than
into an alloca temporary and copying the temporary to the buf.
Fixes: debbugs:18410
2014-09-07 07:04:01 +00:00
|
|
|
|
SAFE_FREE ();
|
2015-09-24 18:04:42 +00:00
|
|
|
|
Vinhibit_redisplay = prev_inhibit_redisplay;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Dispose of a menu. */
|
|
|
|
|
|
Fix minor problems found by static checking.
* dispnew.c (save_current_matrix): Omit unnecessary casts.
* dispnew.c (update_frame_with_menu): Mark debug local as used.
* keyboard.c, keyboard.h (Qmouse_movement): Now static.
* keyboard.c (read_menu_command): Remove unused local.
* lisp.h (read_menu_command): New decl.
* menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for
benefit of STRING_CHAR_AND_LENGTH. All uses changed.
Return ptrdiff_t, not int.
* term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t,
not int, for benefit of xpalloc.
(tty_menu_create, tty_menu_make_room): Simplify by using xzalloc
and xpalloc.
(have_menus_p): Remove; unused.
(tty_menu_add_pane, tty_menu_add_selection): Change signedness of
local char * pointer to pacify STRING_CHAR_AND_LENGTH.
(tty_menu_add_selection, tty_menu_locate, tty_meny_destroy):
Now static.
(save_and_enable_current_matrix): Omit unnecessary casts.
(read_menu_input): Omit local extern decl (now in lisp.h).
Don't access uninitialized storage if mouse_get_xy fails.
(tty_menu_activate): Mark local as initialized, for lint.
(tty_menu_activate, tty_meny_show): Remove unused locals.
2013-10-08 20:04:40 +00:00
|
|
|
|
static void
|
2012-06-02 14:57:51 +00:00
|
|
|
|
tty_menu_destroy (tty_menu *menu)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
if (menu->allocated)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < menu->count; i++)
|
|
|
|
|
if (menu->submenu[i])
|
|
|
|
|
tty_menu_destroy (menu->submenu[i]);
|
|
|
|
|
xfree (menu->text);
|
|
|
|
|
xfree (menu->submenu);
|
|
|
|
|
xfree (menu->panenumber);
|
|
|
|
|
xfree (menu->help_text);
|
|
|
|
|
}
|
|
|
|
|
xfree (menu);
|
|
|
|
|
menu_help_message = prev_menu_help_message = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-05 11:00:55 +00:00
|
|
|
|
/* Show help HELP_STRING, or clear help if HELP_STRING is null.
|
|
|
|
|
|
|
|
|
|
PANE is the pane number, and ITEM is the menu item number in
|
2013-09-26 08:10:53 +00:00
|
|
|
|
the menu (currently not used). */
|
2013-09-05 11:00:55 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
tty_menu_help_callback (char const *help_string, int pane, int item)
|
|
|
|
|
{
|
|
|
|
|
Lisp_Object *first_item;
|
|
|
|
|
Lisp_Object pane_name;
|
|
|
|
|
Lisp_Object menu_object;
|
|
|
|
|
|
Port to stricter C99 platforms.
Especially, C99 prohibits nesting a struct X inside struct Y if
struct X has a flexible array member.
Also, merge from gnulib, incorporating:
2013-11-03 intprops: port to Oracle Studio c99
* lib/intprops.h: Update from gnulib.
* src/alloc.c (struct sdata): New type.
(sdata): Implement in terms of struct sdata.
Remove u member; all uses replaced by next_vector, set_next_vector.
(SDATA_SELECTOR, SDATA_DATA, SDATA_DATA_OFFSET): Adjust to sdata change.
(SDATA_DATA_OFFSET): Now a constant, not a macro.
(struct sblock): Rename first_data member to data, which is now
a flexible array member. All uses changed.
(next_vector, set_next_vector, large_vector_vec): New functions.
(vector_alignment): New constant.
(roundup_size): Make it a multiple of ALIGNOF_STRUCT_LISP_VECTOR, too.
(struct large-vector): Now merely a NEXT member, since the old approach
ran afoul of stricter C99. All uses changed to use
large_vector_vec or large_vector_offset.
(large_vector_offset): New constant.
* src/dispnew.c: Include tparam.h, for tgetent.
Do not include term.h; no longer needed.
* src/gnutls.c (Fgnutls_boot): Don't continue after calling a _Noreturn.
* src/lisp.h (ENUM_BF) [__SUNPRO_C && __STDC__]: Use unsigned int.
(struct Lisp_Vector): Use a flexible array member for contents,
instead of a union with a member that is an array of size 1.
All uses changed.
(ALIGNOF_STRUCT_LISP_VECTOR): New constant, to make up for the
fact that the struct no longer contains a union.
(struct Lisp_Misc_Any, struct Lisp_Marker, struct Lisp_Overlay)
(struct Lisp_Save_Value, struct Lisp_Free):
Use unsigned, not int, for spacers, to avoid c99 warning.
(union specbinding): Use unsigned, not bool, for bitfield, as
bool is not portable to pre-C99 hosts.
2013-11-04 06:09:03 +00:00
|
|
|
|
first_item = XVECTOR (menu_items)->contents;
|
2013-09-05 11:00:55 +00:00
|
|
|
|
if (EQ (first_item[0], Qt))
|
|
|
|
|
pane_name = first_item[MENU_ITEMS_PANE_NAME];
|
|
|
|
|
else if (EQ (first_item[0], Qquote))
|
|
|
|
|
/* This shouldn't happen, see xmenu_show. */
|
|
|
|
|
pane_name = empty_unibyte_string;
|
|
|
|
|
else
|
|
|
|
|
pane_name = first_item[MENU_ITEMS_ITEM_NAME];
|
|
|
|
|
|
|
|
|
|
/* (menu-item MENU-NAME PANE-NUMBER) */
|
Rename integerp->fixnum, etc, in preparation for bignums
* src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
src/process.c, src/profiler.c, src/search.c, src/sound.c,
src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
2018-07-07 03:56:17 +00:00
|
|
|
|
menu_object = list3 (Qmenu_item, pane_name, make_fixnum (pane));
|
2013-09-05 11:00:55 +00:00
|
|
|
|
show_help_echo (help_string ? build_string (help_string) : Qnil,
|
Rename integerp->fixnum, etc, in preparation for bignums
* src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
src/process.c, src/profiler.c, src/search.c, src/sound.c,
src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
2018-07-07 03:56:17 +00:00
|
|
|
|
Qnil, menu_object, make_fixnum (item));
|
2013-09-05 11:00:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-06-14 22:59:08 +00:00
|
|
|
|
struct tty_pop_down_menu
|
|
|
|
|
{
|
|
|
|
|
tty_menu *menu;
|
|
|
|
|
struct buffer *buffer;
|
|
|
|
|
};
|
|
|
|
|
|
2013-09-05 11:00:55 +00:00
|
|
|
|
static void
|
2018-06-14 22:59:08 +00:00
|
|
|
|
tty_pop_down_menu (void *arg)
|
2013-09-05 11:00:55 +00:00
|
|
|
|
{
|
2018-06-14 22:59:08 +00:00
|
|
|
|
struct tty_pop_down_menu *data = arg;
|
2013-09-05 11:00:55 +00:00
|
|
|
|
|
|
|
|
|
block_input ();
|
2018-06-14 22:59:08 +00:00
|
|
|
|
tty_menu_destroy (data->menu);
|
|
|
|
|
set_buffer_internal (data->buffer);
|
2013-09-05 11:00:55 +00:00
|
|
|
|
unblock_input ();
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-08 14:28:37 +00:00
|
|
|
|
/* Return the zero-based index of the last menu-bar item on frame F. */
|
|
|
|
|
static int
|
|
|
|
|
tty_menu_last_menubar_item (struct frame *f)
|
|
|
|
|
{
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
|
|
eassert (FRAME_TERMCAP_P (f) && FRAME_LIVE_P (f));
|
|
|
|
|
if (FRAME_TERMCAP_P (f) && FRAME_LIVE_P (f))
|
|
|
|
|
{
|
|
|
|
|
Lisp_Object items = FRAME_MENU_BAR_ITEMS (f);
|
|
|
|
|
|
|
|
|
|
while (i < ASIZE (items))
|
|
|
|
|
{
|
|
|
|
|
Lisp_Object str;
|
|
|
|
|
|
|
|
|
|
str = AREF (items, i + 1);
|
|
|
|
|
if (NILP (str))
|
|
|
|
|
break;
|
|
|
|
|
i += 4;
|
|
|
|
|
}
|
2014-03-20 14:09:37 +00:00
|
|
|
|
i -= 4; /* Went one too far! */
|
2013-10-08 14:28:37 +00:00
|
|
|
|
}
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Find in frame F's menu bar the menu item that is next or previous
|
|
|
|
|
to the item at X/Y, and return that item's position in X/Y. WHICH
|
|
|
|
|
says which one--next or previous--item to look for. X and Y are
|
|
|
|
|
measured in character cells. This should only be called on TTY
|
|
|
|
|
frames. */
|
|
|
|
|
static void
|
|
|
|
|
tty_menu_new_item_coords (struct frame *f, int which, int *x, int *y)
|
|
|
|
|
{
|
|
|
|
|
eassert (FRAME_TERMCAP_P (f) && FRAME_LIVE_P (f));
|
|
|
|
|
if (FRAME_TERMCAP_P (f) && FRAME_LIVE_P (f))
|
|
|
|
|
{
|
|
|
|
|
Lisp_Object items = FRAME_MENU_BAR_ITEMS (f);
|
|
|
|
|
int last_i = tty_menu_last_menubar_item (f);
|
|
|
|
|
int i, prev_x;
|
|
|
|
|
|
|
|
|
|
/* This loop assumes a single menu-bar line, and will fail to
|
|
|
|
|
find an item if it is not in the first line. Note that
|
|
|
|
|
make_lispy_event in keyboard.c makes the same assumption. */
|
|
|
|
|
for (i = 0, prev_x = -1; i < ASIZE (items); i += 4)
|
|
|
|
|
{
|
|
|
|
|
Lisp_Object pos, str;
|
|
|
|
|
int ix;
|
|
|
|
|
|
|
|
|
|
str = AREF (items, i + 1);
|
|
|
|
|
pos = AREF (items, i + 3);
|
|
|
|
|
if (NILP (str))
|
|
|
|
|
return;
|
More macro renamings for bignum
* src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
src/category.c, src/ccl.c, src/character.c, src/character.h,
src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
2018-08-08 00:08:53 +00:00
|
|
|
|
ix = XFIXNUM (pos);
|
2013-10-08 14:28:37 +00:00
|
|
|
|
if (ix <= *x
|
|
|
|
|
/* We use <= so the blank between 2 items on a TTY is
|
|
|
|
|
considered part of the previous item. */
|
Fix minor problems found by static checking.
* dispnew.c (save_current_matrix): Omit unnecessary casts.
* dispnew.c (update_frame_with_menu): Mark debug local as used.
* keyboard.c, keyboard.h (Qmouse_movement): Now static.
* keyboard.c (read_menu_command): Remove unused local.
* lisp.h (read_menu_command): New decl.
* menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for
benefit of STRING_CHAR_AND_LENGTH. All uses changed.
Return ptrdiff_t, not int.
* term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t,
not int, for benefit of xpalloc.
(tty_menu_create, tty_menu_make_room): Simplify by using xzalloc
and xpalloc.
(have_menus_p): Remove; unused.
(tty_menu_add_pane, tty_menu_add_selection): Change signedness of
local char * pointer to pacify STRING_CHAR_AND_LENGTH.
(tty_menu_add_selection, tty_menu_locate, tty_meny_destroy):
Now static.
(save_and_enable_current_matrix): Omit unnecessary casts.
(read_menu_input): Omit local extern decl (now in lisp.h).
Don't access uninitialized storage if mouse_get_xy fails.
(tty_menu_activate): Mark local as initialized, for lint.
(tty_menu_activate, tty_meny_show): Remove unused locals.
2013-10-08 20:04:40 +00:00
|
|
|
|
&& *x <= ix + menu_item_width (SDATA (str)))
|
2013-10-08 14:28:37 +00:00
|
|
|
|
{
|
|
|
|
|
/* Found current item. Now compute the X coordinate of
|
|
|
|
|
the previous or next item. */
|
|
|
|
|
if (which == TTYM_NEXT)
|
|
|
|
|
{
|
|
|
|
|
if (i < last_i)
|
More macro renamings for bignum
* src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
src/category.c, src/ccl.c, src/character.c, src/character.h,
src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
2018-08-08 00:08:53 +00:00
|
|
|
|
*x = XFIXNUM (AREF (items, i + 4 + 3));
|
2013-10-08 14:28:37 +00:00
|
|
|
|
else
|
2014-03-20 14:09:37 +00:00
|
|
|
|
*x = 0; /* Wrap around to the first item. */
|
2013-10-08 14:28:37 +00:00
|
|
|
|
}
|
|
|
|
|
else if (prev_x < 0)
|
|
|
|
|
{
|
|
|
|
|
/* Wrap around to the last item. */
|
More macro renamings for bignum
* src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
src/category.c, src/ccl.c, src/character.c, src/character.h,
src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
2018-08-08 00:08:53 +00:00
|
|
|
|
*x = XFIXNUM (AREF (items, last_i + 3));
|
2013-10-08 14:28:37 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
*x = prev_x;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
prev_x = ix;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-07 07:25:49 +00:00
|
|
|
|
/* WINDOWSNT uses this as menu_show_hook, see w32console.c. */
|
2012-06-02 14:57:51 +00:00
|
|
|
|
Lisp_Object
|
2014-06-04 04:58:31 +00:00
|
|
|
|
tty_menu_show (struct frame *f, int x, int y, int menuflags,
|
|
|
|
|
Lisp_Object title, const char **error_name)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
tty_menu *menu;
|
|
|
|
|
int pane, selidx, lpane, status;
|
|
|
|
|
Lisp_Object entry, pane_prefix;
|
|
|
|
|
char *datap;
|
|
|
|
|
int ulx, uly, width, height;
|
2013-10-08 14:28:37 +00:00
|
|
|
|
int item_x, item_y;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
int dispwidth, dispheight;
|
|
|
|
|
int i, j, lines, maxlines;
|
|
|
|
|
int maxwidth;
|
2013-10-11 15:30:21 +00:00
|
|
|
|
ptrdiff_t specpdl_count;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
2013-10-11 15:30:21 +00:00
|
|
|
|
eassert (FRAME_TERMCAP_P (f));
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
|
|
|
|
*error_name = 0;
|
|
|
|
|
if (menu_items_n_panes == 0)
|
|
|
|
|
return Qnil;
|
|
|
|
|
|
|
|
|
|
if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
|
|
|
|
|
{
|
|
|
|
|
*error_name = "Empty menu";
|
|
|
|
|
return Qnil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make the menu on that window. */
|
|
|
|
|
menu = tty_menu_create ();
|
|
|
|
|
|
|
|
|
|
/* Don't GC while we prepare and show the menu, because we give the
|
|
|
|
|
menu functions pointers to the contents of strings. */
|
2013-10-11 15:30:21 +00:00
|
|
|
|
specpdl_count = inhibit_garbage_collection ();
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
2014-06-04 04:58:31 +00:00
|
|
|
|
/* Avoid crashes if, e.g., another client will connect while we
|
|
|
|
|
are in a menu. */
|
|
|
|
|
temporarily_switch_to_single_kboard (f);
|
|
|
|
|
|
2012-06-02 14:57:51 +00:00
|
|
|
|
/* Adjust coordinates to be root-window-relative. */
|
2013-10-08 14:28:37 +00:00
|
|
|
|
item_x = x += f->left_pos;
|
|
|
|
|
item_y = y += f->top_pos;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
|
|
|
|
/* Create all the necessary panes and their items. */
|
Use SAFE_ALLOCA etc. to avoid unbounded stack allocation.
This follows up on the recent thread in emacs-devel on alloca; see:
http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html
This patch also cleans up alloca-related glitches noted while
examining the code looking for unbounded alloca.
* alloc.c (listn):
* callproc.c (init_callproc):
Rewrite to avoid need for alloca.
* buffer.c (mouse_face_overlay_overlaps)
(report_overlay_modification):
* buffer.h (GET_OVERLAYS_AT):
* coding.c (make_subsidiaries):
* doc.c (Fsnarf_documentation):
* editfns.c (Fuser_full_name):
* fileio.c (Ffile_name_directory, Fexpand_file_name)
(search_embedded_absfilename, Fsubstitute_in_file_name):
* fns.c (Fmake_hash_table):
* font.c (font_vconcat_entity_vectors, font_update_drivers):
* fontset.c (fontset_pattern_regexp, Ffontset_info):
* frame.c (Fmake_terminal_frame, x_set_frame_parameters)
(xrdb_get_resource, x_get_resource_string):
* ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf):
* ftxfont.c (ftxfont_draw):
* image.c (xbm_load, xpm_load, jpeg_load_body):
* keyboard.c (echo_add_key, menu_bar_items, tool_bar_items):
* keymap.c (Fdescribe_buffer_bindings, describe_map):
* lread.c (openp):
* menu.c (digest_single_submenu, find_and_call_menu_selection)
(find_and_return_menu_selection):
* print.c (PRINTFINISH):
* process.c (Fformat_network_address):
* scroll.c (do_scrolling, do_direct_scrolling, scrolling_1):
* search.c (search_buffer, Fmatch_data, Fregexp_quote):
* sound.c (wav_play, au_play):
* syntax.c (skip_chars):
* term.c (tty_menu_activate, tty_menu_show):
* textprop.c (get_char_property_and_overlay):
* window.c (Fset_window_configuration):
* xdisp.c (safe__call, next_overlay_change, vmessage)
(compute_overhangs_and_x, draw_glyphs, note_mouse_highlight):
* xfaces.c (face_at_buffer_position):
* xmenu.c (x_menu_show):
Use SAFE_ALLOCA etc. instead of plain alloca, since the
allocation size isn't bounded.
* callint.c (Fcall_interactively): Redo memory_full check
so that it can be done at compile-time on some platforms.
* coding.c (MAX_LOOKUP_MAX): New constant.
(get_translation_table): Use it.
* callproc.c (call_process): Use SAFE_NALLOCA instead of
SAFE_ALLOCA, to catch integer overflows on size calculation.
(exec_failed) [!DOS_NT]: New function.
(child_setup) [!DOS_NT]: Use it.
* editfns.c (Ftranspose_regions):
Hoist USE_SAFE_ALLOC + SAFE_FREE out of 'if'.
* editfns.c (check_translation):
Allocate larger buffers on the heap.
* eval.c (internal_lisp_condition_case):
Check for MAX_ALLOCA overflow.
* fns.c (sort_vector): Use SAFE_ALLOCA_LISP rather than Fmake_vector.
(Fbase64_encode_region, Fbase64_decode_region):
Avoid unnecessary calls to SAFE_FREE before 'error'.
* buffer.c (mouse_face_overlay_overlaps):
* editfns.c (Fget_pos_property, check_translation):
* eval.c (Ffuncall):
* font.c (font_unparse_xlfd, font_find_for_lface):
* ftfont.c (ftfont_drive_otf):
* keyboard.c (echo_add_key, read_decoded_event_from_main_queue)
(menu_bar_items, tool_bar_items):
* sound.c (Fplay_sound_internal):
* xdisp.c (load_overlay_strings, dump_glyph_row):
Use an ordinary auto buffer rather than alloca, since the
allocation size is fixed and small.
* ftfont.c: Include <c-strcase.h>.
(matching_prefix): New function.
(get_adstyle_property): Use it, to avoid need for alloca.
* keyboard.c (echo_add_key):
* keymap.c (describe_map): Use ptrdiff_t, not int.
* keyboard.c (echo_add_key): Prefer sizeof to strlen.
* keymap.c (Fdescribe_buffer_bindings): Use SBYTES, not SCHARS,
when counting bytes.
* lisp.h (xlispstrdupa): Remove, replacing with ...
(SAFE_ALLOCA_STRING): ... new macro with different API.
This fixes a portability problem, namely, alloca result
passed to another function. All uses changed.
(SAFE_ALLOCA, SAFE_ALLOCA_LISP): Check for MAX_ALLOCA,
not MAX_ALLOCA - 1.
* regex.c (REGEX_USE_SAFE_ALLOCA, REGEX_SAFE_FREE)
(REGEX_ALLOCATE): New macros.
(REGEX_REALLOCATE, REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK)
(REGEX_FREE_STACK, FREE_VARIABLES, re_match_2_internal):
Use them.
* xdisp.c (message3): Use SAFE_ALLOCA_STRING rather than doing it
by hand.
(decode_mode_spec_coding): Store directly into buf rather than
into an alloca temporary and copying the temporary to the buf.
Fixes: debbugs:18410
2014-09-07 07:04:01 +00:00
|
|
|
|
USE_SAFE_ALLOCA;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
maxwidth = maxlines = lines = i = 0;
|
|
|
|
|
lpane = TTYM_FAILURE;
|
|
|
|
|
while (i < menu_items_used)
|
|
|
|
|
{
|
2013-09-17 15:58:43 +00:00
|
|
|
|
if (EQ (AREF (menu_items, i), Qt))
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
/* Create a new pane. */
|
|
|
|
|
Lisp_Object pane_name, prefix;
|
|
|
|
|
const char *pane_string;
|
|
|
|
|
|
|
|
|
|
maxlines = max (maxlines, lines);
|
|
|
|
|
lines = 0;
|
2013-09-17 15:58:43 +00:00
|
|
|
|
pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
|
|
|
|
|
prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
pane_string = (NILP (pane_name)
|
|
|
|
|
? "" : SSDATA (pane_name));
|
2014-06-04 04:58:31 +00:00
|
|
|
|
if ((menuflags & MENU_KEYMAPS) && !NILP (prefix))
|
2012-06-02 14:57:51 +00:00
|
|
|
|
pane_string++;
|
|
|
|
|
|
|
|
|
|
lpane = tty_menu_add_pane (menu, pane_string);
|
|
|
|
|
if (lpane == TTYM_FAILURE)
|
|
|
|
|
{
|
|
|
|
|
tty_menu_destroy (menu);
|
|
|
|
|
*error_name = "Can't create pane";
|
2013-10-11 15:30:21 +00:00
|
|
|
|
entry = Qnil;
|
|
|
|
|
goto tty_menu_end;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
i += MENU_ITEMS_PANE_LENGTH;
|
|
|
|
|
|
|
|
|
|
/* Find the width of the widest item in this pane. */
|
|
|
|
|
j = i;
|
|
|
|
|
while (j < menu_items_used)
|
|
|
|
|
{
|
|
|
|
|
Lisp_Object item;
|
2013-09-17 15:58:43 +00:00
|
|
|
|
item = AREF (menu_items, j);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
if (EQ (item, Qt))
|
|
|
|
|
break;
|
|
|
|
|
if (NILP (item))
|
|
|
|
|
{
|
|
|
|
|
j++;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
width = SBYTES (item);
|
|
|
|
|
if (width > maxwidth)
|
|
|
|
|
maxwidth = width;
|
|
|
|
|
|
|
|
|
|
j += MENU_ITEMS_ITEM_LENGTH;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* Ignore a nil in the item list.
|
|
|
|
|
It's meaningful only for dialog boxes. */
|
2013-09-17 15:58:43 +00:00
|
|
|
|
else if (EQ (AREF (menu_items, i), Qquote))
|
2012-06-02 14:57:51 +00:00
|
|
|
|
i += 1;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Create a new item within current pane. */
|
|
|
|
|
Lisp_Object item_name, enable, descrip, help;
|
|
|
|
|
char *item_data;
|
|
|
|
|
char const *help_string;
|
|
|
|
|
|
2013-09-17 15:58:43 +00:00
|
|
|
|
item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME);
|
|
|
|
|
enable = AREF (menu_items, i + MENU_ITEMS_ITEM_ENABLE);
|
|
|
|
|
descrip = AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY);
|
|
|
|
|
help = AREF (menu_items, i + MENU_ITEMS_ITEM_HELP);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
help_string = STRINGP (help) ? SSDATA (help) : NULL;
|
|
|
|
|
|
|
|
|
|
if (!NILP (descrip))
|
|
|
|
|
{
|
Use SAFE_ALLOCA etc. to avoid unbounded stack allocation.
This follows up on the recent thread in emacs-devel on alloca; see:
http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html
This patch also cleans up alloca-related glitches noted while
examining the code looking for unbounded alloca.
* alloc.c (listn):
* callproc.c (init_callproc):
Rewrite to avoid need for alloca.
* buffer.c (mouse_face_overlay_overlaps)
(report_overlay_modification):
* buffer.h (GET_OVERLAYS_AT):
* coding.c (make_subsidiaries):
* doc.c (Fsnarf_documentation):
* editfns.c (Fuser_full_name):
* fileio.c (Ffile_name_directory, Fexpand_file_name)
(search_embedded_absfilename, Fsubstitute_in_file_name):
* fns.c (Fmake_hash_table):
* font.c (font_vconcat_entity_vectors, font_update_drivers):
* fontset.c (fontset_pattern_regexp, Ffontset_info):
* frame.c (Fmake_terminal_frame, x_set_frame_parameters)
(xrdb_get_resource, x_get_resource_string):
* ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf):
* ftxfont.c (ftxfont_draw):
* image.c (xbm_load, xpm_load, jpeg_load_body):
* keyboard.c (echo_add_key, menu_bar_items, tool_bar_items):
* keymap.c (Fdescribe_buffer_bindings, describe_map):
* lread.c (openp):
* menu.c (digest_single_submenu, find_and_call_menu_selection)
(find_and_return_menu_selection):
* print.c (PRINTFINISH):
* process.c (Fformat_network_address):
* scroll.c (do_scrolling, do_direct_scrolling, scrolling_1):
* search.c (search_buffer, Fmatch_data, Fregexp_quote):
* sound.c (wav_play, au_play):
* syntax.c (skip_chars):
* term.c (tty_menu_activate, tty_menu_show):
* textprop.c (get_char_property_and_overlay):
* window.c (Fset_window_configuration):
* xdisp.c (safe__call, next_overlay_change, vmessage)
(compute_overhangs_and_x, draw_glyphs, note_mouse_highlight):
* xfaces.c (face_at_buffer_position):
* xmenu.c (x_menu_show):
Use SAFE_ALLOCA etc. instead of plain alloca, since the
allocation size isn't bounded.
* callint.c (Fcall_interactively): Redo memory_full check
so that it can be done at compile-time on some platforms.
* coding.c (MAX_LOOKUP_MAX): New constant.
(get_translation_table): Use it.
* callproc.c (call_process): Use SAFE_NALLOCA instead of
SAFE_ALLOCA, to catch integer overflows on size calculation.
(exec_failed) [!DOS_NT]: New function.
(child_setup) [!DOS_NT]: Use it.
* editfns.c (Ftranspose_regions):
Hoist USE_SAFE_ALLOC + SAFE_FREE out of 'if'.
* editfns.c (check_translation):
Allocate larger buffers on the heap.
* eval.c (internal_lisp_condition_case):
Check for MAX_ALLOCA overflow.
* fns.c (sort_vector): Use SAFE_ALLOCA_LISP rather than Fmake_vector.
(Fbase64_encode_region, Fbase64_decode_region):
Avoid unnecessary calls to SAFE_FREE before 'error'.
* buffer.c (mouse_face_overlay_overlaps):
* editfns.c (Fget_pos_property, check_translation):
* eval.c (Ffuncall):
* font.c (font_unparse_xlfd, font_find_for_lface):
* ftfont.c (ftfont_drive_otf):
* keyboard.c (echo_add_key, read_decoded_event_from_main_queue)
(menu_bar_items, tool_bar_items):
* sound.c (Fplay_sound_internal):
* xdisp.c (load_overlay_strings, dump_glyph_row):
Use an ordinary auto buffer rather than alloca, since the
allocation size is fixed and small.
* ftfont.c: Include <c-strcase.h>.
(matching_prefix): New function.
(get_adstyle_property): Use it, to avoid need for alloca.
* keyboard.c (echo_add_key):
* keymap.c (describe_map): Use ptrdiff_t, not int.
* keyboard.c (echo_add_key): Prefer sizeof to strlen.
* keymap.c (Fdescribe_buffer_bindings): Use SBYTES, not SCHARS,
when counting bytes.
* lisp.h (xlispstrdupa): Remove, replacing with ...
(SAFE_ALLOCA_STRING): ... new macro with different API.
This fixes a portability problem, namely, alloca result
passed to another function. All uses changed.
(SAFE_ALLOCA, SAFE_ALLOCA_LISP): Check for MAX_ALLOCA,
not MAX_ALLOCA - 1.
* regex.c (REGEX_USE_SAFE_ALLOCA, REGEX_SAFE_FREE)
(REGEX_ALLOCATE): New macros.
(REGEX_REALLOCATE, REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK)
(REGEX_FREE_STACK, FREE_VARIABLES, re_match_2_internal):
Use them.
* xdisp.c (message3): Use SAFE_ALLOCA_STRING rather than doing it
by hand.
(decode_mode_spec_coding): Store directly into buf rather than
into an alloca temporary and copying the temporary to the buf.
Fixes: debbugs:18410
2014-09-07 07:04:01 +00:00
|
|
|
|
item_data = SAFE_ALLOCA (maxwidth + SBYTES (descrip) + 1);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
memcpy (item_data, SSDATA (item_name), SBYTES (item_name));
|
|
|
|
|
for (j = SCHARS (item_name); j < maxwidth; j++)
|
|
|
|
|
item_data[j] = ' ';
|
|
|
|
|
memcpy (item_data + j, SSDATA (descrip), SBYTES (descrip));
|
|
|
|
|
item_data[j + SBYTES (descrip)] = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
item_data = SSDATA (item_name);
|
|
|
|
|
|
|
|
|
|
if (lpane == TTYM_FAILURE
|
2013-11-06 00:14:56 +00:00
|
|
|
|
|| (! tty_menu_add_selection (menu, lpane, item_data,
|
|
|
|
|
!NILP (enable), help_string)))
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
tty_menu_destroy (menu);
|
|
|
|
|
*error_name = "Can't add selection to menu";
|
2013-10-11 15:30:21 +00:00
|
|
|
|
entry = Qnil;
|
|
|
|
|
goto tty_menu_end;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
i += MENU_ITEMS_ITEM_LENGTH;
|
|
|
|
|
lines++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
maxlines = max (maxlines, lines);
|
|
|
|
|
|
|
|
|
|
/* All set and ready to fly. */
|
|
|
|
|
dispwidth = f->text_cols;
|
|
|
|
|
dispheight = f->text_lines;
|
|
|
|
|
x = min (x, dispwidth);
|
|
|
|
|
y = min (y, dispheight);
|
|
|
|
|
x = max (x, 1);
|
|
|
|
|
y = max (y, 1);
|
|
|
|
|
tty_menu_locate (menu, x, y, &ulx, &uly, &width, &height);
|
2013-10-11 15:30:21 +00:00
|
|
|
|
if (ulx + width > dispwidth)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
x -= (ulx + width) - dispwidth;
|
|
|
|
|
ulx = dispwidth - width;
|
|
|
|
|
}
|
2013-10-11 15:30:21 +00:00
|
|
|
|
if (uly + height > dispheight)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
y -= (uly + height) - dispheight;
|
|
|
|
|
uly = dispheight - height;
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-20 14:09:37 +00:00
|
|
|
|
if (FRAME_HAS_MINIBUF_P (f) && uly + height > dispheight - 2)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
/* Move the menu away of the echo area, to avoid overwriting the
|
|
|
|
|
menu with help echo messages or vice versa. */
|
|
|
|
|
if (BUFFERP (echo_area_buffer[0]) && WINDOWP (echo_area_window))
|
|
|
|
|
{
|
2013-09-23 13:15:29 +00:00
|
|
|
|
y -= WINDOW_TOTAL_LINES (XWINDOW (echo_area_window)) + 1;
|
|
|
|
|
uly -= WINDOW_TOTAL_LINES (XWINDOW (echo_area_window)) + 1;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-09-23 13:15:29 +00:00
|
|
|
|
y -= 2;
|
|
|
|
|
uly -= 2;
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ulx < 0) x -= ulx;
|
|
|
|
|
if (uly < 0) y -= uly;
|
|
|
|
|
|
2013-09-18 20:31:07 +00:00
|
|
|
|
#if 0
|
|
|
|
|
/* This code doesn't make sense on a TTY, since it can easily annul
|
|
|
|
|
the adjustments above that carefully avoid truncation of the menu
|
2013-09-26 08:10:53 +00:00
|
|
|
|
items. I think it was written to fix some problem that only
|
|
|
|
|
happens on X11. */
|
2012-06-02 14:57:51 +00:00
|
|
|
|
if (! for_click)
|
|
|
|
|
{
|
|
|
|
|
/* If position was not given by a mouse click, adjust so upper left
|
|
|
|
|
corner of the menu as a whole ends up at given coordinates. This
|
|
|
|
|
is what x-popup-menu says in its documentation. */
|
2014-03-20 14:09:37 +00:00
|
|
|
|
x += width / 2;
|
|
|
|
|
y += 1.5 * height / (maxlines + 2);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
2013-09-18 20:31:07 +00:00
|
|
|
|
#endif
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
|
|
|
|
pane = selidx = 0;
|
|
|
|
|
|
2016-03-24 18:05:49 +00:00
|
|
|
|
/* We save and restore the current buffer because tty_menu_activate
|
|
|
|
|
triggers redisplay, which switches buffers at will. */
|
2018-06-14 22:59:08 +00:00
|
|
|
|
record_unwind_protect_ptr (tty_pop_down_menu,
|
|
|
|
|
&((struct tty_pop_down_menu)
|
|
|
|
|
{menu, current_buffer}));
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
2013-09-23 13:15:29 +00:00
|
|
|
|
specbind (Qoverriding_terminal_local_map,
|
|
|
|
|
Fsymbol_value (Qtty_menu_navigation_map));
|
2012-06-02 14:57:51 +00:00
|
|
|
|
status = tty_menu_activate (menu, &pane, &selidx, x, y, &datap,
|
2014-06-04 04:58:31 +00:00
|
|
|
|
tty_menu_help_callback,
|
|
|
|
|
menuflags & MENU_KBD_NAVIGATION);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
entry = pane_prefix = Qnil;
|
|
|
|
|
|
|
|
|
|
switch (status)
|
|
|
|
|
{
|
|
|
|
|
case TTYM_SUCCESS:
|
|
|
|
|
/* Find the item number SELIDX in pane number PANE. */
|
|
|
|
|
i = 0;
|
|
|
|
|
while (i < menu_items_used)
|
|
|
|
|
{
|
2013-09-17 15:58:43 +00:00
|
|
|
|
if (EQ (AREF (menu_items, i), Qt))
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
if (pane == 0)
|
|
|
|
|
pane_prefix
|
2013-09-17 15:58:43 +00:00
|
|
|
|
= AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
pane--;
|
|
|
|
|
i += MENU_ITEMS_PANE_LENGTH;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (pane == -1)
|
|
|
|
|
{
|
|
|
|
|
if (selidx == 0)
|
|
|
|
|
{
|
|
|
|
|
entry
|
2013-09-17 15:58:43 +00:00
|
|
|
|
= AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
|
2014-06-04 04:58:31 +00:00
|
|
|
|
if (menuflags & MENU_KEYMAPS)
|
2012-06-02 14:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
entry = Fcons (entry, Qnil);
|
|
|
|
|
if (!NILP (pane_prefix))
|
|
|
|
|
entry = Fcons (pane_prefix, entry);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
selidx--;
|
|
|
|
|
}
|
|
|
|
|
i += MENU_ITEMS_ITEM_LENGTH;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2013-10-08 14:28:37 +00:00
|
|
|
|
case TTYM_NEXT:
|
|
|
|
|
case TTYM_PREV:
|
|
|
|
|
tty_menu_new_item_coords (f, status, &item_x, &item_y);
|
Rename integerp->fixnum, etc, in preparation for bignums
* src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
src/process.c, src/profiler.c, src/search.c, src/sound.c,
src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
2018-07-07 03:56:17 +00:00
|
|
|
|
entry = Fcons (make_fixnum (item_x), make_fixnum (item_y));
|
2013-10-08 14:28:37 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2012-06-02 14:57:51 +00:00
|
|
|
|
case TTYM_FAILURE:
|
|
|
|
|
*error_name = "Can't activate menu";
|
|
|
|
|
case TTYM_IA_SELECT:
|
|
|
|
|
break;
|
|
|
|
|
case TTYM_NO_SELECT:
|
2014-01-25 08:25:51 +00:00
|
|
|
|
/* If the selected frame was changed while we displayed a menu,
|
|
|
|
|
throw to top level in order to undo any temporary settings
|
|
|
|
|
made by TTY menu code. */
|
|
|
|
|
if (f != SELECTED_FRAME ())
|
|
|
|
|
Ftop_level ();
|
2012-06-02 14:57:51 +00:00
|
|
|
|
/* Make "Cancel" equivalent to C-g unless FOR_CLICK (which means
|
|
|
|
|
the menu was invoked with a mouse event as POSITION). */
|
2014-06-04 04:58:31 +00:00
|
|
|
|
if (!(menuflags & MENU_FOR_CLICK))
|
2016-07-24 09:10:09 +00:00
|
|
|
|
quit ();
|
2012-06-02 14:57:51 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-11 15:30:21 +00:00
|
|
|
|
tty_menu_end:
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
2018-06-28 07:37:08 +00:00
|
|
|
|
return SAFE_FREE_UNBIND_TO (specpdl_count, entry);
|
2012-06-02 14:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-29 01:22:40 +00:00
|
|
|
|
#endif /* !MSDOS */
|
2012-06-02 14:57:51 +00:00
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
2009-06-28 19:07:16 +00:00
|
|
|
|
#ifndef MSDOS
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
/***********************************************************************
|
|
|
|
|
Initialization
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
/* Initialize the tty-dependent part of frame F. The frame must
|
2013-11-29 01:22:40 +00:00
|
|
|
|
already have its device initialized. */
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
|
1998-04-14 12:25:56 +00:00
|
|
|
|
void
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
create_tty_output (struct frame *f)
|
Implemented multiple tty support.
README.multi-tty: New file.
src/termchar.h (struct terminal): Renamed to struct tty_output. Added name, type,
input, output, termscript, old_tty, term_initted, old_tty_valid,
background_pixel, foreground_pixel, next fields.
(TERMINAL_*): Renamed to TTY_* for brevity.
(CURRENT_TERMINAL): Renamed to CURTTY for brevity.
(tty_list): New variable.
(TERMINAL_PTR): Removed.
(FRAME_TTY): New function.
(TTY_NAME, TTY_TYPE): New macros.
src/term.c (current_terminal): Removed. (_current_terminal): Removed. (tty_list):
New variable. (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
parameter. (set_terminal_modes): Added tty parameter. (reset_terminal_modes):
Added tty parameter. (cursor_to, raw_cursor_to): Updated cmgoto() calls.
(clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
cmcheckmagic() calls. (get_named_tty): New function. (term_dummy_init): New
function. (term_init): Added name parameter, added tty_output return value.
Changed algorithm to update tty_list. Call init_sys_modes() to set up tty
mode on the newly opened terminal device.
(get_current_tty): New function, intended for debugging.
src/termhooks.h (termscript): Removed.
src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
definition.
src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
(current_tty): New variable, for cmputc().
(cmcheckmagic, cmputc, cmgoto): Added prototypes.
src/cm.c (current_tty): New variable, for cmputc().
(cmputc): Use it.
(cmcheckmagic): Added tty parameter, look up terminal streams there.
(calccost): Added tty parameter. Use emacs_tputs() instead of tputs().
(cmgoto): Added tty parameter. Pass it on to calccost(). Use emacs_tputs()
instead of tputs().
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
(term_init): Added name parameter (the filename of the terminal device). Added
return value (struct tty_output).
src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
(termscript): Moved to struct tty_output.
(terminal_type): Removed.
src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
during init_display().
(shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
src/frame.c (Qtty, Qtty_type): New variables.
(syms_of_frame): Initialize them.
(tty_display): Removed.
(make_terminal_frame): New parameters (tty filename and type).
Initialize output_data.tty field instead of output_data.x. Use term_init() to
find the right tty_output. (Use term_dummy_init() during bootstrap.)
(Fmake_terminal_frame): Get device filename and type from frame parameters.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
if the frame is a tty.
(struct frame): New member in output_data: tty.
(make_terminal_frame): Updated of prototype.
src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
reset_sys_modes(). Ditto with init_sys_modes().
src/lisp.h (tty_output): Added forward declaration.
(init_sys_modes, reset_sys_modes): Updated prototype.
(init_all_sys_modes, reset_all_sys_modes): New prototypes.
src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
(init_all_sys_modes): New function.
(init_sys_modes): Added tty_output parameter. Use it.
(reset_all_sys_modes): New function.
(reset_sys_modes): Added tty_output parameter. Use it.
src/Makefile.in: Update dependencies.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
2003-12-25 06:59:31 +00:00
|
|
|
|
{
|
More xmalloc and related cleanup.
* alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
* callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
* doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
* font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
* gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
* nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
* regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
* sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
* xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
* xterm.c:
Omit needless casts involving void * pointers and allocation.
Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
as the former is more robust if P's type is changed.
Prefer xzalloc to xmalloc + memset 0.
Simplify malloc-or-realloc to realloc.
Don't worry about xmalloc returning a null pointer.
Prefer xstrdup to xmalloc + strcpy.
* editfns.c (Fmessage_box): Grow message_text by at least 80 when
growing it.
* keyboard.c (apply_modifiers_uncached): Prefer local array to
alloca of a constant.
2012-07-05 18:35:48 +00:00
|
|
|
|
struct tty_output *t = xzalloc (sizeof *t);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
2013-08-15 05:23:40 +00:00
|
|
|
|
eassert (FRAME_TERMCAP_P (f));
|
Converted display hooks to be display-local. Plus many bugfixes.
lib-src/emacsclient.c (window_change_signal): Renamed to pass_signal_to_emacs.
(init_signal): Pass SIGINT and SIGQUIT to the emacs process.
lisp/faces.el (face-valid-attribute-values): Use the window-system
function, not the variable.
(read-face-attribute, face-spec-set-match-display, frame-set-background-mode)
(face-set-after-frame-default): Ditto.
lisp/frame.el (make-frame-on-tty): Added interactive declaration
(suggested by Robert J. Chassell). Use tty-create-frame-with-faces,
not make-terminal-frame.
src/termhooks.h (struct display_method): Renamed to display for brevity.
(struct display): Added all display hook variables as members of this structure.
Added next_display, reference_count, type and display_info components.
(FRAME_MUST_WRITE_SPACES, FRAME_FAST_CLEAR_END_OF_LINE, FRAME_LINE_INS_DEL_OK)
(FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK, FRAME_SCROLL_REGION_COST)
(FRAME_MEMORY_BELOW_FRAME, FRAME_RIF): Updated for struct display.
(FRAME_DISPLAY): New macro.
(create_display, delete_display): New prototypes.
src/frame.h (struct frame): Added `display' member, removed display_method.
(FRAME_LIVE_P): Look at f->display, not f->output_data.
src/termchar.h (struct tty_display_info): Removed display_method component.
(FRAME_TTY): Use the display structure, not output_data.
src/term.c (display_list): New variable.
(cursor_to_hook, raw_cursor_to_hook, clear_to_end_hook, clear_frame_hook)
(clear_end_of_line_hook, ins_del_lines_hook, delete_glyphs_hook)
(ring_bell_hook, reset_terminal_modes_hook, set_terminal_modes_hook)
(update_begin_hook, update_end_hook, set_terminal_window_hook)
(insert_glyphs_hook, write_glyphs_hook, delete_glyphs_hoo, read_socket_hook)
(frame_up_to_date_hook, mouse_position_hook, frame_rehighlight_hook)
(frame_raise_lower_hook, set_vertical_scroll_bar_hook, condemn_scroll_bars_hook)
(redeem_scroll_bar_hook, judge_scroll_bars_hook): Moved to struct display.
(tty_display_method_template): Removed.
(syms_of_term): Don't initialize tty_display_method_template.
(ring_bell, set_terminal_modes, reset_terminal_modes, update_begin)
(update_end, set_terminal_window, cursor_to, raw_cursor_to, clear_to_end)
(clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Access display hooks through the frame pointer.
(Ftty_display_color_p): Use the frame given as a parameter, or else return nil.
(Ftty_display_color_cells): Ditto.
(get_named_tty): Renamed to get_named_tty_display, changed return type to struct display.
(term_dummy_init): Renamed to initial_term_init. Create and return an initial display.
(term_init): Initialize a new struct display and return a pointer to
it instead of tty_display_info. Removed frame initialization kludge.
(Fdelete_tty): Updated for struct display.
(delete_tty): The parameter type is now struct display, not tty_display_info.
Delete the display, too.
(create_tty_output): New function for creating tty_output structures.
(delete_tty_output): New function for deleting tty_output structures.
(create_display): New function for creating and registering display structures.
(delete_display): New function for deleting and unregistering display structures.
src/dispextern.h: Updated prototypes.
src/dispnew.c: Include frame.h before termhooks.h.
(init_display): Updated term_init call to new signature.
src/emacs.c: Include frame.h (for termhooks.h).
src/keymap.c: Ditto.
src/lread.c: Ditto.
src/xsmfns.c: Ditto.
src/process.c: Include frame.h before termhooks.h.
src/frame.c (Fwindow_system): New function.
(syms_of_frame): Initialize it.
(make_terminal_frame): Open the terminal device before creating the new frame.
Disable scrollbars here, term_init cannot do that anymore.
(Fdelete_frame): Use the new delete_frame_hook, don't do display-specific
frame deletion here. Ditto for delete_display_hook.
(Fmouse_position, Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus): Access display hooks through the frame pointer.
src/keyboard.c: Include frame.h before termhooks.h.
(start_polling, input_polling_used, stop_polling, gobble_input): Ignore read_socket_hook.
(kbd_buffer_get_event, Fset_input_mode): Access display hooks through the frame pointer.
(read_avail_input): Loop through all display devices for and call all read_socket_hook functions. Check ttys even if read_socket_hook returned an error.
src/sysdep.c (discard_tty_input): Ignore read_socket_hook.
(stuff_char): Don't do anything if the current frame is not on a termcap display.
(request_sigio, unrequest_sigio): Ignore read_socket_hook.
(init_sys_modes): Always call narrow_foreground_group. Set up terminal modes and sigio even under X.
src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window): Access display hooks through the frame pointer.
(echo_area_display): Don't be afraid of termcap frames during an X+tty combo session.
src/xfaces.c: Include termhooks.h.
(Ftty_supports_face_attributes_p): Use the given frame, not selected_frame.
src/xfns.c (x_set_scroll_bar_foreground, x_set_scroll_bar_background): Access display hooks through the frame pointer.
(Fx_create_frame, x_create_tip_frame): Initialize the frame's display structure.
src/xmenu.c: Include termhooks.h after frame.h.
src/xselect.c (x_own_selection, some_frame_on_display, x_get_foreign_selection)
(Fx_disown_selection_internal, Fx_get_cut_buffer_internal)
(Fx_store_cut_buffer_internal, Fx_rotate_cut_buffers_internal): Don't do anything
if the selected frame is not an X frame.
src/xterm.c (x_display_method): Removed.
(x_create_frame_display, x_delete_frame_display): New functions for handling struct display objects.
(x_term_init): Set up a new struct display object, too.
(x_delete_display): Delete the struct display corresponding to the X display.
(x_initialize): Moved hook initialization to x_create_frame_display.
src/xterm.h (x_display_method): Removed.
(struct x_display_info): Added frame_display component.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-44
2004-01-05 05:54:35 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
t->display_info = FRAME_TERMINAL (f)->display_info.tty;
|
2005-06-27 00:56:21 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
f->output_data.tty = t;
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-29 01:22:40 +00:00
|
|
|
|
/* Delete frame F's face cache, and its tty-dependent part. */
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
2008-12-11 20:38:36 +00:00
|
|
|
|
tty_free_frame_resources (struct frame *f)
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
{
|
2013-08-15 05:23:40 +00:00
|
|
|
|
eassert (FRAME_TERMCAP_P (f));
|
2013-12-11 15:06:04 +00:00
|
|
|
|
free_frame_faces (f);
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
xfree (f->output_data.tty);
|
Implemented multiple tty support.
README.multi-tty: New file.
src/termchar.h (struct terminal): Renamed to struct tty_output. Added name, type,
input, output, termscript, old_tty, term_initted, old_tty_valid,
background_pixel, foreground_pixel, next fields.
(TERMINAL_*): Renamed to TTY_* for brevity.
(CURRENT_TERMINAL): Renamed to CURTTY for brevity.
(tty_list): New variable.
(TERMINAL_PTR): Removed.
(FRAME_TTY): New function.
(TTY_NAME, TTY_TYPE): New macros.
src/term.c (current_terminal): Removed. (_current_terminal): Removed. (tty_list):
New variable. (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
parameter. (set_terminal_modes): Added tty parameter. (reset_terminal_modes):
Added tty parameter. (cursor_to, raw_cursor_to): Updated cmgoto() calls.
(clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
cmcheckmagic() calls. (get_named_tty): New function. (term_dummy_init): New
function. (term_init): Added name parameter, added tty_output return value.
Changed algorithm to update tty_list. Call init_sys_modes() to set up tty
mode on the newly opened terminal device.
(get_current_tty): New function, intended for debugging.
src/termhooks.h (termscript): Removed.
src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
definition.
src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
(current_tty): New variable, for cmputc().
(cmcheckmagic, cmputc, cmgoto): Added prototypes.
src/cm.c (current_tty): New variable, for cmputc().
(cmputc): Use it.
(cmcheckmagic): Added tty parameter, look up terminal streams there.
(calccost): Added tty parameter. Use emacs_tputs() instead of tputs().
(cmgoto): Added tty parameter. Pass it on to calccost(). Use emacs_tputs()
instead of tputs().
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
(term_init): Added name parameter (the filename of the terminal device). Added
return value (struct tty_output).
src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
(termscript): Moved to struct tty_output.
(terminal_type): Removed.
src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
during init_display().
(shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
src/frame.c (Qtty, Qtty_type): New variables.
(syms_of_frame): Initialize them.
(tty_display): Removed.
(make_terminal_frame): New parameters (tty filename and type).
Initialize output_data.tty field instead of output_data.x. Use term_init() to
find the right tty_output. (Use term_dummy_init() during bootstrap.)
(Fmake_terminal_frame): Get device filename and type from frame parameters.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
if the frame is a tty.
(struct frame): New member in output_data: tty.
(make_terminal_frame): Updated of prototype.
src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
reset_sys_modes(). Ditto with init_sys_modes().
src/lisp.h (tty_output): Added forward declaration.
(init_sys_modes, reset_sys_modes): Updated prototype.
(init_all_sys_modes, reset_all_sys_modes): New prototypes.
src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
(init_all_sys_modes): New function.
(init_sys_modes): Added tty_output parameter. Use it.
(reset_all_sys_modes): New function.
(reset_sys_modes): Added tty_output parameter. Use it.
src/Makefile.in: Update dependencies.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
2003-12-25 06:59:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-06-28 19:07:16 +00:00
|
|
|
|
#else /* MSDOS */
|
|
|
|
|
|
2013-11-29 01:22:40 +00:00
|
|
|
|
/* Delete frame F's face cache. */
|
2009-06-28 19:07:16 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
tty_free_frame_resources (struct frame *f)
|
|
|
|
|
{
|
2013-08-15 05:23:40 +00:00
|
|
|
|
eassert (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f));
|
2013-12-11 15:06:04 +00:00
|
|
|
|
free_frame_faces (f);
|
2009-06-28 19:07:16 +00:00
|
|
|
|
}
|
|
|
|
|
#endif /* MSDOS */
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
2007-09-10 21:25:32 +00:00
|
|
|
|
/* Reset the hooks in TERMINAL. */
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
|
2006-05-20 12:00:16 +00:00
|
|
|
|
static void
|
|
|
|
|
clear_tty_hooks (struct terminal *terminal)
|
|
|
|
|
{
|
|
|
|
|
terminal->rif = 0;
|
|
|
|
|
terminal->cursor_to_hook = 0;
|
|
|
|
|
terminal->raw_cursor_to_hook = 0;
|
|
|
|
|
terminal->clear_to_end_hook = 0;
|
|
|
|
|
terminal->clear_frame_hook = 0;
|
|
|
|
|
terminal->clear_end_of_line_hook = 0;
|
|
|
|
|
terminal->ins_del_lines_hook = 0;
|
|
|
|
|
terminal->insert_glyphs_hook = 0;
|
|
|
|
|
terminal->write_glyphs_hook = 0;
|
|
|
|
|
terminal->delete_glyphs_hook = 0;
|
|
|
|
|
terminal->ring_bell_hook = 0;
|
|
|
|
|
terminal->reset_terminal_modes_hook = 0;
|
|
|
|
|
terminal->set_terminal_modes_hook = 0;
|
|
|
|
|
terminal->update_begin_hook = 0;
|
|
|
|
|
terminal->update_end_hook = 0;
|
|
|
|
|
terminal->set_terminal_window_hook = 0;
|
|
|
|
|
terminal->mouse_position_hook = 0;
|
|
|
|
|
terminal->frame_rehighlight_hook = 0;
|
|
|
|
|
terminal->frame_raise_lower_hook = 0;
|
2006-12-03 15:03:30 +00:00
|
|
|
|
terminal->fullscreen_hook = 0;
|
2014-06-04 04:58:31 +00:00
|
|
|
|
terminal->menu_show_hook = 0;
|
2006-05-20 12:00:16 +00:00
|
|
|
|
terminal->set_vertical_scroll_bar_hook = 0;
|
Complete pixelwise frame/window resizing, add horizontal scrollbar support.
* frame.el (frame-notice-user-settings): Rewrite using
frame-initial-frame-tool-bar-height.
* menu-bar.el (menu-bar-horizontal-scroll-bar)
(menu-bar-no-horizontal-scroll-bar): New functions.
(menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal
scroll bars.
* scroll-bar.el (scroll-bar-lines)
(set-horizontal-scroll-bar-mode)
(get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode)
(scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag)
(scroll-bar-toolkit-horizontal-scroll): New functions.
(horizontal-scroll-bar-mode)
(previous-horizontal-scroll-bar-mode)
(horizontal-scroll-bar-mode-explicit): New variables.
(horizontal-scroll-bar-mode): New option.
(toggle-horizontal-scroll-bar): Do something.
(top-level): Bind horizontal-scroll-bar mouse-1.
* startup.el (tool-bar-originally-present): Remove variable.
(command-line): Don't set tool-bar-originally-present.
* window.el (window-min-height): Update doc-string.
(window--dump-frame): Dump horizontal scroll bar values.
(window--min-size-1): Handle minibuffer window separately.
Count in margins and horizontal scroll bar. Return safe value
iff IGNORE equals 'safe.
(frame-windows-min-size): New function (used by frame resizing
routines).
(fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal
scroll bars.
(window--sanitize-window-sizes): New function.
(window-split-min-size): Remove.
(split-window): Count divider-width. Don't use
`window-split-min-size' any more. Reword error messages.
Sanitize windows sizes after splitting.
* buffer.h (struct buffer): New fields scroll_bar_height and
horizontal_scroll_bar_type.
* buffer.c (bset_scroll_bar_height)
(bset_horizontal_scroll_bar_type): New functions.
(Fbuffer_swap_text): Handle old_pointm field.
(init_buffer_once): Set defaults for scroll_bar_height and
horizontal_scroll_bar_type.
(syms_of_buffer): New variables scroll_bar_height and
horizontal_scroll_bar_type.
* dispextern.h (window_part): Rename ON_SCROLL_BAR to
ON_VERTICAL_SCROLL_BAR. Add ON_HORIZONTAL_SCROLL_BAR.
(set_vertical_scroll_bar): Remove prototype.
(x_change_tool_bar_height): Add prototype.
* dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
(window_to_frame_vpos, update_frame_1, scrolling, init_display):
Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS
and FRAME_LINES.
(adjust_frame_glyphs_for_window_redisplay): Rearrange lines.
(update_window): Start mode_line_row->y after horizontal scroll
bar.
(change_frame_size_1): Call adjust_frame_size.
(init_display): When changing the size of a tty frame do not
pass height of menu bar.
(Qframe_windows_min_size): New symbol.
* frame.h (struct frame): List tool bar fields after menu bar
fields. Add official, total_lines, horizontal_scroll_bars,
config_scroll_bar_height and config_scroll_bar_lines fields.
(FRAME_HAS_HORIZONTAL_SCROLL_BARS)
(FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES)
(FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS)
(FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES)
(FRAME_WINDOWS_HEIGHT): New macros.
(SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT)
(FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES)
(FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and
horizontal scroll bar.
(frame_inhibit_resize, adjust_frame_size)
(frame_windows_min_size): Add declarations.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(x_set_scroll_bar_default_height, x_set_left_fringe)
(x_set_right_fringe, x_set_vertical_scroll_bars)
(x_set_horizontal_scroll_bars, x_set_scroll_bar_width)
(x_set_scroll_bar_height): Add external declarations.
* frame.c: (frame_inhibit_resize, frame_windows_min_size)
(adjust_frame_size): New functions.
(make_frame): Initial horizontal_scroll_bars field. Use
SET_FRAME_LINES. Don't allow horizontal scroll bar in
minibuffer window.
(make_initial_frame, make_terminal_frame): No horizontal scroll
bar in initial and terminal frames. Use adjust_frame_size.
(Fframe_total_cols): Fix doc-string.
(Fframe_total_lines, Fscroll_bar_height): New Lisp functions.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite
using adjust_frame_size.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(Qframe_windows_min_size): New symbols.
(x_set_frame_parameters): Remove call of check_frame_size.
(x_report_frame_params): Return scroll_bar_height value.
(x_set_left_fringe, x_set_right_fringe): New functions.
(adjust_frame_height, x_set_internal_border_width)
(x_set_fringe_width): Remove.
(x_set_internal_border_width, x_set_vertical_scroll_bars)
(x_set_scroll_bar_width, x_set_right_divider_width)
(x_set_bottom_divider_width): Rewrite using adjust_frame_size.
(x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New
functions.
(x_figure_window_size): Rewrite to make frame display the
expected number of lines.
(Vdefault_frame_scroll_bars): Rewrite doc-string.
(Vdefault_frame_horizontal_scroll_bars)
(Vframe_initial_frame_tool_bar_height)
(frame_inhibit_implied_resize): New variables.
* fringe.c (compute_fringe_widths): Remove.
* gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define.
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb)
(xg_get_default_scrollbar_height)
(xg_clear_under_internal_border): Extern.
* gtkutil.c (xg_frame_resized): Don't call
do_pending_window_change.
(xg_frame_set_char_size): Use adjust_frame_size.
(style_changed_cb): Call update_theme_scrollbar_height and
x_set_scroll_bar_default_height.
(x_wm_set_size_hint): Don't call check_frame_size.
(update_theme_scrollbar_height)
(xg_get_default_scrollbar_height)
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb): New functions.
(xg_create_scroll_bar): Set horizontal slot of bar.
(xg_initialize): Call update_theme_scrollbar_height.
(xg_clear_under_internal_border): No more static.
* insdel.c (adjust_suspend_auto_hscroll): New function.
(adjust_markers_for_delete, adjust_markers_for_insert)
(adjust_markers_for_replace): Call adjust_suspend_auto_hscroll.
* keyboard.c (readable_events, discard_mouse_events)
(make_lispy_event): Handle horizontal scroll bar click events.
(Fsuspend_emacs): When changing the size of a tty frame do not
pass height of menu bar.
(Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft)
(Qright, Qleftmost, Qrightmost): New symbols.
* menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of
FRAME_LINES.
* minibuf.c (read_minibuf): Initialize suspend_auto_hscroll.
* nsfns.m (x_set_internal_border_width): New function.
* nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar):
Remove extended fringe code.
(x_set_window_size, x_new_font): Don't call
compute_fringe_widths.
* term.c (Fresume_tty): When changing the size of a tty frame do
not pass height of menu bar.
(clear_tty_hooks, set_tty_hooks): Clear
horizontal_scroll_bar_hook.
(init_tty): Frame has no horizontal scroll bars.
* termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio,
scroll_bar_before_handle, scroll_bar_horizontal_handle,
scroll_bar_after_handle, scroll_bar_left_arrow,
scroll_bar_right_arrow, scroll_bar_to_leftmost and
scroll_bar_to_rightmost entries.
(enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT
(struct terminal): Add set_horizontal_scroll_bar_hook.
* w32console.c (initialize_w32_display): Clear
horizontal_scroll_bar_hook.
* w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of
FRAME_X_DISPLAY.
(x_clear_under_internal_border, x_set_internal_border_width):
New functions.
(x_set_menu_bar_lines): Rewrite using frame_inhibit_resize. Set
windows_or_buffers_changed when adding the menu bar.
(x_set_tool_bar_lines): Rewrite using adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(w32_createhscrollbar): New functions.
(w32_createscrollbar): Rename to w32_createvscrollbar.
(w32_createwindow): Init WND_HSCROLLBAR_INDEX.
(w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by
WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR. Add
WM_EMACS_SHOWCURSOR.
(w32_wnd_proc): Handle WM_HSCROLL case. In WM_WINDOWPOSCHANGING
case do not artificially impose WM size hints. Handle
WM_EMACS_SHOWCURSOR case. Replace WM_EMACS_CREATESCROLLBAR case
by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR
cases.
(my_create_tip_window): Replace WND_SCROLLBAR_INDEX by
WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Make both scrollbars the system standard
width and height. Use official field of frame structure to
inhibit running window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(w32_frame_parm_handlers): Remove x_set_fringe_width
entries. Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe and
x_set_right_fringe.
* w32inevt.c (resize_event, maybe_generate_resize_event): Do not
pass height of menu bar to change_frame_size.
* w32menu.c (set_frame_menubar): Rewrite using
frame_inhibit_resize.
* w32term.h (struct w32_display_info): Add
horizontal_scroll_bar_cursor and cursor_display_counter.
(struct scroll_bar): Add horizontal.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH)
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros.
(WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define
instead of WM_EMACS_CREATESCROLLBAR.
(WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of
WND_SCROLLBAR_INDEX.
* w32term.c (horizontal_scroll_bar_min_handle)
(horizontal_scroll_bar_left_border)
(horizontal_scroll_bar_right_border): New integers.
(x_set_frame_alpha): Replace x_highlight_frame by
w32_focus_frame.
(x_window_to_scroll_bar): New argument "type". Update callers
accordingly.
(w32_set_horizontal_scroll_bar_thumb)
(x_horizontal_scroll_bar_report_motion)
(w32_set_horizontal_scroll_bar)
(w32_horizontal_scroll_bar_handle_click)
(x_horizontal_scroll_bar_report_motion): New functions.
(w32_mouse_position): Discriminate horizontal and vertical
scrollbar cases.
(my_create_scrollbar): Replace with two new functions
my_create_vscrollbar and my_create_hscrollbar.
(x_scroll_bar_create): New argument "horizontal". Update
callers accordingly.
(x_scroll_bar_remove, w32_condemn_scroll_bars)
(w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal
scroll bar case.
(w32_read_socket): Handle WM_HSCROLL cae.
(x_new_font): Don't recompute fringe widths. Use
frame_inhibit_resize. Calculate new menu bar height iff we
build without toolkit. Always clear under internal border.
(x_set_window_size): Don't check frame size or recompute
fringes. Reset fullscreen status before applying sizes. Always
resize as requested by pixelwise argument. Don't call
do_pending_window_change.
(x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT.
(w32_initialize_display_info): Initialize dpyinfo's
horizontal_scroll_bar_cursor entry.
(w32_create_terminal): Add set_horizontal_scroll_bar_hook.
(w32_initialize): Init horizontal_scroll_bar_min_handle and
horizontal_scroll_bar_left_border.
(w32fullscreen_hook): Intermittently resize window to normal
when switching from fullscreen to maximized state.
(run_window_configuration_change_hook): Don't run it if frame is
not official yet.
(unwind_change_frame): Remove.
(Fset_window_configuration): Rewrite using frame's official field.
* widget.c (set_frame_size): Don't call compute_fringe_widths.
(EmacsFrameSetCharSize): Obey frame_inhibit_resize.
* window.h (struct window): New fields old_pointm,
horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole,
scroll_bar_height and suspend_auto_hscroll.
(wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type):
New functions.
(sanitize_window_sizes): Extern.
(MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P)
(WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR)
(WINDOW_CONFIG_SCROLL_BAR_HEIGHT)
(WINDOW_CONFIG_SCROLL_BAR_LINES)
(WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New
macros.
(WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
(WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros.
(WINDOW_VERTICAL_SCROLL_BAR_TYPE)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite.
(WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT)
(WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height.
* window.c (wset_old_pointm, Fwindow_scroll_bar_height)
(Fwindow_old_point, sanitize_window_sizes): New functions.
(Qwindow_sanitize_window_sizes): New symbol.
(window_body_height): Count in horizontal scroll bar.
(set_window_hscroll, Fscroll_left, Fscroll_right): Set
suspend_auto_hscroll slot.
(Fwindow_inside_edges): Count fringes pixelwise.
(coordinates_in_window, Fcoordinates_in_window_p): Consider
horizontal scroll bar.
(check_frame_size, adjust_window_margins): Remove functions and
corresponding calls.
(set_window_buffer): Initialize old_pointm and horizontal scroll
bars.
(temp_output_buffer_show): Reset hscroll related fields.
Initialize old_pointm.
(make_parent_window): Initialize old_pointm.
(make_window): Initialize old_pointm, horizontal scroll bar type,
and scroll bar height.
(resize_frame_windows): Don't count top margin in new sizes.
Don't use safe sizes when shrinking a frame; let the window
manager do the clipping.
(Fsplit_window_internal): Inherit horizontal scroll bar type and
height.
(Fdelete_window_internal): Unchain old_pointm marker.
(window_scroll_pixel_based, Fscroll_other_window): Adjust
old_pointm.
(Fwindow_text_width, Fwindow_text_height): New argument
"pixelwise".
(struct saved_window): New fields, old_pointm, hscroll_whole,
suspend_auto_hscroll, scroll_bar_height and
horizontal_scroll_bar_type.
(Fset_window_configuration, save_window_save): Set new fields of
saved_window.
(apply_window_adjustment): Don't call adjust_window_margins.
(set_window_margins): Don't change margins if new sizes don't
fit into window.
(set_window_scroll_bars): New argument "horizontal_type".
Handle horizontal scroll bars. Don't change scroll bars if they
don't fit into window.
(Fset_window_scroll_bars): New argument "horizontal_type".
(Fwindow_scroll_bars): Return values for horizontal scroll bars.
(compare_window_configurations): Compare horizontal scroll bar
settings.
* xdisp.c (window_text_bottom_y, window_box_height): Count in
horizontal scroll bar height.
(pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES
instead of FRAME_LINES.
(remember_mouse_glyph): Case ON_SCROLL_BAR changed to
ON_VERTICAL_SCROLL_BAR.
(with_echo_area_buffer): Initialize old_pointm.
(with_echo_area_buffer_unwind_data): Store old_pointm values in
vector.
(unwind_with_echo_area_buffer): Handle old_pointm.
(update_tool_bar): Set do_update when the tool bar window has at
least one line (since this is what the user sets).
(MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro.
(redisplay_tool_bar): Return early when toolbar has zero lines.
Call x_change_tool_bar_height. Don't use max_tool_bar_height.
(hscroll_window_tree): Handle suspension of auto_hscroll and
old_pointm.
(set_horizontal_scroll_bar): New function.
(redisplay_window): Set ignore_mouse_drag_p when tool bar has
more than one line. Handle horizontal scroll bars.
(note_mouse_highlight): Handle horizontal scrol bars.
(expose_frame): Set dimensions of XRectangle from frame's text
sizes.
(Vvoid_text_area_pointer): Update doc-string.
* xfns.c (x_set_menu_bar_lines): Use adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(x_set_internal_border_width): New functions.
(x_set_tool_bar_lines): Call x_change_tool_bar_height.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Handle horizontal scroll bars. Use official
field of frame structure to inhibit running
window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(x_frame_parm_handlers): Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe,
x_set_right_fringe.
* xmenu.c (update_frame_menubar, free_frame_menubar): Use
adjust_frame_size.
* xterm.h (struct x_display_info): Add
horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar
slots.
(struct scroll_bar): Add horizontal slot.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros.
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define.
(x_clear_under_internal_border): Remove.
* xterm.c (XTmouse_position): Handle horizontal scroll bars.
(x_window_to_scroll_bar): New argument TYPE. Update callers.
(x_send_scroll_bar_event, x_scroll_bar_create): New arguments
HORIZONTAL. Update callers.
(horizontal_action_hook_id): New action hook id.
(x_horizontal_scroll_bar_to_input_event)
(x_create_horizontal_toolkit_scroll_bar)
(xt_horizontal_action_hook)
(x_set_toolkit_horizontal_scroll_bar_thumb)
(XTset_horizontal_scroll_bar, x_net_wm_state)
(x_horizontal_scroll_bar_report_motion): New functions.
(xg_scroll_callback, x_scroll_bar_handle_click): Handle
horizontal scroll bars.
(SCROLL_BAR_HORIZONTAL_NAME): Define.
(XTset_vertical_scroll_bar): Attempt to clear areas not covered
by scroll bar.
(XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite. Handle
horizontal scroll bars.
(handle_one_xevent): Handle horizontal scroll bar events. Call
x_net_wm_state.
(x_set_window_size_1, x_wm_set_size_hint): Don't call
check_frame_size.
(x_set_window_size): Don't call check_frame_size and
do_pending_window_change.
(x_term_init): Init horizontal_scroll_bar_cursor display info.
(x_create_terminal): Add set_horizontal_scroll_bar_hook.
(x_scroll_bar_set_handle): Add some checks when calling
x_clear_area.
2014-07-27 13:21:30 +00:00
|
|
|
|
terminal->set_horizontal_scroll_bar_hook = 0;
|
2006-05-20 12:00:16 +00:00
|
|
|
|
terminal->condemn_scroll_bars_hook = 0;
|
|
|
|
|
terminal->redeem_scroll_bar_hook = 0;
|
|
|
|
|
terminal->judge_scroll_bars_hook = 0;
|
|
|
|
|
terminal->read_socket_hook = 0;
|
|
|
|
|
terminal->frame_up_to_date_hook = 0;
|
|
|
|
|
|
|
|
|
|
/* Leave these two set, or suspended frames are not deleted
|
|
|
|
|
correctly. */
|
2008-12-11 20:38:36 +00:00
|
|
|
|
terminal->delete_frame_hook = &tty_free_frame_resources;
|
2006-05-20 12:00:16 +00:00
|
|
|
|
terminal->delete_terminal_hook = &delete_tty;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-10 21:25:32 +00:00
|
|
|
|
/* Initialize hooks in TERMINAL with the values needed for a tty. */
|
|
|
|
|
|
2006-05-20 12:00:16 +00:00
|
|
|
|
static void
|
|
|
|
|
set_tty_hooks (struct terminal *terminal)
|
|
|
|
|
{
|
|
|
|
|
terminal->cursor_to_hook = &tty_cursor_to;
|
|
|
|
|
terminal->raw_cursor_to_hook = &tty_raw_cursor_to;
|
|
|
|
|
terminal->clear_to_end_hook = &tty_clear_to_end;
|
|
|
|
|
terminal->clear_frame_hook = &tty_clear_frame;
|
|
|
|
|
terminal->clear_end_of_line_hook = &tty_clear_end_of_line;
|
|
|
|
|
terminal->ins_del_lines_hook = &tty_ins_del_lines;
|
|
|
|
|
terminal->insert_glyphs_hook = &tty_insert_glyphs;
|
|
|
|
|
terminal->write_glyphs_hook = &tty_write_glyphs;
|
|
|
|
|
terminal->delete_glyphs_hook = &tty_delete_glyphs;
|
|
|
|
|
terminal->ring_bell_hook = &tty_ring_bell;
|
|
|
|
|
terminal->reset_terminal_modes_hook = &tty_reset_terminal_modes;
|
|
|
|
|
terminal->set_terminal_modes_hook = &tty_set_terminal_modes;
|
|
|
|
|
terminal->update_end_hook = &tty_update_end;
|
2014-08-10 16:28:36 +00:00
|
|
|
|
#ifdef MSDOS
|
|
|
|
|
terminal->menu_show_hook = &x_menu_show;
|
|
|
|
|
#else
|
2014-06-04 04:58:31 +00:00
|
|
|
|
terminal->menu_show_hook = &tty_menu_show;
|
2014-08-10 16:28:36 +00:00
|
|
|
|
#endif
|
2006-05-20 12:00:16 +00:00
|
|
|
|
terminal->set_terminal_window_hook = &tty_set_terminal_window;
|
|
|
|
|
terminal->read_socket_hook = &tty_read_avail_input; /* keyboard.c */
|
2008-12-11 20:38:36 +00:00
|
|
|
|
terminal->delete_frame_hook = &tty_free_frame_resources;
|
2006-05-20 12:00:16 +00:00
|
|
|
|
terminal->delete_terminal_hook = &delete_tty;
|
2014-05-14 13:55:37 +00:00
|
|
|
|
/* Other hooks are NULL by default. */
|
2006-05-20 12:00:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-01-11 02:40:58 +00:00
|
|
|
|
/* If FD is the controlling terminal, drop it. */
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
2004-03-28 06:17:38 +00:00
|
|
|
|
dissociate_if_controlling_tty (int fd)
|
|
|
|
|
{
|
2013-01-11 02:40:58 +00:00
|
|
|
|
/* If tcgetpgrp succeeds, fd is the controlling terminal,
|
|
|
|
|
so dissociate it by invoking setsid. */
|
Reorder conditions that are written backwards
* alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
written backwards.
* blockinput.h (input_blocked_p): Likewise.
* bytecode.c (exec_byte_code): Likewise.
* callproc.c (call_process_kill, call_process_cleanup)
(Fcall_process): Likewise.
* ccl.c (ccl_driver, resolve_symbol_ccl_program)
(Fccl_execute_on_string): Likewise.
* character.c (string_escape_byte8): Likewise.
* charset.c (read_hex): Likewise.
* cm.c (calccost): Likewise.
* data.c (cons_to_unsigned): Likewise.
* dired.c (directory_files_internal, file_name_completion):
Likewise.
* dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
(sit_for): Likewise.
* doc.c (Fsubstitute_command_keys): Likewise.
* doprnt.c (doprnt): Likewise.
* editfns.c (hi_time, decode_time_components, Fformat): Likewise.
* emacsgtkfixed.c: Likewise.
* fileio.c (file_offset, Fwrite_region): Likewise.
* floatfns.c (Fexpt, fmod_float): Likewise.
* fns.c (larger_vector, make_hash_table, Fmake_hash_table):
Likewise.
* font.c (font_intern_prop): Likewise.
* frame.c (x_set_alpha): Likewise.
* gtkutil.c (get_utf8_string): Likewise.
* indent.c (check_display_width): Likewise.
* intervals.c (create_root_interval, rotate_right, rotate_left)
(split_interval_right, split_interval_left)
(adjust_intervals_for_insertion, delete_node)
(interval_deletion_adjustment, adjust_intervals_for_deletion)
(merge_interval_right, merge_interval_left, copy_intervals)
(set_intervals_multibyte_1): Likewise.
* keyboard.c (gobble_input, append_tool_bar_item): Likewise.
* keymap.c (Fkey_description): Likewise.
* lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
* lread.c (openp, read_integer, read1, string_to_number):
Likewise.
* menu.c (ensure_menu_items): Likewise.
* minibuf.c (read_minibuf_noninteractive): Likewise.
* print.c (printchar, strout): Likewise.
* process.c (create_process, Faccept_process_output)
(wait_reading_process_output, read_process_output, send_process)
(wait_reading_process_output): Likewise.
* profiler.c (make_log, handle_profiler_signal): Likewise.
* regex.c (re_exec): Likewise.
* regex.h: Likewise.
* search.c (looking_at_1, Freplace_match): Likewise.
* sysdep.c (get_child_status, procfs_ttyname)
(procfs_get_total_memory): Likewise.
* systime.h (EMACS_TIME_VALID_P): Likewise.
* term.c (dissociate_if_controlling_tty): Likewise.
* window.c (get_phys_cursor_glyph): Likewise.
* xdisp.c (init_iterator, redisplay_internal, redisplay_window)
(try_window_reusing_current_matrix, try_window_id, pint2hrstr):
Likewise.
* xfns.c (Fx_window_property): Likewise.
* xmenu.c (set_frame_menubar): Likewise.
* xselect.c (x_get_window_property, x_handle_dnd_message):
Likewise.
* xsmfns.c (smc_save_yourself_CB): Likewise.
* xterm.c (x_scroll_bar_set_handle): Likewise.
2013-03-24 12:59:45 +00:00
|
|
|
|
if (tcgetpgrp (fd) >= 0 && setsid () < 0)
|
2013-01-11 02:40:58 +00:00
|
|
|
|
{
|
|
|
|
|
#ifdef TIOCNOTTY
|
|
|
|
|
/* setsid failed, presumably because Emacs is already a process
|
|
|
|
|
group leader. Fall back on the obsolescent way to dissociate
|
|
|
|
|
a controlling tty. */
|
Handle sigmask better with nested signal handlers.
* atimer.c (sigmask_atimers): Remove.
Remaining use rewritten to use body of this function.
* atimer.c (block_atimers, unblock_atimers):
* callproc.c (block_child_signal, unblock_child_signal):
* sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
New arg OLDSET. All callers changed.
* atimer.c (block_atimers, unblock_atimers):
* callproc.c (block_child_signal, unblock_child_signal):
* keyboard.c (handle_interrupt):
* sound.c (vox_configure, vox_close):
Restore the old signal mask rather than unilaterally clearing bits
from the mask, in case a handler is running within another
handler. All callers changed.
* lisp.h, process.c, process.h, term.c:
Adjust decls and callers to match new API.
* sysdep.c (emacs_sigaction_init): Don't worry about masking SIGFPE;
signal handlers aren't supposed to use floating point anyway.
(handle_arith_signal): Unblock just SIGFPE rather than clearing mask.
Fixes: debbugs:15561
2014-03-25 14:43:26 +00:00
|
|
|
|
sigset_t oldset;
|
|
|
|
|
block_tty_out_signal (&oldset);
|
2013-01-11 02:40:58 +00:00
|
|
|
|
ioctl (fd, TIOCNOTTY, 0);
|
Handle sigmask better with nested signal handlers.
* atimer.c (sigmask_atimers): Remove.
Remaining use rewritten to use body of this function.
* atimer.c (block_atimers, unblock_atimers):
* callproc.c (block_child_signal, unblock_child_signal):
* sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
New arg OLDSET. All callers changed.
* atimer.c (block_atimers, unblock_atimers):
* callproc.c (block_child_signal, unblock_child_signal):
* keyboard.c (handle_interrupt):
* sound.c (vox_configure, vox_close):
Restore the old signal mask rather than unilaterally clearing bits
from the mask, in case a handler is running within another
handler. All callers changed.
* lisp.h, process.c, process.h, term.c:
Adjust decls and callers to match new API.
* sysdep.c (emacs_sigaction_init): Don't worry about masking SIGFPE;
signal handlers aren't supposed to use floating point anyway.
(handle_arith_signal): Unblock just SIGFPE rather than clearing mask.
Fixes: debbugs:15561
2014-03-25 14:43:26 +00:00
|
|
|
|
unblock_tty_out_signal (&oldset);
|
2013-01-11 02:40:58 +00:00
|
|
|
|
#endif
|
|
|
|
|
}
|
2004-03-28 06:17:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
/* Create a termcap display on the tty device with the given name and
|
|
|
|
|
type.
|
|
|
|
|
|
2016-09-07 00:27:24 +00:00
|
|
|
|
If NAME is NULL, then use the controlling tty, i.e., DEV_TTY.
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
Otherwise NAME should be a path to the tty device file,
|
|
|
|
|
e.g. "/dev/pts/7".
|
Implemented multiple tty support.
README.multi-tty: New file.
src/termchar.h (struct terminal): Renamed to struct tty_output. Added name, type,
input, output, termscript, old_tty, term_initted, old_tty_valid,
background_pixel, foreground_pixel, next fields.
(TERMINAL_*): Renamed to TTY_* for brevity.
(CURRENT_TERMINAL): Renamed to CURTTY for brevity.
(tty_list): New variable.
(TERMINAL_PTR): Removed.
(FRAME_TTY): New function.
(TTY_NAME, TTY_TYPE): New macros.
src/term.c (current_terminal): Removed. (_current_terminal): Removed. (tty_list):
New variable. (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
parameter. (set_terminal_modes): Added tty parameter. (reset_terminal_modes):
Added tty parameter. (cursor_to, raw_cursor_to): Updated cmgoto() calls.
(clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
cmcheckmagic() calls. (get_named_tty): New function. (term_dummy_init): New
function. (term_init): Added name parameter, added tty_output return value.
Changed algorithm to update tty_list. Call init_sys_modes() to set up tty
mode on the newly opened terminal device.
(get_current_tty): New function, intended for debugging.
src/termhooks.h (termscript): Removed.
src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
definition.
src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
(current_tty): New variable, for cmputc().
(cmcheckmagic, cmputc, cmgoto): Added prototypes.
src/cm.c (current_tty): New variable, for cmputc().
(cmputc): Use it.
(cmcheckmagic): Added tty parameter, look up terminal streams there.
(calccost): Added tty parameter. Use emacs_tputs() instead of tputs().
(cmgoto): Added tty parameter. Pass it on to calccost(). Use emacs_tputs()
instead of tputs().
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
(term_init): Added name parameter (the filename of the terminal device). Added
return value (struct tty_output).
src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
(termscript): Moved to struct tty_output.
(terminal_type): Removed.
src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
during init_display().
(shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
src/frame.c (Qtty, Qtty_type): New variables.
(syms_of_frame): Initialize them.
(tty_display): Removed.
(make_terminal_frame): New parameters (tty filename and type).
Initialize output_data.tty field instead of output_data.x. Use term_init() to
find the right tty_output. (Use term_dummy_init() during bootstrap.)
(Fmake_terminal_frame): Get device filename and type from frame parameters.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
if the frame is a tty.
(struct frame): New member in output_data: tty.
(make_terminal_frame): Updated of prototype.
src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
reset_sys_modes(). Ditto with init_sys_modes().
src/lisp.h (tty_output): Added forward declaration.
(init_sys_modes, reset_sys_modes): Updated prototype.
(init_all_sys_modes, reset_all_sys_modes): New prototypes.
src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
(init_all_sys_modes): New function.
(init_sys_modes): Added tty_output parameter. Use it.
(reset_all_sys_modes): New function.
(reset_sys_modes): Added tty_output parameter. Use it.
src/Makefile.in: Update dependencies.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
2003-12-25 06:59:31 +00:00
|
|
|
|
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
TERMINAL_TYPE is the termcap type of the device, e.g. "vt100".
|
|
|
|
|
|
2013-08-02 21:16:33 +00:00
|
|
|
|
If MUST_SUCCEED is true, then all errors are fatal. */
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
struct terminal *
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
init_tty (const char *name, const char *terminal_type, bool must_succeed)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Fix compiler warnings in the MinGW build
* configure.ac [mingw32]: Don't add -Wpointer-sign, and add
-Wno-pointer-sign, to keep the noise level down.
* nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
-Wredundant-decls, as that produces a lot of noise due to
redeclaration of time-related functions by gnulib.
* nt/runemacs.c (set_user_model_id): Fix argument type of
'SetCurrentProcessExplicitAppUserModelID'.
* src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
declare 'dpyinfo', as it is unused.
(xpm_load): Fix warnings about pointer signedness.
* src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
prototypes.
(sys_spawnve): Avoid warnings about discarding 'const' qualifier.
(sys_select): Provide prototype.
(g_b_init_compare_string_w): Move declaration to file scope.
* src/w32heap.c (dumped_data_commit): Now static.
(FREEABLE_P): Avoid warnings about pointer comparison with integer.
(mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
* src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
(evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
Provide prototypes.
* src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
redundant prototypes.
(w32_get_internal_run_time, map_w32_filename): Provide prototype.
(init_environment, sys_ctime): Avoid warnings about discarding
'const' qualifier.
Include utimens.h.
(sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
(sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
(sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
prototypes.
(sys_rename_replace): Use %d to avoid compiler warnings.
(_wsa_errlist): Make the message text 'const char *', to avoid
compilation warnings.
(dynlib_reset_last_error): Move prototype to file scope.
(w32_get_resource): First argument is now 'const char *'.
* src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
(otf_features): Second argument is no 'const char *'.
* src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
(x_set_window_size): Remove redundant prototypes.
(XChangeGC, XGetGCValues, w32_draw_underwave)
(w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
(x_calc_absolute_position, x_destroy_window): Now static.
(menubar_selection_callback): Move prototype to file scope.
* src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
declaration.
(w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
(w32font_full_name): Fix warnings about implicit conversion of
'float' to 'double'.
* src/w32reg.c (w32_get_rdb_resource): Fix warnings about
discarding 'const' qualifier.
* src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
(set_frame_menubar): Remove redundant prototypes.
(menubar_selection_callback, w32_menu_display_help): Provide
prototypes.
(simple_dialog_show): Avoid warnings about discarding 'const'
qualifier.
* src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
(free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
(x_set_tool_bar_lines, x_set_internal_border_width): Remove
redundant prototypes.
(current_popup_menu): Remove redundant declaration.
(colormap_t): Member 'name' is now 'const char *'.
(add_system_logical_colors_to_map): Fix signed/unsigned warnings.
(x_decode_color, x_set_border_pixel)
(x_clear_under_internal_border, x_set_name, hook_w32_key)
(reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
static.
(w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
(w32_msg_worker, w32_last_error): Provide prototypes.
(funhook, lookup_vk_code): Avoid warnings about missing
parentheses.
(x_default_font_parameter, Fw32_notification_notify): Avoid
warnings about discarding 'const' qualifier.
(Fx_create_frame): Avoid warnings about empty body of 'else'.
(x_screen_planes): Ifdef away unused function.
(Fx_show_tip): Remove unused variables.
(Fw32_battery_status): Avoid warnings about implicit promotion
from float to double.
(Fw32_notification_notify): Initialize 'timeout'.
* src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
define the TIMER_SETTIME_RUNNING value if it will be used.
* src/w32notify.c (send_notifications): Ifdef away an empty if
clause. Remove unused variable.
(watch_end, watch_completion): Provide prototypes.
* src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
* src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
warning with pointer signedness.
* src/gnutls.c (gnutls_x509_crt_get_signature)
(gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
don't load them from the GnuTLS library, as they are no longer
used.
* src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
define, as it's unused.
* src/unexw32.c (open_input_file, open_output_file)
(close_file_data): Remove redundant prototypes.
(_start): provide prototype.
(mainCRTStartup): Move prototype to file level.
(find_section): Use type-cast to shut up compiler warnings.
(offset_to_section, relocate_offset): Now static.
(find_section): First argument is now a 'const char *'.
(offset_to_section): Ifdef away, as it's unused.
* src/w32heap.h (find_section): Adjust prototype.
* src/dynlib.c (dynlib_reset_last_error): Provide prototype.
* src/dired.c (directory_files_internal_w32_unwind): Avoid
warnings about missing prototypes.
(is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
(directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
signedness.
* src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
Fix warnings about pointer signedness.
* src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
unused.
* src/sysdep.c (_getpid): Remove redundant prototype.
(sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
[!MSDOS]: Don't define 'st', it's unused.
(init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
(str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
* src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
n_to_read, as it is not used.
(MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
* src/w32font.h (syms_of_w32font): Remove redundant prototype.
* src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
* src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
not used by DOS_NT builds, to avoid compiler warnings.
* src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
declaration.
* src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
up compiler warnings.
* src/w32term.h (x_set_window_size, x_get_focus_frame)
(x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
(x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
(x_free_frame_resources, x_real_positions)
(display_x_get_resource): Remove redundant prototypes.
* lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
(sys_rename, gettimeofday): Provide prototypes.
* lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
declarations.
* lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
(xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
(close_winsock, initialize_sockets, w32_set_user_model_id)
(w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
prototypes.
(w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
difference.
(w32_set_user_model_id): Update prototype of
SetCurrentProcessExplicitAppUserModelID to avoid compiler
warnings.
(start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
shut up compiler warnings.
* lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
2016-05-21 17:06:33 +00:00
|
|
|
|
struct tty_display_info *tty = NULL;
|
|
|
|
|
struct terminal *terminal = NULL;
|
|
|
|
|
#ifndef DOS_NT
|
2013-08-26 18:10:30 +00:00
|
|
|
|
char *area;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
char **address = &area;
|
|
|
|
|
int status;
|
Handle sigmask better with nested signal handlers.
* atimer.c (sigmask_atimers): Remove.
Remaining use rewritten to use body of this function.
* atimer.c (block_atimers, unblock_atimers):
* callproc.c (block_child_signal, unblock_child_signal):
* sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
New arg OLDSET. All callers changed.
* atimer.c (block_atimers, unblock_atimers):
* callproc.c (block_child_signal, unblock_child_signal):
* keyboard.c (handle_interrupt):
* sound.c (vox_configure, vox_close):
Restore the old signal mask rather than unilaterally clearing bits
from the mask, in case a handler is running within another
handler. All callers changed.
* lisp.h, process.c, process.h, term.c:
Adjust decls and callers to match new API.
* sysdep.c (emacs_sigaction_init): Don't worry about masking SIGFPE;
signal handlers aren't supposed to use floating point anyway.
(handle_arith_signal): Unblock just SIGFPE rather than clearing mask.
Fixes: debbugs:15561
2014-03-25 14:43:26 +00:00
|
|
|
|
sigset_t oldset;
|
2013-08-02 21:16:33 +00:00
|
|
|
|
bool ctty = false; /* True if asked to open controlling tty. */
|
Fix compiler warnings in the MinGW build
* configure.ac [mingw32]: Don't add -Wpointer-sign, and add
-Wno-pointer-sign, to keep the noise level down.
* nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
-Wredundant-decls, as that produces a lot of noise due to
redeclaration of time-related functions by gnulib.
* nt/runemacs.c (set_user_model_id): Fix argument type of
'SetCurrentProcessExplicitAppUserModelID'.
* src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
declare 'dpyinfo', as it is unused.
(xpm_load): Fix warnings about pointer signedness.
* src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
prototypes.
(sys_spawnve): Avoid warnings about discarding 'const' qualifier.
(sys_select): Provide prototype.
(g_b_init_compare_string_w): Move declaration to file scope.
* src/w32heap.c (dumped_data_commit): Now static.
(FREEABLE_P): Avoid warnings about pointer comparison with integer.
(mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
* src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
(evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
Provide prototypes.
* src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
redundant prototypes.
(w32_get_internal_run_time, map_w32_filename): Provide prototype.
(init_environment, sys_ctime): Avoid warnings about discarding
'const' qualifier.
Include utimens.h.
(sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
(sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
(sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
prototypes.
(sys_rename_replace): Use %d to avoid compiler warnings.
(_wsa_errlist): Make the message text 'const char *', to avoid
compilation warnings.
(dynlib_reset_last_error): Move prototype to file scope.
(w32_get_resource): First argument is now 'const char *'.
* src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
(otf_features): Second argument is no 'const char *'.
* src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
(x_set_window_size): Remove redundant prototypes.
(XChangeGC, XGetGCValues, w32_draw_underwave)
(w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
(x_calc_absolute_position, x_destroy_window): Now static.
(menubar_selection_callback): Move prototype to file scope.
* src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
declaration.
(w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
(w32font_full_name): Fix warnings about implicit conversion of
'float' to 'double'.
* src/w32reg.c (w32_get_rdb_resource): Fix warnings about
discarding 'const' qualifier.
* src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
(set_frame_menubar): Remove redundant prototypes.
(menubar_selection_callback, w32_menu_display_help): Provide
prototypes.
(simple_dialog_show): Avoid warnings about discarding 'const'
qualifier.
* src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
(free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
(x_set_tool_bar_lines, x_set_internal_border_width): Remove
redundant prototypes.
(current_popup_menu): Remove redundant declaration.
(colormap_t): Member 'name' is now 'const char *'.
(add_system_logical_colors_to_map): Fix signed/unsigned warnings.
(x_decode_color, x_set_border_pixel)
(x_clear_under_internal_border, x_set_name, hook_w32_key)
(reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
static.
(w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
(w32_msg_worker, w32_last_error): Provide prototypes.
(funhook, lookup_vk_code): Avoid warnings about missing
parentheses.
(x_default_font_parameter, Fw32_notification_notify): Avoid
warnings about discarding 'const' qualifier.
(Fx_create_frame): Avoid warnings about empty body of 'else'.
(x_screen_planes): Ifdef away unused function.
(Fx_show_tip): Remove unused variables.
(Fw32_battery_status): Avoid warnings about implicit promotion
from float to double.
(Fw32_notification_notify): Initialize 'timeout'.
* src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
define the TIMER_SETTIME_RUNNING value if it will be used.
* src/w32notify.c (send_notifications): Ifdef away an empty if
clause. Remove unused variable.
(watch_end, watch_completion): Provide prototypes.
* src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
* src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
warning with pointer signedness.
* src/gnutls.c (gnutls_x509_crt_get_signature)
(gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
don't load them from the GnuTLS library, as they are no longer
used.
* src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
define, as it's unused.
* src/unexw32.c (open_input_file, open_output_file)
(close_file_data): Remove redundant prototypes.
(_start): provide prototype.
(mainCRTStartup): Move prototype to file level.
(find_section): Use type-cast to shut up compiler warnings.
(offset_to_section, relocate_offset): Now static.
(find_section): First argument is now a 'const char *'.
(offset_to_section): Ifdef away, as it's unused.
* src/w32heap.h (find_section): Adjust prototype.
* src/dynlib.c (dynlib_reset_last_error): Provide prototype.
* src/dired.c (directory_files_internal_w32_unwind): Avoid
warnings about missing prototypes.
(is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
(directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
signedness.
* src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
Fix warnings about pointer signedness.
* src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
unused.
* src/sysdep.c (_getpid): Remove redundant prototype.
(sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
[!MSDOS]: Don't define 'st', it's unused.
(init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
(str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
* src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
n_to_read, as it is not used.
(MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
* src/w32font.h (syms_of_w32font): Remove redundant prototype.
* src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
* src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
not used by DOS_NT builds, to avoid compiler warnings.
* src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
declaration.
* src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
up compiler warnings.
* src/w32term.h (x_set_window_size, x_get_focus_frame)
(x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
(x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
(x_free_frame_resources, x_real_positions)
(display_x_get_resource): Remove redundant prototypes.
* lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
(sys_rename, gettimeofday): Provide prototypes.
* lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
declarations.
* lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
(xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
(close_winsock, initialize_sockets, w32_set_user_model_id)
(w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
prototypes.
(w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
difference.
(w32_set_user_model_id): Update prototype of
SetCurrentProcessExplicitAppUserModelID to avoid compiler
warnings.
(start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
shut up compiler warnings.
* lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
2016-05-21 17:06:33 +00:00
|
|
|
|
#endif
|
Implemented multiple tty support.
README.multi-tty: New file.
src/termchar.h (struct terminal): Renamed to struct tty_output. Added name, type,
input, output, termscript, old_tty, term_initted, old_tty_valid,
background_pixel, foreground_pixel, next fields.
(TERMINAL_*): Renamed to TTY_* for brevity.
(CURRENT_TERMINAL): Renamed to CURTTY for brevity.
(tty_list): New variable.
(TERMINAL_PTR): Removed.
(FRAME_TTY): New function.
(TTY_NAME, TTY_TYPE): New macros.
src/term.c (current_terminal): Removed. (_current_terminal): Removed. (tty_list):
New variable. (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
parameter. (set_terminal_modes): Added tty parameter. (reset_terminal_modes):
Added tty parameter. (cursor_to, raw_cursor_to): Updated cmgoto() calls.
(clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
cmcheckmagic() calls. (get_named_tty): New function. (term_dummy_init): New
function. (term_init): Added name parameter, added tty_output return value.
Changed algorithm to update tty_list. Call init_sys_modes() to set up tty
mode on the newly opened terminal device.
(get_current_tty): New function, intended for debugging.
src/termhooks.h (termscript): Removed.
src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
definition.
src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
(current_tty): New variable, for cmputc().
(cmcheckmagic, cmputc, cmgoto): Added prototypes.
src/cm.c (current_tty): New variable, for cmputc().
(cmputc): Use it.
(cmcheckmagic): Added tty parameter, look up terminal streams there.
(calccost): Added tty parameter. Use emacs_tputs() instead of tputs().
(cmgoto): Added tty parameter. Pass it on to calccost(). Use emacs_tputs()
instead of tputs().
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
(term_init): Added name parameter (the filename of the terminal device). Added
return value (struct tty_output).
src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
(termscript): Moved to struct tty_output.
(terminal_type): Removed.
src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
during init_display().
(shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
src/frame.c (Qtty, Qtty_type): New variables.
(syms_of_frame): Initialize them.
(tty_display): Removed.
(make_terminal_frame): New parameters (tty filename and type).
Initialize output_data.tty field instead of output_data.x. Use term_init() to
find the right tty_output. (Use term_dummy_init() during bootstrap.)
(Fmake_terminal_frame): Get device filename and type from frame parameters.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
if the frame is a tty.
(struct frame): New member in output_data: tty.
(make_terminal_frame): Updated of prototype.
src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
reset_sys_modes(). Ditto with init_sys_modes().
src/lisp.h (tty_output): Added forward declaration.
(init_sys_modes, reset_sys_modes): Updated prototype.
(init_all_sys_modes, reset_all_sys_modes): New prototypes.
src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
(init_all_sys_modes): New function.
(init_sys_modes): Added tty_output parameter. Use it.
(reset_all_sys_modes): New function.
(reset_sys_modes): Added tty_output parameter. Use it.
src/Makefile.in: Update dependencies.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
2003-12-25 06:59:31 +00:00
|
|
|
|
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
if (!terminal_type)
|
2008-12-08 14:44:30 +00:00
|
|
|
|
maybe_fatal (must_succeed, 0,
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
"Unknown terminal type",
|
|
|
|
|
"Unknown terminal type");
|
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
* lisp/frame.el (make-frame-on-display): Update doc.
(make-frame): Handle display-id parameter. Update doc.
(frames-on-display-list): Update for display ids.
(framep-on-display): Ditto.
(suspend-frame): Use display-name, not frame-tty-name.
(selected-display): New function.
* lisp/server.el (server-delete-client): Use delete-display, not delete-tty.
(server-tty-live-p, server-handle-delete-tty): Removed.
(server-handle-delete-frame): Delete tty clients, if needed.
(server-process-filter): Set the display parameter, and use it when appropriate.
(server-handle-suspend-tty): Use the display parameter.
(server-start, server-unload-hook): Removed obsolete delete-tty hook.
* lisp/talk.el (talk): Always use talk-add-display.
(talk-add-tty-frame, talk-handle-delete-tty): Removed.
(talk-handle-delete-frame): New function.
(talk-add-display): Open a new frame only if parameter was not a frame.
* src/dispextern.h (get_display, Fdisplay_tty_type): New prototypes.
(Fframe_tty_type): Removed.
* src/dispnew.c (init_display): Use Fdisplay_tty_type, not Fframe_tty_type.
* src/frame.c (Qdisplay_id, Qdisplay_live_p): New symbols.
(make_terminal_frame): Get display as a parameter.
(Fmake_terminal_frame): Get/create display here; pass it to
make_terminal_frame.
(Fframe_display): New function.
(Fdelete_frame): Stop if the hook deleted the frame.
(syms_of_frame): Register new stuff.
* src/frame.h (Qdisplay_id, Qdisplay_live_p, make_terminal_frame):
Updated prototypes.
* src/keyboard.c (interrupt_signal): Updated comment.
* src/term.c (Vdelete_tty_after_functions): Removed variable.
(Qframe_tty_name, Qframe_tty_type): Removed.
(next_display_id): New var.
(tty_ring_bell): Don't do anything on suspended frames.
(Ftty_display_color_p, Ftty_display_color_cells): Doc update.
(get_display): New function.
(get_tty_display): Use it.
(get_named_tty_display): Ignore suspended displays.
(Fframe_tty_name): Renamed to Fdisplay_name. Handle all kinds of
displays.
(Fframe_tty_type): Renamed to Fdisplay_tty_type.
(init_initial_display): Set display name.
(term_init): Allow more displays on the same device. Set display name.
(Fdelete_tty): Removed.
(delete_tty): Don't run hooks.
(create_display): Set display id.
(delete_display): Free display name.
(Fdelete_display, Fdisplay_live_p, Fdisplay_list): New functions.
(Fsuspend_tty): Call hook with display id. Doc update.
(Fresume_tty): Refuse to resume when there is already an active display
on the same device. Call hook with display id. Doc update.
(syms_of_term): Reflect above changes.
* src/termhooks.h (struct display): Added `id' and `name' members.
(DISPLAY_ACTIVE_P): New macro.
* src/xfns.c (check_x_display_info): Handle display ids.
(Fx_create_frame): Try to get display from `display-id' parameter.
* src/xterm.c (x_term_init): Set display name.
(x_delete_display): Handle the case when `font_table' is NULL.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-207
2004-07-04 04:48:55 +00:00
|
|
|
|
|
2006-05-20 17:12:43 +00:00
|
|
|
|
if (name == NULL)
|
2007-09-22 12:41:29 +00:00
|
|
|
|
name = DEV_TTY;
|
Fix compiler warnings in the MinGW build
* configure.ac [mingw32]: Don't add -Wpointer-sign, and add
-Wno-pointer-sign, to keep the noise level down.
* nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
-Wredundant-decls, as that produces a lot of noise due to
redeclaration of time-related functions by gnulib.
* nt/runemacs.c (set_user_model_id): Fix argument type of
'SetCurrentProcessExplicitAppUserModelID'.
* src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
declare 'dpyinfo', as it is unused.
(xpm_load): Fix warnings about pointer signedness.
* src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
prototypes.
(sys_spawnve): Avoid warnings about discarding 'const' qualifier.
(sys_select): Provide prototype.
(g_b_init_compare_string_w): Move declaration to file scope.
* src/w32heap.c (dumped_data_commit): Now static.
(FREEABLE_P): Avoid warnings about pointer comparison with integer.
(mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
* src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
(evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
Provide prototypes.
* src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
redundant prototypes.
(w32_get_internal_run_time, map_w32_filename): Provide prototype.
(init_environment, sys_ctime): Avoid warnings about discarding
'const' qualifier.
Include utimens.h.
(sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
(sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
(sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
prototypes.
(sys_rename_replace): Use %d to avoid compiler warnings.
(_wsa_errlist): Make the message text 'const char *', to avoid
compilation warnings.
(dynlib_reset_last_error): Move prototype to file scope.
(w32_get_resource): First argument is now 'const char *'.
* src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
(otf_features): Second argument is no 'const char *'.
* src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
(x_set_window_size): Remove redundant prototypes.
(XChangeGC, XGetGCValues, w32_draw_underwave)
(w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
(x_calc_absolute_position, x_destroy_window): Now static.
(menubar_selection_callback): Move prototype to file scope.
* src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
declaration.
(w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
(w32font_full_name): Fix warnings about implicit conversion of
'float' to 'double'.
* src/w32reg.c (w32_get_rdb_resource): Fix warnings about
discarding 'const' qualifier.
* src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
(set_frame_menubar): Remove redundant prototypes.
(menubar_selection_callback, w32_menu_display_help): Provide
prototypes.
(simple_dialog_show): Avoid warnings about discarding 'const'
qualifier.
* src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
(free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
(x_set_tool_bar_lines, x_set_internal_border_width): Remove
redundant prototypes.
(current_popup_menu): Remove redundant declaration.
(colormap_t): Member 'name' is now 'const char *'.
(add_system_logical_colors_to_map): Fix signed/unsigned warnings.
(x_decode_color, x_set_border_pixel)
(x_clear_under_internal_border, x_set_name, hook_w32_key)
(reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
static.
(w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
(w32_msg_worker, w32_last_error): Provide prototypes.
(funhook, lookup_vk_code): Avoid warnings about missing
parentheses.
(x_default_font_parameter, Fw32_notification_notify): Avoid
warnings about discarding 'const' qualifier.
(Fx_create_frame): Avoid warnings about empty body of 'else'.
(x_screen_planes): Ifdef away unused function.
(Fx_show_tip): Remove unused variables.
(Fw32_battery_status): Avoid warnings about implicit promotion
from float to double.
(Fw32_notification_notify): Initialize 'timeout'.
* src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
define the TIMER_SETTIME_RUNNING value if it will be used.
* src/w32notify.c (send_notifications): Ifdef away an empty if
clause. Remove unused variable.
(watch_end, watch_completion): Provide prototypes.
* src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
* src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
warning with pointer signedness.
* src/gnutls.c (gnutls_x509_crt_get_signature)
(gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
don't load them from the GnuTLS library, as they are no longer
used.
* src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
define, as it's unused.
* src/unexw32.c (open_input_file, open_output_file)
(close_file_data): Remove redundant prototypes.
(_start): provide prototype.
(mainCRTStartup): Move prototype to file level.
(find_section): Use type-cast to shut up compiler warnings.
(offset_to_section, relocate_offset): Now static.
(find_section): First argument is now a 'const char *'.
(offset_to_section): Ifdef away, as it's unused.
* src/w32heap.h (find_section): Adjust prototype.
* src/dynlib.c (dynlib_reset_last_error): Provide prototype.
* src/dired.c (directory_files_internal_w32_unwind): Avoid
warnings about missing prototypes.
(is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
(directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
signedness.
* src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
Fix warnings about pointer signedness.
* src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
unused.
* src/sysdep.c (_getpid): Remove redundant prototype.
(sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
[!MSDOS]: Don't define 'st', it's unused.
(init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
(str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
* src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
n_to_read, as it is not used.
(MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
* src/w32font.h (syms_of_w32font): Remove redundant prototype.
* src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
* src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
not used by DOS_NT builds, to avoid compiler warnings.
* src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
declaration.
* src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
up compiler warnings.
* src/w32term.h (x_set_window_size, x_get_focus_frame)
(x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
(x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
(x_free_frame_resources, x_real_positions)
(display_x_get_resource): Remove redundant prototypes.
* lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
(sys_rename, gettimeofday): Provide prototypes.
* lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
declarations.
* lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
(xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
(close_winsock, initialize_sockets, w32_set_user_model_id)
(w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
prototypes.
(w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
difference.
(w32_set_user_model_id): Update prototype of
SetCurrentProcessExplicitAppUserModelID to avoid compiler
warnings.
(start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
shut up compiler warnings.
* lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
2016-05-21 17:06:33 +00:00
|
|
|
|
#ifndef DOS_NT
|
2007-09-22 12:41:29 +00:00
|
|
|
|
if (!strcmp (name, DEV_TTY))
|
2006-05-20 17:12:43 +00:00
|
|
|
|
ctty = 1;
|
Fix compiler warnings in the MinGW build
* configure.ac [mingw32]: Don't add -Wpointer-sign, and add
-Wno-pointer-sign, to keep the noise level down.
* nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
-Wredundant-decls, as that produces a lot of noise due to
redeclaration of time-related functions by gnulib.
* nt/runemacs.c (set_user_model_id): Fix argument type of
'SetCurrentProcessExplicitAppUserModelID'.
* src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
declare 'dpyinfo', as it is unused.
(xpm_load): Fix warnings about pointer signedness.
* src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
prototypes.
(sys_spawnve): Avoid warnings about discarding 'const' qualifier.
(sys_select): Provide prototype.
(g_b_init_compare_string_w): Move declaration to file scope.
* src/w32heap.c (dumped_data_commit): Now static.
(FREEABLE_P): Avoid warnings about pointer comparison with integer.
(mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
* src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
(evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
Provide prototypes.
* src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
redundant prototypes.
(w32_get_internal_run_time, map_w32_filename): Provide prototype.
(init_environment, sys_ctime): Avoid warnings about discarding
'const' qualifier.
Include utimens.h.
(sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
(sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
(sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
prototypes.
(sys_rename_replace): Use %d to avoid compiler warnings.
(_wsa_errlist): Make the message text 'const char *', to avoid
compilation warnings.
(dynlib_reset_last_error): Move prototype to file scope.
(w32_get_resource): First argument is now 'const char *'.
* src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
(otf_features): Second argument is no 'const char *'.
* src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
(x_set_window_size): Remove redundant prototypes.
(XChangeGC, XGetGCValues, w32_draw_underwave)
(w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
(x_calc_absolute_position, x_destroy_window): Now static.
(menubar_selection_callback): Move prototype to file scope.
* src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
declaration.
(w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
(w32font_full_name): Fix warnings about implicit conversion of
'float' to 'double'.
* src/w32reg.c (w32_get_rdb_resource): Fix warnings about
discarding 'const' qualifier.
* src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
(set_frame_menubar): Remove redundant prototypes.
(menubar_selection_callback, w32_menu_display_help): Provide
prototypes.
(simple_dialog_show): Avoid warnings about discarding 'const'
qualifier.
* src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
(free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
(x_set_tool_bar_lines, x_set_internal_border_width): Remove
redundant prototypes.
(current_popup_menu): Remove redundant declaration.
(colormap_t): Member 'name' is now 'const char *'.
(add_system_logical_colors_to_map): Fix signed/unsigned warnings.
(x_decode_color, x_set_border_pixel)
(x_clear_under_internal_border, x_set_name, hook_w32_key)
(reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
static.
(w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
(w32_msg_worker, w32_last_error): Provide prototypes.
(funhook, lookup_vk_code): Avoid warnings about missing
parentheses.
(x_default_font_parameter, Fw32_notification_notify): Avoid
warnings about discarding 'const' qualifier.
(Fx_create_frame): Avoid warnings about empty body of 'else'.
(x_screen_planes): Ifdef away unused function.
(Fx_show_tip): Remove unused variables.
(Fw32_battery_status): Avoid warnings about implicit promotion
from float to double.
(Fw32_notification_notify): Initialize 'timeout'.
* src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
define the TIMER_SETTIME_RUNNING value if it will be used.
* src/w32notify.c (send_notifications): Ifdef away an empty if
clause. Remove unused variable.
(watch_end, watch_completion): Provide prototypes.
* src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
* src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
warning with pointer signedness.
* src/gnutls.c (gnutls_x509_crt_get_signature)
(gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
don't load them from the GnuTLS library, as they are no longer
used.
* src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
define, as it's unused.
* src/unexw32.c (open_input_file, open_output_file)
(close_file_data): Remove redundant prototypes.
(_start): provide prototype.
(mainCRTStartup): Move prototype to file level.
(find_section): Use type-cast to shut up compiler warnings.
(offset_to_section, relocate_offset): Now static.
(find_section): First argument is now a 'const char *'.
(offset_to_section): Ifdef away, as it's unused.
* src/w32heap.h (find_section): Adjust prototype.
* src/dynlib.c (dynlib_reset_last_error): Provide prototype.
* src/dired.c (directory_files_internal_w32_unwind): Avoid
warnings about missing prototypes.
(is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
(directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
signedness.
* src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
Fix warnings about pointer signedness.
* src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
unused.
* src/sysdep.c (_getpid): Remove redundant prototype.
(sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
[!MSDOS]: Don't define 'st', it's unused.
(init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
(str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
* src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
n_to_read, as it is not used.
(MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
* src/w32font.h (syms_of_w32font): Remove redundant prototype.
* src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
* src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
not used by DOS_NT builds, to avoid compiler warnings.
* src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
declaration.
* src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
up compiler warnings.
* src/w32term.h (x_set_window_size, x_get_focus_frame)
(x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
(x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
(x_free_frame_resources, x_real_positions)
(display_x_get_resource): Remove redundant prototypes.
* lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
(sys_rename, gettimeofday): Provide prototypes.
* lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
declarations.
* lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
(xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
(close_winsock, initialize_sockets, w32_set_user_model_id)
(w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
prototypes.
(w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
difference.
(w32_set_user_model_id): Update prototype of
SetCurrentProcessExplicitAppUserModelID to avoid compiler
warnings.
(start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
shut up compiler warnings.
* lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
2016-05-21 17:06:33 +00:00
|
|
|
|
#endif
|
2006-05-20 17:12:43 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
/* If we already have a terminal on the given device, use that. If
|
|
|
|
|
all such terminals are suspended, create a new one instead. */
|
2005-07-10 22:25:28 +00:00
|
|
|
|
/* XXX Perhaps this should be made explicit by having init_tty
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
always create a new terminal and separating terminal and frame
|
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
* lisp/frame.el (make-frame-on-display): Update doc.
(make-frame): Handle display-id parameter. Update doc.
(frames-on-display-list): Update for display ids.
(framep-on-display): Ditto.
(suspend-frame): Use display-name, not frame-tty-name.
(selected-display): New function.
* lisp/server.el (server-delete-client): Use delete-display, not delete-tty.
(server-tty-live-p, server-handle-delete-tty): Removed.
(server-handle-delete-frame): Delete tty clients, if needed.
(server-process-filter): Set the display parameter, and use it when appropriate.
(server-handle-suspend-tty): Use the display parameter.
(server-start, server-unload-hook): Removed obsolete delete-tty hook.
* lisp/talk.el (talk): Always use talk-add-display.
(talk-add-tty-frame, talk-handle-delete-tty): Removed.
(talk-handle-delete-frame): New function.
(talk-add-display): Open a new frame only if parameter was not a frame.
* src/dispextern.h (get_display, Fdisplay_tty_type): New prototypes.
(Fframe_tty_type): Removed.
* src/dispnew.c (init_display): Use Fdisplay_tty_type, not Fframe_tty_type.
* src/frame.c (Qdisplay_id, Qdisplay_live_p): New symbols.
(make_terminal_frame): Get display as a parameter.
(Fmake_terminal_frame): Get/create display here; pass it to
make_terminal_frame.
(Fframe_display): New function.
(Fdelete_frame): Stop if the hook deleted the frame.
(syms_of_frame): Register new stuff.
* src/frame.h (Qdisplay_id, Qdisplay_live_p, make_terminal_frame):
Updated prototypes.
* src/keyboard.c (interrupt_signal): Updated comment.
* src/term.c (Vdelete_tty_after_functions): Removed variable.
(Qframe_tty_name, Qframe_tty_type): Removed.
(next_display_id): New var.
(tty_ring_bell): Don't do anything on suspended frames.
(Ftty_display_color_p, Ftty_display_color_cells): Doc update.
(get_display): New function.
(get_tty_display): Use it.
(get_named_tty_display): Ignore suspended displays.
(Fframe_tty_name): Renamed to Fdisplay_name. Handle all kinds of
displays.
(Fframe_tty_type): Renamed to Fdisplay_tty_type.
(init_initial_display): Set display name.
(term_init): Allow more displays on the same device. Set display name.
(Fdelete_tty): Removed.
(delete_tty): Don't run hooks.
(create_display): Set display id.
(delete_display): Free display name.
(Fdelete_display, Fdisplay_live_p, Fdisplay_list): New functions.
(Fsuspend_tty): Call hook with display id. Doc update.
(Fresume_tty): Refuse to resume when there is already an active display
on the same device. Call hook with display id. Doc update.
(syms_of_term): Reflect above changes.
* src/termhooks.h (struct display): Added `id' and `name' members.
(DISPLAY_ACTIVE_P): New macro.
* src/xfns.c (check_x_display_info): Handle display ids.
(Fx_create_frame): Try to get display from `display-id' parameter.
* src/xterm.c (x_term_init): Set display name.
(x_delete_display): Handle the case when `font_table' is NULL.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-207
2004-07-04 04:48:55 +00:00
|
|
|
|
creation on Lisp level. */
|
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but...
* termhooks.h (get_named_terminal): ...resurrect it under
more meaningful name.
(get_terminal): Likewise, but with...
(decode_live_terminal): ...this name.
(decode_tty_terminal): Add prototype.
* term.c (get_tty_terminal): Remove.
(get_named_tty): Remove.
(Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
(Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
Use decode_tty_terminal.
(Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
* terminal.c (get_terminal): Refactor to...
(decode_terminal, decode_live_terminal): ...new functions.
(decode_tty_terminal): Replacement for get_tty_terminal.
(get_named_terminal): Likewise for get_named_tty.
* coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system, Fset_keyboard_coding_system_internal):
(Fkeyboard_coding_system):
* composite.c (Fcomposition_get_gstring):
* dispnew.c (Fsend_string_to_terminal):
* frame.c (Fmake_terminal_frame):
* nsfns.m (check_ns_display_info):
* w32fns.c, xfns.c (check_x_display_info):
* xselect.c (frame_for_x_selection): Use decode_live_terminal.
* keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use get_named_terminal.
(Fset_output_flow_control, Fset_input_meta_mode):
Use decode_tty_terminal.
2014-10-14 12:45:41 +00:00
|
|
|
|
terminal = get_named_terminal (name);
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
if (terminal)
|
|
|
|
|
return terminal;
|
2007-09-22 12:41:29 +00:00
|
|
|
|
|
2014-05-14 13:55:37 +00:00
|
|
|
|
terminal = create_terminal (output_termcap, NULL);
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#ifdef MSDOS
|
|
|
|
|
if (been_here > 0)
|
2011-04-24 09:00:03 +00:00
|
|
|
|
maybe_fatal (0, 0, "Attempt to create another terminal %s", "",
|
2008-08-23 16:55:52 +00:00
|
|
|
|
name, "");
|
|
|
|
|
been_here = 1;
|
|
|
|
|
tty = &the_only_display_info;
|
|
|
|
|
#else
|
More xmalloc and related cleanup.
* alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
* callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
* doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
* font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
* gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
* nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
* regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
* sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
* xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
* xterm.c:
Omit needless casts involving void * pointers and allocation.
Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
as the former is more robust if P's type is changed.
Prefer xzalloc to xmalloc + memset 0.
Simplify malloc-or-realloc to realloc.
Don't worry about xmalloc returning a null pointer.
Prefer xstrdup to xmalloc + strcpy.
* editfns.c (Fmessage_box): Grow message_text by at least 80 when
growing it.
* keyboard.c (apply_modifiers_uncached): Prefer local array to
alloca of a constant.
2012-07-05 18:35:48 +00:00
|
|
|
|
tty = xzalloc (sizeof *tty);
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#endif
|
2012-08-31 10:53:19 +00:00
|
|
|
|
tty->top_frame = Qnil;
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
tty->next = tty_list;
|
|
|
|
|
tty_list = tty;
|
Converted display hooks to be display-local. Plus many bugfixes.
lib-src/emacsclient.c (window_change_signal): Renamed to pass_signal_to_emacs.
(init_signal): Pass SIGINT and SIGQUIT to the emacs process.
lisp/faces.el (face-valid-attribute-values): Use the window-system
function, not the variable.
(read-face-attribute, face-spec-set-match-display, frame-set-background-mode)
(face-set-after-frame-default): Ditto.
lisp/frame.el (make-frame-on-tty): Added interactive declaration
(suggested by Robert J. Chassell). Use tty-create-frame-with-faces,
not make-terminal-frame.
src/termhooks.h (struct display_method): Renamed to display for brevity.
(struct display): Added all display hook variables as members of this structure.
Added next_display, reference_count, type and display_info components.
(FRAME_MUST_WRITE_SPACES, FRAME_FAST_CLEAR_END_OF_LINE, FRAME_LINE_INS_DEL_OK)
(FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK, FRAME_SCROLL_REGION_COST)
(FRAME_MEMORY_BELOW_FRAME, FRAME_RIF): Updated for struct display.
(FRAME_DISPLAY): New macro.
(create_display, delete_display): New prototypes.
src/frame.h (struct frame): Added `display' member, removed display_method.
(FRAME_LIVE_P): Look at f->display, not f->output_data.
src/termchar.h (struct tty_display_info): Removed display_method component.
(FRAME_TTY): Use the display structure, not output_data.
src/term.c (display_list): New variable.
(cursor_to_hook, raw_cursor_to_hook, clear_to_end_hook, clear_frame_hook)
(clear_end_of_line_hook, ins_del_lines_hook, delete_glyphs_hook)
(ring_bell_hook, reset_terminal_modes_hook, set_terminal_modes_hook)
(update_begin_hook, update_end_hook, set_terminal_window_hook)
(insert_glyphs_hook, write_glyphs_hook, delete_glyphs_hoo, read_socket_hook)
(frame_up_to_date_hook, mouse_position_hook, frame_rehighlight_hook)
(frame_raise_lower_hook, set_vertical_scroll_bar_hook, condemn_scroll_bars_hook)
(redeem_scroll_bar_hook, judge_scroll_bars_hook): Moved to struct display.
(tty_display_method_template): Removed.
(syms_of_term): Don't initialize tty_display_method_template.
(ring_bell, set_terminal_modes, reset_terminal_modes, update_begin)
(update_end, set_terminal_window, cursor_to, raw_cursor_to, clear_to_end)
(clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Access display hooks through the frame pointer.
(Ftty_display_color_p): Use the frame given as a parameter, or else return nil.
(Ftty_display_color_cells): Ditto.
(get_named_tty): Renamed to get_named_tty_display, changed return type to struct display.
(term_dummy_init): Renamed to initial_term_init. Create and return an initial display.
(term_init): Initialize a new struct display and return a pointer to
it instead of tty_display_info. Removed frame initialization kludge.
(Fdelete_tty): Updated for struct display.
(delete_tty): The parameter type is now struct display, not tty_display_info.
Delete the display, too.
(create_tty_output): New function for creating tty_output structures.
(delete_tty_output): New function for deleting tty_output structures.
(create_display): New function for creating and registering display structures.
(delete_display): New function for deleting and unregistering display structures.
src/dispextern.h: Updated prototypes.
src/dispnew.c: Include frame.h before termhooks.h.
(init_display): Updated term_init call to new signature.
src/emacs.c: Include frame.h (for termhooks.h).
src/keymap.c: Ditto.
src/lread.c: Ditto.
src/xsmfns.c: Ditto.
src/process.c: Include frame.h before termhooks.h.
src/frame.c (Fwindow_system): New function.
(syms_of_frame): Initialize it.
(make_terminal_frame): Open the terminal device before creating the new frame.
Disable scrollbars here, term_init cannot do that anymore.
(Fdelete_frame): Use the new delete_frame_hook, don't do display-specific
frame deletion here. Ditto for delete_display_hook.
(Fmouse_position, Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus): Access display hooks through the frame pointer.
src/keyboard.c: Include frame.h before termhooks.h.
(start_polling, input_polling_used, stop_polling, gobble_input): Ignore read_socket_hook.
(kbd_buffer_get_event, Fset_input_mode): Access display hooks through the frame pointer.
(read_avail_input): Loop through all display devices for and call all read_socket_hook functions. Check ttys even if read_socket_hook returned an error.
src/sysdep.c (discard_tty_input): Ignore read_socket_hook.
(stuff_char): Don't do anything if the current frame is not on a termcap display.
(request_sigio, unrequest_sigio): Ignore read_socket_hook.
(init_sys_modes): Always call narrow_foreground_group. Set up terminal modes and sigio even under X.
src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window): Access display hooks through the frame pointer.
(echo_area_display): Don't be afraid of termcap frames during an X+tty combo session.
src/xfaces.c: Include termhooks.h.
(Ftty_supports_face_attributes_p): Use the given frame, not selected_frame.
src/xfns.c (x_set_scroll_bar_foreground, x_set_scroll_bar_background): Access display hooks through the frame pointer.
(Fx_create_frame, x_create_tip_frame): Initialize the frame's display structure.
src/xmenu.c: Include termhooks.h after frame.h.
src/xselect.c (x_own_selection, some_frame_on_display, x_get_foreign_selection)
(Fx_disown_selection_internal, Fx_get_cut_buffer_internal)
(Fx_store_cut_buffer_internal, Fx_rotate_cut_buffers_internal): Don't do anything
if the selected frame is not an X frame.
src/xterm.c (x_display_method): Removed.
(x_create_frame_display, x_delete_frame_display): New functions for handling struct display objects.
(x_term_init): Set up a new struct display object, too.
(x_delete_display): Delete the struct display corresponding to the X display.
(x_initialize): Moved hook initialization to x_create_frame_display.
src/xterm.h (x_display_method): Removed.
(struct x_display_info): Added frame_display component.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-44
2004-01-05 05:54:35 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
terminal->display_info.tty = tty;
|
|
|
|
|
tty->terminal = terminal;
|
Implemented multiple tty support.
README.multi-tty: New file.
src/termchar.h (struct terminal): Renamed to struct tty_output. Added name, type,
input, output, termscript, old_tty, term_initted, old_tty_valid,
background_pixel, foreground_pixel, next fields.
(TERMINAL_*): Renamed to TTY_* for brevity.
(CURRENT_TERMINAL): Renamed to CURTTY for brevity.
(tty_list): New variable.
(TERMINAL_PTR): Removed.
(FRAME_TTY): New function.
(TTY_NAME, TTY_TYPE): New macros.
src/term.c (current_terminal): Removed. (_current_terminal): Removed. (tty_list):
New variable. (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
parameter. (set_terminal_modes): Added tty parameter. (reset_terminal_modes):
Added tty parameter. (cursor_to, raw_cursor_to): Updated cmgoto() calls.
(clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
cmcheckmagic() calls. (get_named_tty): New function. (term_dummy_init): New
function. (term_init): Added name parameter, added tty_output return value.
Changed algorithm to update tty_list. Call init_sys_modes() to set up tty
mode on the newly opened terminal device.
(get_current_tty): New function, intended for debugging.
src/termhooks.h (termscript): Removed.
src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
definition.
src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
(current_tty): New variable, for cmputc().
(cmcheckmagic, cmputc, cmgoto): Added prototypes.
src/cm.c (current_tty): New variable, for cmputc().
(cmputc): Use it.
(cmcheckmagic): Added tty parameter, look up terminal streams there.
(calccost): Added tty parameter. Use emacs_tputs() instead of tputs().
(cmgoto): Added tty parameter. Pass it on to calccost(). Use emacs_tputs()
instead of tputs().
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
(term_init): Added name parameter (the filename of the terminal device). Added
return value (struct tty_output).
src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
(termscript): Moved to struct tty_output.
(terminal_type): Removed.
src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
during init_display().
(shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
src/frame.c (Qtty, Qtty_type): New variables.
(syms_of_frame): Initialize them.
(tty_display): Removed.
(make_terminal_frame): New parameters (tty filename and type).
Initialize output_data.tty field instead of output_data.x. Use term_init() to
find the right tty_output. (Use term_dummy_init() during bootstrap.)
(Fmake_terminal_frame): Get device filename and type from frame parameters.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
if the frame is a tty.
(struct frame): New member in output_data: tty.
(make_terminal_frame): Updated of prototype.
src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
reset_sys_modes(). Ditto with init_sys_modes().
src/lisp.h (tty_output): Added forward declaration.
(init_sys_modes, reset_sys_modes): Updated prototype.
(init_all_sys_modes, reset_all_sys_modes): New prototypes.
src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
(init_all_sys_modes): New function.
(init_sys_modes): Added tty_output parameter. Use it.
(reset_all_sys_modes): New function.
(reset_sys_modes): Added tty_output parameter. Use it.
src/Makefile.in: Update dependencies.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
2003-12-25 06:59:31 +00:00
|
|
|
|
|
More xmalloc and related cleanup.
* alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
* callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
* doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
* font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
* gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
* nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
* regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
* sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
* xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
* xterm.c:
Omit needless casts involving void * pointers and allocation.
Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
as the former is more robust if P's type is changed.
Prefer xzalloc to xmalloc + memset 0.
Simplify malloc-or-realloc to realloc.
Don't worry about xmalloc returning a null pointer.
Prefer xstrdup to xmalloc + strcpy.
* editfns.c (Fmessage_box): Grow message_text by at least 80 when
growing it.
* keyboard.c (apply_modifiers_uncached): Prefer local array to
alloca of a constant.
2012-07-05 18:35:48 +00:00
|
|
|
|
tty->Wcm = xmalloc (sizeof *tty->Wcm);
|
2004-01-02 02:54:17 +00:00
|
|
|
|
Wcm_clear (tty);
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
|
2010-09-26 15:06:21 +00:00
|
|
|
|
encode_terminal_src_size = 0;
|
|
|
|
|
encode_terminal_dst_size = 0;
|
|
|
|
|
|
2011-01-23 02:56:06 +00:00
|
|
|
|
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#ifndef DOS_NT
|
2006-05-20 12:00:16 +00:00
|
|
|
|
set_tty_hooks (terminal);
|
2007-09-22 12:41:29 +00:00
|
|
|
|
|
2006-03-26 16:05:17 +00:00
|
|
|
|
{
|
Assume POSIX 1003.1-1988 or later for fcntl.h.
* admin/CPP-DEFINES (O_RDONLY, O_RDWR, HAVE_FCNTL_H): Remove.
* admin/merge-gnulib (GNULIB_MODULES): Add fcntl-h.
* configure.ac: Do not check for fcntl.h.
* lib/gnulib.mk: Regenerate.
* lib-src/movemail.c, lib-src/update-game-score.c: Assume <fcntl.h> exists.
* nt/inc/sys/socket.h (O_NONBLOCK): Rename from O_NDELAY, since the
POSIX name for this flag is O_NONBLOCK. All uses changed.
* nt/inc/unistd.h (O_RDWR, O_NOCTTY): New macros. Like AT_FDCWD etc.
these really should be moved to a replacement <fcntl.h> if and
when that gets implemented. In the meantime, include <fcntl.h>
to make sure we don't override its definitions.
* src/callproc.c (relocate_fd): Assume F_DUPFD.
* src/emacs.c, src/term.c (O_RDWR): Remove.
* src/keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
O_NDELAY, since O_NONBLOCK is the standard name for this flag.
* src/nsterm.m: Assume <fcntl.h> exists.
* src/process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
(create_pty, Fmake_network_process, server_accept_connection)
(wait_reading_process_output, init_process_emacs):
Assume O_NONBLOCK.
(wait_reading_process_output): Put in a special case for WINDOWSNT
to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
It's not clear this is needed, but it's a more-conservative change.
(create_process): Assume FD_CLOEXEC.
(create_process, create_pty): Assume O_NOCTTY.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
(reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
Omit if not DOS_NT, since F_GETFL is not defined there.
(serial_open): Assume O_NONBLOCK and O_NOCTTY.
* src/term.c: Include <fcntl.h>, for flags like O_NOCTTY.
(O_NOCTTY): Remove.
(init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
lack it, since gnulib guarantees this.
* src/w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
Fixes: debbugs:12881
2012-11-17 22:12:47 +00:00
|
|
|
|
/* Open the terminal device. */
|
2004-02-02 22:09:56 +00:00
|
|
|
|
|
Assume POSIX 1003.1-1988 or later for fcntl.h.
* admin/CPP-DEFINES (O_RDONLY, O_RDWR, HAVE_FCNTL_H): Remove.
* admin/merge-gnulib (GNULIB_MODULES): Add fcntl-h.
* configure.ac: Do not check for fcntl.h.
* lib/gnulib.mk: Regenerate.
* lib-src/movemail.c, lib-src/update-game-score.c: Assume <fcntl.h> exists.
* nt/inc/sys/socket.h (O_NONBLOCK): Rename from O_NDELAY, since the
POSIX name for this flag is O_NONBLOCK. All uses changed.
* nt/inc/unistd.h (O_RDWR, O_NOCTTY): New macros. Like AT_FDCWD etc.
these really should be moved to a replacement <fcntl.h> if and
when that gets implemented. In the meantime, include <fcntl.h>
to make sure we don't override its definitions.
* src/callproc.c (relocate_fd): Assume F_DUPFD.
* src/emacs.c, src/term.c (O_RDWR): Remove.
* src/keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
O_NDELAY, since O_NONBLOCK is the standard name for this flag.
* src/nsterm.m: Assume <fcntl.h> exists.
* src/process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
(create_pty, Fmake_network_process, server_accept_connection)
(wait_reading_process_output, init_process_emacs):
Assume O_NONBLOCK.
(wait_reading_process_output): Put in a special case for WINDOWSNT
to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
It's not clear this is needed, but it's a more-conservative change.
(create_process): Assume FD_CLOEXEC.
(create_process, create_pty): Assume O_NOCTTY.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
(reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
Omit if not DOS_NT, since F_GETFL is not defined there.
(serial_open): Assume O_NONBLOCK and O_NOCTTY.
* src/term.c: Include <fcntl.h>, for flags like O_NOCTTY.
(O_NOCTTY): Remove.
(init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
lack it, since gnulib guarantees this.
* src/w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
Fixes: debbugs:12881
2012-11-17 22:12:47 +00:00
|
|
|
|
/* If !ctty, don't recognize it as our controlling terminal, and
|
|
|
|
|
don't make it the controlling tty if we don't have one now.
|
|
|
|
|
|
|
|
|
|
Alas, O_IGNORE_CTTY is a GNU extension that seems to be only
|
|
|
|
|
defined on Hurd. On other systems, we need to explicitly
|
|
|
|
|
dissociate ourselves from the controlling tty when we want to
|
|
|
|
|
open a frame on the same terminal. */
|
|
|
|
|
int flags = O_RDWR | O_NOCTTY | (ctty ? 0 : O_IGNORE_CTTY);
|
|
|
|
|
int fd = emacs_open (name, flags, 0);
|
2014-07-21 01:41:59 +00:00
|
|
|
|
tty->input = tty->output
|
|
|
|
|
= ((fd < 0 || ! isatty (fd))
|
|
|
|
|
? NULL
|
|
|
|
|
: fdopen (fd, "w+"));
|
2004-02-02 22:09:56 +00:00
|
|
|
|
|
2013-07-18 08:35:27 +00:00
|
|
|
|
if (! tty->input)
|
2006-03-26 16:05:17 +00:00
|
|
|
|
{
|
2013-07-18 08:35:27 +00:00
|
|
|
|
char const *diagnostic
|
2014-03-23 08:29:43 +00:00
|
|
|
|
= (fd < 0) ? "Could not open file: %s" : "Not a tty device: %s";
|
2013-07-18 08:35:27 +00:00
|
|
|
|
emacs_close (fd);
|
2018-09-21 15:15:10 +00:00
|
|
|
|
delete_terminal_internal (terminal);
|
2013-07-18 08:35:27 +00:00
|
|
|
|
maybe_fatal (must_succeed, terminal, diagnostic, diagnostic, name);
|
2006-03-26 16:05:17 +00:00
|
|
|
|
}
|
2004-02-02 22:09:56 +00:00
|
|
|
|
|
2013-07-18 08:35:27 +00:00
|
|
|
|
tty->name = xstrdup (name);
|
|
|
|
|
terminal->name = xstrdup (name);
|
|
|
|
|
|
Assume POSIX 1003.1-1988 or later for fcntl.h.
* admin/CPP-DEFINES (O_RDONLY, O_RDWR, HAVE_FCNTL_H): Remove.
* admin/merge-gnulib (GNULIB_MODULES): Add fcntl-h.
* configure.ac: Do not check for fcntl.h.
* lib/gnulib.mk: Regenerate.
* lib-src/movemail.c, lib-src/update-game-score.c: Assume <fcntl.h> exists.
* nt/inc/sys/socket.h (O_NONBLOCK): Rename from O_NDELAY, since the
POSIX name for this flag is O_NONBLOCK. All uses changed.
* nt/inc/unistd.h (O_RDWR, O_NOCTTY): New macros. Like AT_FDCWD etc.
these really should be moved to a replacement <fcntl.h> if and
when that gets implemented. In the meantime, include <fcntl.h>
to make sure we don't override its definitions.
* src/callproc.c (relocate_fd): Assume F_DUPFD.
* src/emacs.c, src/term.c (O_RDWR): Remove.
* src/keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
O_NDELAY, since O_NONBLOCK is the standard name for this flag.
* src/nsterm.m: Assume <fcntl.h> exists.
* src/process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
(create_pty, Fmake_network_process, server_accept_connection)
(wait_reading_process_output, init_process_emacs):
Assume O_NONBLOCK.
(wait_reading_process_output): Put in a special case for WINDOWSNT
to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
It's not clear this is needed, but it's a more-conservative change.
(create_process): Assume FD_CLOEXEC.
(create_process, create_pty): Assume O_NOCTTY.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
(reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
Omit if not DOS_NT, since F_GETFL is not defined there.
(serial_open): Assume O_NONBLOCK and O_NOCTTY.
* src/term.c: Include <fcntl.h>, for flags like O_NOCTTY.
(O_NOCTTY): Remove.
(init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
lack it, since gnulib guarantees this.
* src/w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
Fixes: debbugs:12881
2012-11-17 22:12:47 +00:00
|
|
|
|
if (!O_IGNORE_CTTY && !ctty)
|
2004-03-28 06:17:38 +00:00
|
|
|
|
dissociate_if_controlling_tty (fd);
|
2006-03-26 16:05:17 +00:00
|
|
|
|
}
|
2007-09-22 12:41:29 +00:00
|
|
|
|
|
Separate frame-local, tty-dependent parameters from tty-local parameters.
src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters. (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.
src/term.c: Update prototypes. Use tty_display_info instead of tty_output.
src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.
src/cm.h: Update prototypes.
src/dispextern.h: Ditto.
src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.
src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output. Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty. Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty. Use reference count to
decide if the tty should be closed.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.
src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.
src/lisp.h: Declare struct display. Update prototypes.
src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
2004-01-01 17:55:53 +00:00
|
|
|
|
tty->type = xstrdup (terminal_type);
|
Implemented multiple tty support.
README.multi-tty: New file.
src/termchar.h (struct terminal): Renamed to struct tty_output. Added name, type,
input, output, termscript, old_tty, term_initted, old_tty_valid,
background_pixel, foreground_pixel, next fields.
(TERMINAL_*): Renamed to TTY_* for brevity.
(CURRENT_TERMINAL): Renamed to CURTTY for brevity.
(tty_list): New variable.
(TERMINAL_PTR): Removed.
(FRAME_TTY): New function.
(TTY_NAME, TTY_TYPE): New macros.
src/term.c (current_terminal): Removed. (_current_terminal): Removed. (tty_list):
New variable. (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
parameter. (set_terminal_modes): Added tty parameter. (reset_terminal_modes):
Added tty parameter. (cursor_to, raw_cursor_to): Updated cmgoto() calls.
(clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
cmcheckmagic() calls. (get_named_tty): New function. (term_dummy_init): New
function. (term_init): Added name parameter, added tty_output return value.
Changed algorithm to update tty_list. Call init_sys_modes() to set up tty
mode on the newly opened terminal device.
(get_current_tty): New function, intended for debugging.
src/termhooks.h (termscript): Removed.
src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
definition.
src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
(current_tty): New variable, for cmputc().
(cmcheckmagic, cmputc, cmgoto): Added prototypes.
src/cm.c (current_tty): New variable, for cmputc().
(cmputc): Use it.
(cmcheckmagic): Added tty parameter, look up terminal streams there.
(calccost): Added tty parameter. Use emacs_tputs() instead of tputs().
(cmgoto): Added tty parameter. Pass it on to calccost(). Use emacs_tputs()
instead of tputs().
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
(term_init): Added name parameter (the filename of the terminal device). Added
return value (struct tty_output).
src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
(termscript): Moved to struct tty_output.
(terminal_type): Removed.
src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
during init_display().
(shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
src/frame.c (Qtty, Qtty_type): New variables.
(syms_of_frame): Initialize them.
(tty_display): Removed.
(make_terminal_frame): New parameters (tty filename and type).
Initialize output_data.tty field instead of output_data.x. Use term_init() to
find the right tty_output. (Use term_dummy_init() during bootstrap.)
(Fmake_terminal_frame): Get device filename and type from frame parameters.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
if the frame is a tty.
(struct frame): New member in output_data: tty.
(make_terminal_frame): Updated of prototype.
src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
reset_sys_modes(). Ditto with init_sys_modes().
src/lisp.h (tty_output): Added forward declaration.
(init_sys_modes, reset_sys_modes): Updated prototype.
(init_all_sys_modes, reset_all_sys_modes): New prototypes.
src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
(init_all_sys_modes): New function.
(init_sys_modes): Added tty_output parameter. Use it.
(reset_all_sys_modes): New function.
(reset_sys_modes): Added tty_output parameter. Use it.
src/Makefile.in: Update dependencies.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
2003-12-25 06:59:31 +00:00
|
|
|
|
|
A few more bugfixes and new features.
(Sigh.) I obviously need to remember to separate individual changes
to multiple commits.
src/emacsclient.c: Improved error handling.
(decode_options): Changed frame option (again) from -f to -t.
(print_help_and_exit): Ditto.
(copy_from_to): Check EINTR after write, not EAGAIN. Removed SIGIO hack.
(pty_conversation): Handle errors transmitted through the socket.
Handle pty errors by not reading from it anymore.
(main): Restore correct errno after socket_status failed. Send -tty
on -t, not -pty.
lisp/server.el (server-process-filter): Watch -tty, not -pty.
Use make-frame-on-tty instead of make-terminal-frame.
Don't set newframe to t if make-frame-on-tty failed.
Don't delete frames here. Print correct message when there are no
files to edit, but a new frame was requested.
(server-sentinel): Delete the frame after the process.
(server-handle-delete-frame): New function for delete-frame-functions.
(server-start): Add server-handle-delete-frame to delete-frame-functions.
(server-buffer-done): Don't delete frames here.
src/alloc.c (mark_ttys): Add prototype.
(Fgarbage_collect): Call mark_ttys.
src/emacs.c: (shut_down_emacs): Don't flush stdout before
reset_sys_modes().
src/process.c (add_keyboard_wait_descriptor_called_flag): Removed.
(add_keyboard_wait_descriptor): Removed stdin hack.
src/sysdep.c: Unconditionally include sysselect.h.
(old_fcntl_flags): Changed to an array.
(init_sigio, reset_sigio): Use it.
(narrow_foreground_group, widen_foreground_group): Use setpgid, not
setpgrp.
(old_fcntl_owner): Changed to an array.
(init_sys_modes, reset_sys_modes): Use it. Fix fsync() and reset_sigio() calls.
src/term.c (Qframe_tty_name, Qframe_tty_type): New variables.
(syms_of_term): Initialize them.
(Fframe_tty_name, Fframe_tty_type): New functions.
(term_init): Call add_keyboard_wait_descriptor().
(Fdelete_tty): New function.
(delete_tty): Call delete_keyboard_wait_descriptor().
(get_current_tty): Removed.
(mark_ttys): New function.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-28
2003-12-31 05:09:29 +00:00
|
|
|
|
add_keyboard_wait_descriptor (fileno (tty->input));
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
Wcm_clear (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2004-03-28 06:17:38 +00:00
|
|
|
|
/* On some systems, tgetent tries to access the controlling
|
2013-08-02 21:16:33 +00:00
|
|
|
|
terminal. */
|
Handle sigmask better with nested signal handlers.
* atimer.c (sigmask_atimers): Remove.
Remaining use rewritten to use body of this function.
* atimer.c (block_atimers, unblock_atimers):
* callproc.c (block_child_signal, unblock_child_signal):
* sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
New arg OLDSET. All callers changed.
* atimer.c (block_atimers, unblock_atimers):
* callproc.c (block_child_signal, unblock_child_signal):
* keyboard.c (handle_interrupt):
* sound.c (vox_configure, vox_close):
Restore the old signal mask rather than unilaterally clearing bits
from the mask, in case a handler is running within another
handler. All callers changed.
* lisp.h, process.c, process.h, term.c:
Adjust decls and callers to match new API.
* sysdep.c (emacs_sigaction_init): Don't worry about masking SIGFPE;
signal handlers aren't supposed to use floating point anyway.
(handle_arith_signal): Unblock just SIGFPE rather than clearing mask.
Fixes: debbugs:15561
2014-03-25 14:43:26 +00:00
|
|
|
|
block_tty_out_signal (&oldset);
|
2013-01-11 02:40:58 +00:00
|
|
|
|
status = tgetent (tty->termcap_term_buffer, terminal_type);
|
2013-08-26 18:10:30 +00:00
|
|
|
|
if (tty->termcap_term_buffer[TERMCAP_BUFFER_SIZE - 1])
|
|
|
|
|
emacs_abort ();
|
Handle sigmask better with nested signal handlers.
* atimer.c (sigmask_atimers): Remove.
Remaining use rewritten to use body of this function.
* atimer.c (block_atimers, unblock_atimers):
* callproc.c (block_child_signal, unblock_child_signal):
* sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
New arg OLDSET. All callers changed.
* atimer.c (block_atimers, unblock_atimers):
* callproc.c (block_child_signal, unblock_child_signal):
* keyboard.c (handle_interrupt):
* sound.c (vox_configure, vox_close):
Restore the old signal mask rather than unilaterally clearing bits
from the mask, in case a handler is running within another
handler. All callers changed.
* lisp.h, process.c, process.h, term.c:
Adjust decls and callers to match new API.
* sysdep.c (emacs_sigaction_init): Don't worry about masking SIGFPE;
signal handlers aren't supposed to use floating point anyway.
(handle_arith_signal): Unblock just SIGFPE rather than clearing mask.
Fixes: debbugs:15561
2014-03-25 14:43:26 +00:00
|
|
|
|
unblock_tty_out_signal (&oldset);
|
2007-09-22 12:41:29 +00:00
|
|
|
|
|
1991-05-09 10:29:44 +00:00
|
|
|
|
if (status < 0)
|
1995-02-25 04:05:46 +00:00
|
|
|
|
{
|
|
|
|
|
#ifdef TERMINFO
|
2008-12-08 14:44:30 +00:00
|
|
|
|
maybe_fatal (must_succeed, terminal,
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
"Cannot open terminfo database file",
|
|
|
|
|
"Cannot open terminfo database file");
|
1995-02-25 04:05:46 +00:00
|
|
|
|
#else
|
2008-12-08 14:44:30 +00:00
|
|
|
|
maybe_fatal (must_succeed, terminal,
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
"Cannot open termcap database file",
|
|
|
|
|
"Cannot open termcap database file");
|
1995-02-25 04:05:46 +00:00
|
|
|
|
#endif
|
|
|
|
|
}
|
1991-05-09 10:29:44 +00:00
|
|
|
|
if (status == 0)
|
1995-02-25 04:05:46 +00:00
|
|
|
|
{
|
2008-12-08 14:44:30 +00:00
|
|
|
|
maybe_fatal (must_succeed, terminal,
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
"Terminal type %s is not defined",
|
|
|
|
|
"Terminal type %s is not defined.\n\
|
1995-02-25 04:05:46 +00:00
|
|
|
|
If that is not the actual type of terminal you have,\n\
|
2015-06-01 06:52:09 +00:00
|
|
|
|
use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\
|
|
|
|
|
'setenv TERM ...') to specify the correct type. It may be necessary\n"
|
2010-04-13 02:19:17 +00:00
|
|
|
|
#ifdef TERMINFO
|
2015-06-01 06:52:09 +00:00
|
|
|
|
"to do 'unset TERMINFO' (C-shell: 'unsetenv TERMINFO') as well.",
|
1995-02-25 04:05:46 +00:00
|
|
|
|
#else
|
2015-06-01 06:52:09 +00:00
|
|
|
|
"to do 'unset TERMCAP' (C-shell: 'unsetenv TERMCAP') as well.",
|
1995-02-25 04:05:46 +00:00
|
|
|
|
#endif
|
2010-04-13 02:19:17 +00:00
|
|
|
|
terminal_type);
|
1995-02-25 04:05:46 +00:00
|
|
|
|
}
|
2004-04-16 12:51:06 +00:00
|
|
|
|
|
2013-08-26 18:10:30 +00:00
|
|
|
|
area = tty->termcap_strings_buffer;
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_ins_line = tgetstr ("al", address);
|
|
|
|
|
tty->TS_ins_multi_lines = tgetstr ("AL", address);
|
|
|
|
|
tty->TS_bell = tgetstr ("bl", address);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
BackTab (tty) = tgetstr ("bt", address);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_clr_to_bottom = tgetstr ("cd", address);
|
|
|
|
|
tty->TS_clr_line = tgetstr ("ce", address);
|
|
|
|
|
tty->TS_clr_frame = tgetstr ("cl", address);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
ColPosition (tty) = NULL; /* tgetstr ("ch", address); */
|
|
|
|
|
AbsPosition (tty) = tgetstr ("cm", address);
|
|
|
|
|
CR (tty) = tgetstr ("cr", address);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_set_scroll_region = tgetstr ("cs", address);
|
|
|
|
|
tty->TS_set_scroll_region_1 = tgetstr ("cS", address);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
RowPosition (tty) = tgetstr ("cv", address);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_del_char = tgetstr ("dc", address);
|
|
|
|
|
tty->TS_del_multi_chars = tgetstr ("DC", address);
|
|
|
|
|
tty->TS_del_line = tgetstr ("dl", address);
|
|
|
|
|
tty->TS_del_multi_lines = tgetstr ("DL", address);
|
|
|
|
|
tty->TS_delete_mode = tgetstr ("dm", address);
|
|
|
|
|
tty->TS_end_delete_mode = tgetstr ("ed", address);
|
|
|
|
|
tty->TS_end_insert_mode = tgetstr ("ei", address);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
Home (tty) = tgetstr ("ho", address);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_ins_char = tgetstr ("ic", address);
|
|
|
|
|
tty->TS_ins_multi_chars = tgetstr ("IC", address);
|
|
|
|
|
tty->TS_insert_mode = tgetstr ("im", address);
|
|
|
|
|
tty->TS_pad_inserted_char = tgetstr ("ip", address);
|
|
|
|
|
tty->TS_end_keypad_mode = tgetstr ("ke", address);
|
|
|
|
|
tty->TS_keypad_mode = tgetstr ("ks", address);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
LastLine (tty) = tgetstr ("ll", address);
|
|
|
|
|
Right (tty) = tgetstr ("nd", address);
|
|
|
|
|
Down (tty) = tgetstr ("do", address);
|
|
|
|
|
if (!Down (tty))
|
2013-08-02 21:16:33 +00:00
|
|
|
|
Down (tty) = tgetstr ("nl", address); /* Obsolete name for "do". */
|
1991-05-09 10:29:44 +00:00
|
|
|
|
if (tgetflag ("bs"))
|
2013-08-02 21:16:33 +00:00
|
|
|
|
Left (tty) = "\b"; /* Can't possibly be longer! */
|
|
|
|
|
else /* (Actually, "bs" is obsolete...) */
|
2003-12-27 01:12:57 +00:00
|
|
|
|
Left (tty) = tgetstr ("le", address);
|
|
|
|
|
if (!Left (tty))
|
2013-08-02 21:16:33 +00:00
|
|
|
|
Left (tty) = tgetstr ("bc", address); /* Obsolete name for "le". */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_pad_char = tgetstr ("pc", address);
|
|
|
|
|
tty->TS_repeat = tgetstr ("rp", address);
|
|
|
|
|
tty->TS_end_standout_mode = tgetstr ("se", address);
|
|
|
|
|
tty->TS_fwd_scroll = tgetstr ("sf", address);
|
|
|
|
|
tty->TS_standout_mode = tgetstr ("so", address);
|
|
|
|
|
tty->TS_rev_scroll = tgetstr ("sr", address);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
tty->Wcm->cm_tab = tgetstr ("ta", address);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_end_termcap_modes = tgetstr ("te", address);
|
|
|
|
|
tty->TS_termcap_modes = tgetstr ("ti", address);
|
2003-12-27 01:12:57 +00:00
|
|
|
|
Up (tty) = tgetstr ("up", address);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_visible_bell = tgetstr ("vb", address);
|
|
|
|
|
tty->TS_cursor_normal = tgetstr ("ve", address);
|
|
|
|
|
tty->TS_cursor_visible = tgetstr ("vs", address);
|
|
|
|
|
tty->TS_cursor_invisible = tgetstr ("vi", address);
|
|
|
|
|
tty->TS_set_window = tgetstr ("wi", address);
|
|
|
|
|
|
|
|
|
|
tty->TS_enter_underline_mode = tgetstr ("us", address);
|
|
|
|
|
tty->TS_exit_underline_mode = tgetstr ("ue", address);
|
|
|
|
|
tty->TS_enter_bold_mode = tgetstr ("md", address);
|
2012-06-09 16:44:44 +00:00
|
|
|
|
tty->TS_enter_italic_mode = tgetstr ("ZH", address);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_enter_dim_mode = tgetstr ("mh", address);
|
|
|
|
|
tty->TS_enter_reverse_mode = tgetstr ("mr", address);
|
|
|
|
|
tty->TS_enter_alt_charset_mode = tgetstr ("as", address);
|
|
|
|
|
tty->TS_exit_alt_charset_mode = tgetstr ("ae", address);
|
|
|
|
|
tty->TS_exit_attribute_mode = tgetstr ("me", address);
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
MultiUp (tty) = tgetstr ("UP", address);
|
|
|
|
|
MultiDown (tty) = tgetstr ("DO", address);
|
|
|
|
|
MultiLeft (tty) = tgetstr ("LE", address);
|
|
|
|
|
MultiRight (tty) = tgetstr ("RI", address);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2011-11-30 16:33:05 +00:00
|
|
|
|
/* SVr4/ANSI color support. If "op" isn't available, don't support
|
1999-11-12 14:35:43 +00:00
|
|
|
|
color because we can't switch back to the default foreground and
|
|
|
|
|
background. */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_orig_pair = tgetstr ("op", address);
|
|
|
|
|
if (tty->TS_orig_pair)
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_set_foreground = tgetstr ("AF", address);
|
|
|
|
|
tty->TS_set_background = tgetstr ("AB", address);
|
|
|
|
|
if (!tty->TS_set_foreground)
|
1999-11-12 14:35:43 +00:00
|
|
|
|
{
|
|
|
|
|
/* SVr4. */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_set_foreground = tgetstr ("Sf", address);
|
|
|
|
|
tty->TS_set_background = tgetstr ("Sb", address);
|
1999-11-12 14:35:43 +00:00
|
|
|
|
}
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TN_max_colors = tgetnum ("Co");
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
2017-02-18 11:04:55 +00:00
|
|
|
|
#ifdef TERMINFO
|
|
|
|
|
{
|
2017-02-19 02:16:37 +00:00
|
|
|
|
const char *fg = tigetstr ("setf24");
|
|
|
|
|
const char *bg = tigetstr ("setb24");
|
2018-02-10 11:31:22 +00:00
|
|
|
|
/* Non-standard support for 24-bit colors. */
|
2017-02-19 02:16:37 +00:00
|
|
|
|
if (fg && bg
|
|
|
|
|
&& fg != (char *) (intptr_t) -1
|
|
|
|
|
&& bg != (char *) (intptr_t) -1)
|
2017-02-18 11:04:55 +00:00
|
|
|
|
{
|
|
|
|
|
tty->TS_set_foreground = fg;
|
|
|
|
|
tty->TS_set_background = bg;
|
|
|
|
|
tty->TN_max_colors = 16777216;
|
|
|
|
|
}
|
2018-02-10 11:31:22 +00:00
|
|
|
|
/* Standard support for 24-bit colors. */
|
|
|
|
|
else if (tigetflag ("RGB") > 0)
|
|
|
|
|
{
|
|
|
|
|
/* If the used Terminfo library supports only 16-bit
|
|
|
|
|
signed values, tgetnum("Co") and tigetnum("colors")
|
|
|
|
|
could return 32767. */
|
|
|
|
|
tty->TN_max_colors = 16777216;
|
|
|
|
|
}
|
2017-02-18 11:04:55 +00:00
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TN_no_color_video = tgetnum ("NC");
|
|
|
|
|
if (tty->TN_no_color_video == -1)
|
|
|
|
|
tty->TN_no_color_video = 0;
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty_default_color_capabilities (tty, 1);
|
2002-01-14 13:45:36 +00:00
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
MagicWrap (tty) = tgetflag ("xn");
|
1995-04-24 17:17:15 +00:00
|
|
|
|
/* Since we make MagicWrap terminals look like AutoWrap, we need to have
|
|
|
|
|
the former flag imply the latter. */
|
2003-12-27 01:12:57 +00:00
|
|
|
|
AutoWrap (tty) = MagicWrap (tty) || tgetflag ("am");
|
2013-10-14 12:19:21 +00:00
|
|
|
|
tty->memory_below_frame = tgetflag ("db");
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TF_hazeltine = tgetflag ("hz");
|
2013-10-14 12:19:21 +00:00
|
|
|
|
tty->must_write_spaces = tgetflag ("in");
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->meta_key = tgetflag ("km") || tgetflag ("MT");
|
|
|
|
|
tty->TF_insmode_motion = tgetflag ("mi");
|
|
|
|
|
tty->TF_standout_motion = tgetflag ("ms");
|
|
|
|
|
tty->TF_underscore = tgetflag ("ul");
|
|
|
|
|
tty->TF_teleray = tgetflag ("xt");
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2010-09-26 15:06:21 +00:00
|
|
|
|
#else /* DOS_NT */
|
|
|
|
|
#ifdef WINDOWSNT
|
|
|
|
|
{
|
|
|
|
|
struct frame *f = XFRAME (selected_frame);
|
2013-06-03 19:28:13 +00:00
|
|
|
|
int height, width;
|
2010-09-26 15:06:21 +00:00
|
|
|
|
|
2013-06-03 19:28:13 +00:00
|
|
|
|
initialize_w32_display (terminal, &width, &height);
|
2010-09-26 15:06:21 +00:00
|
|
|
|
|
2013-06-03 19:28:13 +00:00
|
|
|
|
FrameRows (tty) = height;
|
|
|
|
|
FrameCols (tty) = width;
|
|
|
|
|
tty->specified_window = height;
|
2010-09-26 15:06:21 +00:00
|
|
|
|
|
|
|
|
|
FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
|
Complete pixelwise frame/window resizing, add horizontal scrollbar support.
* frame.el (frame-notice-user-settings): Rewrite using
frame-initial-frame-tool-bar-height.
* menu-bar.el (menu-bar-horizontal-scroll-bar)
(menu-bar-no-horizontal-scroll-bar): New functions.
(menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal
scroll bars.
* scroll-bar.el (scroll-bar-lines)
(set-horizontal-scroll-bar-mode)
(get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode)
(scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag)
(scroll-bar-toolkit-horizontal-scroll): New functions.
(horizontal-scroll-bar-mode)
(previous-horizontal-scroll-bar-mode)
(horizontal-scroll-bar-mode-explicit): New variables.
(horizontal-scroll-bar-mode): New option.
(toggle-horizontal-scroll-bar): Do something.
(top-level): Bind horizontal-scroll-bar mouse-1.
* startup.el (tool-bar-originally-present): Remove variable.
(command-line): Don't set tool-bar-originally-present.
* window.el (window-min-height): Update doc-string.
(window--dump-frame): Dump horizontal scroll bar values.
(window--min-size-1): Handle minibuffer window separately.
Count in margins and horizontal scroll bar. Return safe value
iff IGNORE equals 'safe.
(frame-windows-min-size): New function (used by frame resizing
routines).
(fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal
scroll bars.
(window--sanitize-window-sizes): New function.
(window-split-min-size): Remove.
(split-window): Count divider-width. Don't use
`window-split-min-size' any more. Reword error messages.
Sanitize windows sizes after splitting.
* buffer.h (struct buffer): New fields scroll_bar_height and
horizontal_scroll_bar_type.
* buffer.c (bset_scroll_bar_height)
(bset_horizontal_scroll_bar_type): New functions.
(Fbuffer_swap_text): Handle old_pointm field.
(init_buffer_once): Set defaults for scroll_bar_height and
horizontal_scroll_bar_type.
(syms_of_buffer): New variables scroll_bar_height and
horizontal_scroll_bar_type.
* dispextern.h (window_part): Rename ON_SCROLL_BAR to
ON_VERTICAL_SCROLL_BAR. Add ON_HORIZONTAL_SCROLL_BAR.
(set_vertical_scroll_bar): Remove prototype.
(x_change_tool_bar_height): Add prototype.
* dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
(window_to_frame_vpos, update_frame_1, scrolling, init_display):
Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS
and FRAME_LINES.
(adjust_frame_glyphs_for_window_redisplay): Rearrange lines.
(update_window): Start mode_line_row->y after horizontal scroll
bar.
(change_frame_size_1): Call adjust_frame_size.
(init_display): When changing the size of a tty frame do not
pass height of menu bar.
(Qframe_windows_min_size): New symbol.
* frame.h (struct frame): List tool bar fields after menu bar
fields. Add official, total_lines, horizontal_scroll_bars,
config_scroll_bar_height and config_scroll_bar_lines fields.
(FRAME_HAS_HORIZONTAL_SCROLL_BARS)
(FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES)
(FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS)
(FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES)
(FRAME_WINDOWS_HEIGHT): New macros.
(SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT)
(FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES)
(FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and
horizontal scroll bar.
(frame_inhibit_resize, adjust_frame_size)
(frame_windows_min_size): Add declarations.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(x_set_scroll_bar_default_height, x_set_left_fringe)
(x_set_right_fringe, x_set_vertical_scroll_bars)
(x_set_horizontal_scroll_bars, x_set_scroll_bar_width)
(x_set_scroll_bar_height): Add external declarations.
* frame.c: (frame_inhibit_resize, frame_windows_min_size)
(adjust_frame_size): New functions.
(make_frame): Initial horizontal_scroll_bars field. Use
SET_FRAME_LINES. Don't allow horizontal scroll bar in
minibuffer window.
(make_initial_frame, make_terminal_frame): No horizontal scroll
bar in initial and terminal frames. Use adjust_frame_size.
(Fframe_total_cols): Fix doc-string.
(Fframe_total_lines, Fscroll_bar_height): New Lisp functions.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite
using adjust_frame_size.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(Qframe_windows_min_size): New symbols.
(x_set_frame_parameters): Remove call of check_frame_size.
(x_report_frame_params): Return scroll_bar_height value.
(x_set_left_fringe, x_set_right_fringe): New functions.
(adjust_frame_height, x_set_internal_border_width)
(x_set_fringe_width): Remove.
(x_set_internal_border_width, x_set_vertical_scroll_bars)
(x_set_scroll_bar_width, x_set_right_divider_width)
(x_set_bottom_divider_width): Rewrite using adjust_frame_size.
(x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New
functions.
(x_figure_window_size): Rewrite to make frame display the
expected number of lines.
(Vdefault_frame_scroll_bars): Rewrite doc-string.
(Vdefault_frame_horizontal_scroll_bars)
(Vframe_initial_frame_tool_bar_height)
(frame_inhibit_implied_resize): New variables.
* fringe.c (compute_fringe_widths): Remove.
* gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define.
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb)
(xg_get_default_scrollbar_height)
(xg_clear_under_internal_border): Extern.
* gtkutil.c (xg_frame_resized): Don't call
do_pending_window_change.
(xg_frame_set_char_size): Use adjust_frame_size.
(style_changed_cb): Call update_theme_scrollbar_height and
x_set_scroll_bar_default_height.
(x_wm_set_size_hint): Don't call check_frame_size.
(update_theme_scrollbar_height)
(xg_get_default_scrollbar_height)
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb): New functions.
(xg_create_scroll_bar): Set horizontal slot of bar.
(xg_initialize): Call update_theme_scrollbar_height.
(xg_clear_under_internal_border): No more static.
* insdel.c (adjust_suspend_auto_hscroll): New function.
(adjust_markers_for_delete, adjust_markers_for_insert)
(adjust_markers_for_replace): Call adjust_suspend_auto_hscroll.
* keyboard.c (readable_events, discard_mouse_events)
(make_lispy_event): Handle horizontal scroll bar click events.
(Fsuspend_emacs): When changing the size of a tty frame do not
pass height of menu bar.
(Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft)
(Qright, Qleftmost, Qrightmost): New symbols.
* menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of
FRAME_LINES.
* minibuf.c (read_minibuf): Initialize suspend_auto_hscroll.
* nsfns.m (x_set_internal_border_width): New function.
* nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar):
Remove extended fringe code.
(x_set_window_size, x_new_font): Don't call
compute_fringe_widths.
* term.c (Fresume_tty): When changing the size of a tty frame do
not pass height of menu bar.
(clear_tty_hooks, set_tty_hooks): Clear
horizontal_scroll_bar_hook.
(init_tty): Frame has no horizontal scroll bars.
* termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio,
scroll_bar_before_handle, scroll_bar_horizontal_handle,
scroll_bar_after_handle, scroll_bar_left_arrow,
scroll_bar_right_arrow, scroll_bar_to_leftmost and
scroll_bar_to_rightmost entries.
(enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT
(struct terminal): Add set_horizontal_scroll_bar_hook.
* w32console.c (initialize_w32_display): Clear
horizontal_scroll_bar_hook.
* w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of
FRAME_X_DISPLAY.
(x_clear_under_internal_border, x_set_internal_border_width):
New functions.
(x_set_menu_bar_lines): Rewrite using frame_inhibit_resize. Set
windows_or_buffers_changed when adding the menu bar.
(x_set_tool_bar_lines): Rewrite using adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(w32_createhscrollbar): New functions.
(w32_createscrollbar): Rename to w32_createvscrollbar.
(w32_createwindow): Init WND_HSCROLLBAR_INDEX.
(w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by
WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR. Add
WM_EMACS_SHOWCURSOR.
(w32_wnd_proc): Handle WM_HSCROLL case. In WM_WINDOWPOSCHANGING
case do not artificially impose WM size hints. Handle
WM_EMACS_SHOWCURSOR case. Replace WM_EMACS_CREATESCROLLBAR case
by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR
cases.
(my_create_tip_window): Replace WND_SCROLLBAR_INDEX by
WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Make both scrollbars the system standard
width and height. Use official field of frame structure to
inhibit running window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(w32_frame_parm_handlers): Remove x_set_fringe_width
entries. Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe and
x_set_right_fringe.
* w32inevt.c (resize_event, maybe_generate_resize_event): Do not
pass height of menu bar to change_frame_size.
* w32menu.c (set_frame_menubar): Rewrite using
frame_inhibit_resize.
* w32term.h (struct w32_display_info): Add
horizontal_scroll_bar_cursor and cursor_display_counter.
(struct scroll_bar): Add horizontal.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH)
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros.
(WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define
instead of WM_EMACS_CREATESCROLLBAR.
(WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of
WND_SCROLLBAR_INDEX.
* w32term.c (horizontal_scroll_bar_min_handle)
(horizontal_scroll_bar_left_border)
(horizontal_scroll_bar_right_border): New integers.
(x_set_frame_alpha): Replace x_highlight_frame by
w32_focus_frame.
(x_window_to_scroll_bar): New argument "type". Update callers
accordingly.
(w32_set_horizontal_scroll_bar_thumb)
(x_horizontal_scroll_bar_report_motion)
(w32_set_horizontal_scroll_bar)
(w32_horizontal_scroll_bar_handle_click)
(x_horizontal_scroll_bar_report_motion): New functions.
(w32_mouse_position): Discriminate horizontal and vertical
scrollbar cases.
(my_create_scrollbar): Replace with two new functions
my_create_vscrollbar and my_create_hscrollbar.
(x_scroll_bar_create): New argument "horizontal". Update
callers accordingly.
(x_scroll_bar_remove, w32_condemn_scroll_bars)
(w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal
scroll bar case.
(w32_read_socket): Handle WM_HSCROLL cae.
(x_new_font): Don't recompute fringe widths. Use
frame_inhibit_resize. Calculate new menu bar height iff we
build without toolkit. Always clear under internal border.
(x_set_window_size): Don't check frame size or recompute
fringes. Reset fullscreen status before applying sizes. Always
resize as requested by pixelwise argument. Don't call
do_pending_window_change.
(x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT.
(w32_initialize_display_info): Initialize dpyinfo's
horizontal_scroll_bar_cursor entry.
(w32_create_terminal): Add set_horizontal_scroll_bar_hook.
(w32_initialize): Init horizontal_scroll_bar_min_handle and
horizontal_scroll_bar_left_border.
(w32fullscreen_hook): Intermittently resize window to normal
when switching from fullscreen to maximized state.
(run_window_configuration_change_hook): Don't run it if frame is
not official yet.
(unwind_change_frame): Remove.
(Fset_window_configuration): Rewrite using frame's official field.
* widget.c (set_frame_size): Don't call compute_fringe_widths.
(EmacsFrameSetCharSize): Obey frame_inhibit_resize.
* window.h (struct window): New fields old_pointm,
horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole,
scroll_bar_height and suspend_auto_hscroll.
(wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type):
New functions.
(sanitize_window_sizes): Extern.
(MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P)
(WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR)
(WINDOW_CONFIG_SCROLL_BAR_HEIGHT)
(WINDOW_CONFIG_SCROLL_BAR_LINES)
(WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New
macros.
(WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
(WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros.
(WINDOW_VERTICAL_SCROLL_BAR_TYPE)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite.
(WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT)
(WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height.
* window.c (wset_old_pointm, Fwindow_scroll_bar_height)
(Fwindow_old_point, sanitize_window_sizes): New functions.
(Qwindow_sanitize_window_sizes): New symbol.
(window_body_height): Count in horizontal scroll bar.
(set_window_hscroll, Fscroll_left, Fscroll_right): Set
suspend_auto_hscroll slot.
(Fwindow_inside_edges): Count fringes pixelwise.
(coordinates_in_window, Fcoordinates_in_window_p): Consider
horizontal scroll bar.
(check_frame_size, adjust_window_margins): Remove functions and
corresponding calls.
(set_window_buffer): Initialize old_pointm and horizontal scroll
bars.
(temp_output_buffer_show): Reset hscroll related fields.
Initialize old_pointm.
(make_parent_window): Initialize old_pointm.
(make_window): Initialize old_pointm, horizontal scroll bar type,
and scroll bar height.
(resize_frame_windows): Don't count top margin in new sizes.
Don't use safe sizes when shrinking a frame; let the window
manager do the clipping.
(Fsplit_window_internal): Inherit horizontal scroll bar type and
height.
(Fdelete_window_internal): Unchain old_pointm marker.
(window_scroll_pixel_based, Fscroll_other_window): Adjust
old_pointm.
(Fwindow_text_width, Fwindow_text_height): New argument
"pixelwise".
(struct saved_window): New fields, old_pointm, hscroll_whole,
suspend_auto_hscroll, scroll_bar_height and
horizontal_scroll_bar_type.
(Fset_window_configuration, save_window_save): Set new fields of
saved_window.
(apply_window_adjustment): Don't call adjust_window_margins.
(set_window_margins): Don't change margins if new sizes don't
fit into window.
(set_window_scroll_bars): New argument "horizontal_type".
Handle horizontal scroll bars. Don't change scroll bars if they
don't fit into window.
(Fset_window_scroll_bars): New argument "horizontal_type".
(Fwindow_scroll_bars): Return values for horizontal scroll bars.
(compare_window_configurations): Compare horizontal scroll bar
settings.
* xdisp.c (window_text_bottom_y, window_box_height): Count in
horizontal scroll bar height.
(pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES
instead of FRAME_LINES.
(remember_mouse_glyph): Case ON_SCROLL_BAR changed to
ON_VERTICAL_SCROLL_BAR.
(with_echo_area_buffer): Initialize old_pointm.
(with_echo_area_buffer_unwind_data): Store old_pointm values in
vector.
(unwind_with_echo_area_buffer): Handle old_pointm.
(update_tool_bar): Set do_update when the tool bar window has at
least one line (since this is what the user sets).
(MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro.
(redisplay_tool_bar): Return early when toolbar has zero lines.
Call x_change_tool_bar_height. Don't use max_tool_bar_height.
(hscroll_window_tree): Handle suspension of auto_hscroll and
old_pointm.
(set_horizontal_scroll_bar): New function.
(redisplay_window): Set ignore_mouse_drag_p when tool bar has
more than one line. Handle horizontal scroll bars.
(note_mouse_highlight): Handle horizontal scrol bars.
(expose_frame): Set dimensions of XRectangle from frame's text
sizes.
(Vvoid_text_area_pointer): Update doc-string.
* xfns.c (x_set_menu_bar_lines): Use adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(x_set_internal_border_width): New functions.
(x_set_tool_bar_lines): Call x_change_tool_bar_height.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Handle horizontal scroll bars. Use official
field of frame structure to inhibit running
window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(x_frame_parm_handlers): Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe,
x_set_right_fringe.
* xmenu.c (update_frame_menubar, free_frame_menubar): Use
adjust_frame_size.
* xterm.h (struct x_display_info): Add
horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar
slots.
(struct scroll_bar): Add horizontal slot.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros.
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define.
(x_clear_under_internal_border): Remove.
* xterm.c (XTmouse_position): Handle horizontal scroll bars.
(x_window_to_scroll_bar): New argument TYPE. Update callers.
(x_send_scroll_bar_event, x_scroll_bar_create): New arguments
HORIZONTAL. Update callers.
(horizontal_action_hook_id): New action hook id.
(x_horizontal_scroll_bar_to_input_event)
(x_create_horizontal_toolkit_scroll_bar)
(xt_horizontal_action_hook)
(x_set_toolkit_horizontal_scroll_bar_thumb)
(XTset_horizontal_scroll_bar, x_net_wm_state)
(x_horizontal_scroll_bar_report_motion): New functions.
(xg_scroll_callback, x_scroll_bar_handle_click): Handle
horizontal scroll bars.
(SCROLL_BAR_HORIZONTAL_NAME): Define.
(XTset_vertical_scroll_bar): Attempt to clear areas not covered
by scroll bar.
(XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite. Handle
horizontal scroll bars.
(handle_one_xevent): Handle horizontal scroll bar events. Call
x_net_wm_state.
(x_set_window_size_1, x_wm_set_size_hint): Don't call
check_frame_size.
(x_set_window_size): Don't call check_frame_size and
do_pending_window_change.
(x_term_init): Init horizontal_scroll_bar_cursor display info.
(x_create_terminal): Add set_horizontal_scroll_bar_hook.
(x_scroll_bar_set_handle): Add some checks when calling
x_clear_area.
2014-07-27 13:21:30 +00:00
|
|
|
|
FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) = 0;
|
2013-10-14 12:19:21 +00:00
|
|
|
|
tty->char_ins_del_ok = 1;
|
2010-09-26 15:06:21 +00:00
|
|
|
|
baud_rate = 19200;
|
|
|
|
|
}
|
|
|
|
|
#else /* MSDOS */
|
|
|
|
|
{
|
|
|
|
|
int height, width;
|
|
|
|
|
if (strcmp (terminal_type, "internal") == 0)
|
|
|
|
|
terminal->type = output_msdos_raw;
|
|
|
|
|
initialize_msdos_display (terminal);
|
|
|
|
|
|
|
|
|
|
get_tty_size (fileno (tty->input), &width, &height);
|
|
|
|
|
FrameCols (tty) = width;
|
|
|
|
|
FrameRows (tty) = height;
|
2013-10-14 12:19:21 +00:00
|
|
|
|
tty->char_ins_del_ok = 0;
|
2010-09-26 15:06:21 +00:00
|
|
|
|
init_baud_rate (fileno (tty->input));
|
|
|
|
|
}
|
|
|
|
|
#endif /* MSDOS */
|
|
|
|
|
tty->output = stdout;
|
|
|
|
|
tty->input = stdin;
|
|
|
|
|
/* The following two are inaccessible from w32console.c. */
|
|
|
|
|
terminal->delete_frame_hook = &tty_free_frame_resources;
|
|
|
|
|
terminal->delete_terminal_hook = &delete_tty;
|
|
|
|
|
|
|
|
|
|
tty->name = xstrdup (name);
|
|
|
|
|
terminal->name = xstrdup (name);
|
|
|
|
|
tty->type = xstrdup (terminal_type);
|
|
|
|
|
|
|
|
|
|
add_keyboard_wait_descriptor (0);
|
|
|
|
|
|
|
|
|
|
tty->delete_in_insert_mode = 1;
|
|
|
|
|
|
|
|
|
|
UseTabs (tty) = 0;
|
2013-10-14 12:19:21 +00:00
|
|
|
|
tty->scroll_region_ok = 0;
|
2010-09-26 15:06:21 +00:00
|
|
|
|
|
|
|
|
|
/* Seems to insert lines when it's not supposed to, messing up the
|
|
|
|
|
display. In doing a trace, it didn't seem to be called much, so I
|
|
|
|
|
don't think we're losing anything by turning it off. */
|
2013-10-14 12:19:21 +00:00
|
|
|
|
tty->line_ins_del_ok = 0;
|
2010-09-26 15:06:21 +00:00
|
|
|
|
|
2013-08-02 21:16:33 +00:00
|
|
|
|
tty->TN_max_colors = 16; /* Must be non-zero for tty-display-color-p. */
|
2010-09-26 15:06:21 +00:00
|
|
|
|
#endif /* DOS_NT */
|
|
|
|
|
|
2011-08-28 20:45:55 +00:00
|
|
|
|
#ifdef HAVE_GPM
|
|
|
|
|
terminal->mouse_position_hook = term_mouse_position;
|
|
|
|
|
tty->mouse_highlight.mouse_face_window = Qnil;
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-10-10 06:48:42 +00:00
|
|
|
|
terminal->kboard = allocate_kboard (Qnil);
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
terminal->kboard->reference_count++;
|
2005-06-26 03:20:47 +00:00
|
|
|
|
/* Don't let the initial kboard remain current longer than necessary.
|
|
|
|
|
That would cause problems if a file loaded on startup tries to
|
|
|
|
|
prompt in the mini-buffer. */
|
|
|
|
|
if (current_kboard == initial_kboard)
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
current_kboard = terminal->kboard;
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#ifndef DOS_NT
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
term_get_fkeys (address, terminal->kboard);
|
1992-02-04 02:27:43 +00:00
|
|
|
|
|
1992-07-13 20:53:59 +00:00
|
|
|
|
/* Get frame size from system, or else from termcap. */
|
1996-09-03 22:00:27 +00:00
|
|
|
|
{
|
|
|
|
|
int height, width;
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
get_tty_size (fileno (tty->input), &width, &height);
|
Bugfix festival.
lib-src/emacsclient.c (main_argc, main_argv): New variables.
(main): Initialize them.
(fail): Use them.
(window_change, copy_from_to): Don't kill if emacs_pid is zero.
(pty_conversation): Watch the command socket, too. Read emacs_pid
here. Emacs and emacsclient could deadlock if Emacs tried to do a
reset_sys_modes before sending its pid.
lisp/server.el: Automatically delete the client frame when done editing.
(server-frames): New variable.
(server-process-filter, server-sentinel, server-buffer-done): Use it.
(server-process-filter): Do a redisplay before evaluating other
parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from
messing up the system.
src/dispextern.h: Update prototypes.
src/dispnew.c (window_change_signal): Do nothing if !term_initted.
(init_display): Set the frame size from the tty data after term_init.
src/emacs.c (main): Make sure things that init_sys_modes needs are
initialized before init_display (which calls init_sys_modes now).
(sort_args): Use xfree, not free.
(shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
instead of reset_sys_modes.
src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
back to the middle of frame setup. Handle errors by making sure that
the delete_tty() called from term_init() will see and delete this
frame.
(Fdelete_frame): Kill the frame before calling delete_tty(). Fix
condition for tty deletion.
src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
terminal only.
src/lisp.h: Remove duplicate prototypes.
src/msdos.c (croak): use reset_all_sys_modes().
src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
(child_setup_tty): Reset sigio on stdin, not CURTTY().
(reset_sigio): Added fd parameter, put explicit fcntl there.
(request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
SIGIO signal, don't touch the file params. There are multiple ttys
now, and we can't disable the SIGIO from emacsclient.
(get_tty_size)[VMS]: Use tty_out instead of CURTTY().
(reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
cmgoto and tty_clear_end_of_line instead. The frame may already be
dead. Updated reset_sigio call.
src/term.c (clear_and_of_line): Separate tty-dependent stuff to
tty_clear_end_of_line() for reset_sys_modes.
(tty_clear_end_of_line): New function.
(term_init): Added frame parameter, don't use selected_frame.
Set the frame's output_data.tty value (in case there is an error
later). Set the frame size in Wcm, not in the frame. Only free the
termcap buffer if there is a termcap-related error. Call
init_sys_modes last, not first.
(deleting_tty): New variable.
(delete_tty): Use it for handling recursive calls. Free deleted tty,
except its Wcm (there is still a dangling reference somewhere).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
2003-12-29 07:16:26 +00:00
|
|
|
|
FrameCols (tty) = width;
|
|
|
|
|
FrameRows (tty) = height;
|
1996-09-03 22:00:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
Bugfix festival.
lib-src/emacsclient.c (main_argc, main_argv): New variables.
(main): Initialize them.
(fail): Use them.
(window_change, copy_from_to): Don't kill if emacs_pid is zero.
(pty_conversation): Watch the command socket, too. Read emacs_pid
here. Emacs and emacsclient could deadlock if Emacs tried to do a
reset_sys_modes before sending its pid.
lisp/server.el: Automatically delete the client frame when done editing.
(server-frames): New variable.
(server-process-filter, server-sentinel, server-buffer-done): Use it.
(server-process-filter): Do a redisplay before evaluating other
parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from
messing up the system.
src/dispextern.h: Update prototypes.
src/dispnew.c (window_change_signal): Do nothing if !term_initted.
(init_display): Set the frame size from the tty data after term_init.
src/emacs.c (main): Make sure things that init_sys_modes needs are
initialized before init_display (which calls init_sys_modes now).
(sort_args): Use xfree, not free.
(shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
instead of reset_sys_modes.
src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
back to the middle of frame setup. Handle errors by making sure that
the delete_tty() called from term_init() will see and delete this
frame.
(Fdelete_frame): Kill the frame before calling delete_tty(). Fix
condition for tty deletion.
src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
terminal only.
src/lisp.h: Remove duplicate prototypes.
src/msdos.c (croak): use reset_all_sys_modes().
src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
(child_setup_tty): Reset sigio on stdin, not CURTTY().
(reset_sigio): Added fd parameter, put explicit fcntl there.
(request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
SIGIO signal, don't touch the file params. There are multiple ttys
now, and we can't disable the SIGIO from emacsclient.
(get_tty_size)[VMS]: Use tty_out instead of CURTTY().
(reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
cmgoto and tty_clear_end_of_line instead. The frame may already be
dead. Updated reset_sigio call.
src/term.c (clear_and_of_line): Separate tty-dependent stuff to
tty_clear_end_of_line() for reset_sys_modes.
(tty_clear_end_of_line): New function.
(term_init): Added frame parameter, don't use selected_frame.
Set the frame's output_data.tty value (in case there is an error
later). Set the frame size in Wcm, not in the frame. Only free the
termcap buffer if there is a termcap-related error. Call
init_sys_modes last, not first.
(deleting_tty): New variable.
(delete_tty): Use it for handling recursive calls. Free deleted tty,
except its Wcm (there is still a dangling reference somewhere).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
2003-12-29 07:16:26 +00:00
|
|
|
|
if (FrameCols (tty) <= 0)
|
|
|
|
|
FrameCols (tty) = tgetnum ("co");
|
|
|
|
|
if (FrameRows (tty) <= 0)
|
|
|
|
|
FrameRows (tty) = tgetnum ("li");
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
Bugfix festival.
lib-src/emacsclient.c (main_argc, main_argv): New variables.
(main): Initialize them.
(fail): Use them.
(window_change, copy_from_to): Don't kill if emacs_pid is zero.
(pty_conversation): Watch the command socket, too. Read emacs_pid
here. Emacs and emacsclient could deadlock if Emacs tried to do a
reset_sys_modes before sending its pid.
lisp/server.el: Automatically delete the client frame when done editing.
(server-frames): New variable.
(server-process-filter, server-sentinel, server-buffer-done): Use it.
(server-process-filter): Do a redisplay before evaluating other
parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from
messing up the system.
src/dispextern.h: Update prototypes.
src/dispnew.c (window_change_signal): Do nothing if !term_initted.
(init_display): Set the frame size from the tty data after term_init.
src/emacs.c (main): Make sure things that init_sys_modes needs are
initialized before init_display (which calls init_sys_modes now).
(sort_args): Use xfree, not free.
(shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
instead of reset_sys_modes.
src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
back to the middle of frame setup. Handle errors by making sure that
the delete_tty() called from term_init() will see and delete this
frame.
(Fdelete_frame): Kill the frame before calling delete_tty(). Fix
condition for tty deletion.
src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
terminal only.
src/lisp.h: Remove duplicate prototypes.
src/msdos.c (croak): use reset_all_sys_modes().
src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
(child_setup_tty): Reset sigio on stdin, not CURTTY().
(reset_sigio): Added fd parameter, put explicit fcntl there.
(request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
SIGIO signal, don't touch the file params. There are multiple ttys
now, and we can't disable the SIGIO from emacsclient.
(get_tty_size)[VMS]: Use tty_out instead of CURTTY().
(reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
cmgoto and tty_clear_end_of_line instead. The frame may already be
dead. Updated reset_sigio call.
src/term.c (clear_and_of_line): Separate tty-dependent stuff to
tty_clear_end_of_line() for reset_sys_modes.
(tty_clear_end_of_line): New function.
(term_init): Added frame parameter, don't use selected_frame.
Set the frame's output_data.tty value (in case there is an error
later). Set the frame size in Wcm, not in the frame. Only free the
termcap buffer if there is a termcap-related error. Call
init_sys_modes last, not first.
(deleting_tty): New variable.
(delete_tty): Use it for handling recursive calls. Free deleted tty,
except its Wcm (there is still a dangling reference somewhere).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
2003-12-29 07:16:26 +00:00
|
|
|
|
if (FrameRows (tty) < 3 || FrameCols (tty) < 3)
|
2008-12-08 14:44:30 +00:00
|
|
|
|
maybe_fatal (must_succeed, terminal,
|
2010-07-13 04:47:45 +00:00
|
|
|
|
"Screen size %dx%d is too small",
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
"Screen size %dx%d is too small",
|
Bugfix festival.
lib-src/emacsclient.c (main_argc, main_argv): New variables.
(main): Initialize them.
(fail): Use them.
(window_change, copy_from_to): Don't kill if emacs_pid is zero.
(pty_conversation): Watch the command socket, too. Read emacs_pid
here. Emacs and emacsclient could deadlock if Emacs tried to do a
reset_sys_modes before sending its pid.
lisp/server.el: Automatically delete the client frame when done editing.
(server-frames): New variable.
(server-process-filter, server-sentinel, server-buffer-done): Use it.
(server-process-filter): Do a redisplay before evaluating other
parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from
messing up the system.
src/dispextern.h: Update prototypes.
src/dispnew.c (window_change_signal): Do nothing if !term_initted.
(init_display): Set the frame size from the tty data after term_init.
src/emacs.c (main): Make sure things that init_sys_modes needs are
initialized before init_display (which calls init_sys_modes now).
(sort_args): Use xfree, not free.
(shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
instead of reset_sys_modes.
src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
back to the middle of frame setup. Handle errors by making sure that
the delete_tty() called from term_init() will see and delete this
frame.
(Fdelete_frame): Kill the frame before calling delete_tty(). Fix
condition for tty deletion.
src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
terminal only.
src/lisp.h: Remove duplicate prototypes.
src/msdos.c (croak): use reset_all_sys_modes().
src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
(child_setup_tty): Reset sigio on stdin, not CURTTY().
(reset_sigio): Added fd parameter, put explicit fcntl there.
(request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
SIGIO signal, don't touch the file params. There are multiple ttys
now, and we can't disable the SIGIO from emacsclient.
(get_tty_size)[VMS]: Use tty_out instead of CURTTY().
(reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
cmgoto and tty_clear_end_of_line instead. The frame may already be
dead. Updated reset_sigio call.
src/term.c (clear_and_of_line): Separate tty-dependent stuff to
tty_clear_end_of_line() for reset_sys_modes.
(tty_clear_end_of_line): New function.
(term_init): Added frame parameter, don't use selected_frame.
Set the frame's output_data.tty value (in case there is an error
later). Set the frame size in Wcm, not in the frame. Only free the
termcap buffer if there is a termcap-related error. Call
init_sys_modes last, not first.
(deleting_tty): New variable.
(delete_tty): Use it for handling recursive calls. Free deleted tty,
except its Wcm (there is still a dangling reference somewhere).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
2003-12-29 07:16:26 +00:00
|
|
|
|
FrameCols (tty), FrameRows (tty));
|
1995-01-04 19:09:36 +00:00
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
TabWidth (tty) = tgetnum ("tw");
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (!tty->TS_bell)
|
|
|
|
|
tty->TS_bell = "\07";
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (!tty->TS_fwd_scroll)
|
|
|
|
|
tty->TS_fwd_scroll = Down (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
PC = tty->TS_pad_char ? *tty->TS_pad_char : 0;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2003-12-27 01:12:57 +00:00
|
|
|
|
if (TabWidth (tty) < 0)
|
|
|
|
|
TabWidth (tty) = 8;
|
2003-02-04 14:56:31 +00:00
|
|
|
|
|
1991-05-09 10:29:44 +00:00
|
|
|
|
/* Turned off since /etc/termcap seems to have :ta= for most terminals
|
|
|
|
|
and newer termcap doc does not seem to say there is a default.
|
2003-12-27 01:12:57 +00:00
|
|
|
|
if (!tty->Wcm->cm_tab)
|
|
|
|
|
tty->Wcm->cm_tab = "\t";
|
1991-05-09 10:29:44 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2001-10-20 10:33:48 +00:00
|
|
|
|
/* We don't support standout modes that use `magic cookies', so
|
|
|
|
|
turn off any that do. */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_standout_mode && tgetnum ("sg") >= 0)
|
2001-10-20 10:33:48 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_standout_mode = 0;
|
|
|
|
|
tty->TS_end_standout_mode = 0;
|
2001-10-20 10:33:48 +00:00
|
|
|
|
}
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_enter_underline_mode && tgetnum ("ug") >= 0)
|
2001-10-20 10:33:48 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_enter_underline_mode = 0;
|
|
|
|
|
tty->TS_exit_underline_mode = 0;
|
2001-10-20 10:33:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If there's no standout mode, try to use underlining instead. */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_standout_mode == 0)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_standout_mode = tty->TS_enter_underline_mode;
|
|
|
|
|
tty->TS_end_standout_mode = tty->TS_exit_underline_mode;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
1994-02-12 22:32:39 +00:00
|
|
|
|
/* If no `se' string, try using a `me' string instead.
|
|
|
|
|
If that fails, we can't use standout mode at all. */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TS_end_standout_mode == 0)
|
1994-02-12 22:32:39 +00:00
|
|
|
|
{
|
1994-08-24 19:51:01 +00:00
|
|
|
|
char *s = tgetstr ("me", address);
|
1994-02-12 22:32:39 +00:00
|
|
|
|
if (s != 0)
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_end_standout_mode = s;
|
1994-02-12 22:32:39 +00:00
|
|
|
|
else
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_standout_mode = 0;
|
1994-02-12 22:32:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->TF_teleray)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
2003-12-27 01:12:57 +00:00
|
|
|
|
tty->Wcm->cm_tab = 0;
|
2001-10-20 10:33:48 +00:00
|
|
|
|
/* We can't support standout mode, because it uses magic cookies. */
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->TS_standout_mode = 0;
|
2013-08-02 21:16:33 +00:00
|
|
|
|
/* But that means we cannot rely on ^M to go to column zero! */
|
2003-12-27 01:12:57 +00:00
|
|
|
|
CR (tty) = 0;
|
2013-08-02 21:16:33 +00:00
|
|
|
|
/* LF can't be trusted either -- can alter hpos. */
|
|
|
|
|
/* If move at column 0 thru a line with TS_standout_mode. */
|
2003-12-27 01:12:57 +00:00
|
|
|
|
Down (tty) = 0;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
Bugfix festival.
lib-src/emacsclient.c (main_argc, main_argv): New variables.
(main): Initialize them.
(fail): Use them.
(window_change, copy_from_to): Don't kill if emacs_pid is zero.
(pty_conversation): Watch the command socket, too. Read emacs_pid
here. Emacs and emacsclient could deadlock if Emacs tried to do a
reset_sys_modes before sending its pid.
lisp/server.el: Automatically delete the client frame when done editing.
(server-frames): New variable.
(server-process-filter, server-sentinel, server-buffer-done): Use it.
(server-process-filter): Do a redisplay before evaluating other
parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from
messing up the system.
src/dispextern.h: Update prototypes.
src/dispnew.c (window_change_signal): Do nothing if !term_initted.
(init_display): Set the frame size from the tty data after term_init.
src/emacs.c (main): Make sure things that init_sys_modes needs are
initialized before init_display (which calls init_sys_modes now).
(sort_args): Use xfree, not free.
(shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
instead of reset_sys_modes.
src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
back to the middle of frame setup. Handle errors by making sure that
the delete_tty() called from term_init() will see and delete this
frame.
(Fdelete_frame): Kill the frame before calling delete_tty(). Fix
condition for tty deletion.
src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
terminal only.
src/lisp.h: Remove duplicate prototypes.
src/msdos.c (croak): use reset_all_sys_modes().
src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
(child_setup_tty): Reset sigio on stdin, not CURTTY().
(reset_sigio): Added fd parameter, put explicit fcntl there.
(request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
SIGIO signal, don't touch the file params. There are multiple ttys
now, and we can't disable the SIGIO from emacsclient.
(get_tty_size)[VMS]: Use tty_out instead of CURTTY().
(reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
cmgoto and tty_clear_end_of_line instead. The frame may already be
dead. Updated reset_sigio call.
src/term.c (clear_and_of_line): Separate tty-dependent stuff to
tty_clear_end_of_line() for reset_sys_modes.
(tty_clear_end_of_line): New function.
(term_init): Added frame parameter, don't use selected_frame.
Set the frame's output_data.tty value (in case there is an error
later). Set the frame size in Wcm, not in the frame. Only free the
termcap buffer if there is a termcap-related error. Call
init_sys_modes last, not first.
(deleting_tty): New variable.
(delete_tty): Use it for handling recursive calls. Free deleted tty,
except its Wcm (there is still a dangling reference somewhere).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
2003-12-29 07:16:26 +00:00
|
|
|
|
tty->specified_window = FrameRows (tty);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2013-08-02 21:16:33 +00:00
|
|
|
|
if (Wcm_init (tty) == -1) /* Can't do cursor motion. */
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
{
|
2008-12-08 14:44:30 +00:00
|
|
|
|
maybe_fatal (must_succeed, terminal,
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
"Terminal type \"%s\" is not powerful enough to run Emacs",
|
|
|
|
|
"Terminal type \"%s\" is not powerful enough to run Emacs.\n\
|
1995-06-28 10:05:35 +00:00
|
|
|
|
It lacks the ability to position the cursor.\n\
|
|
|
|
|
If that is not the actual type of terminal you have,\n\
|
2015-06-01 06:52:09 +00:00
|
|
|
|
use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\
|
|
|
|
|
'setenv TERM ...') to specify the correct type. It may be necessary\n"
|
2010-04-13 02:19:17 +00:00
|
|
|
|
# ifdef TERMINFO
|
2015-06-01 06:52:09 +00:00
|
|
|
|
"to do 'unset TERMINFO' (C-shell: 'unsetenv TERMINFO') as well.",
|
1995-06-28 10:05:35 +00:00
|
|
|
|
# else /* TERMCAP */
|
2015-06-01 06:52:09 +00:00
|
|
|
|
"to do 'unset TERMCAP' (C-shell: 'unsetenv TERMCAP') as well.",
|
1995-06-28 10:05:35 +00:00
|
|
|
|
# endif /* TERMINFO */
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
terminal_type);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
}
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
|
Bugfix festival.
lib-src/emacsclient.c (main_argc, main_argv): New variables.
(main): Initialize them.
(fail): Use them.
(window_change, copy_from_to): Don't kill if emacs_pid is zero.
(pty_conversation): Watch the command socket, too. Read emacs_pid
here. Emacs and emacsclient could deadlock if Emacs tried to do a
reset_sys_modes before sending its pid.
lisp/server.el: Automatically delete the client frame when done editing.
(server-frames): New variable.
(server-process-filter, server-sentinel, server-buffer-done): Use it.
(server-process-filter): Do a redisplay before evaluating other
parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from
messing up the system.
src/dispextern.h: Update prototypes.
src/dispnew.c (window_change_signal): Do nothing if !term_initted.
(init_display): Set the frame size from the tty data after term_init.
src/emacs.c (main): Make sure things that init_sys_modes needs are
initialized before init_display (which calls init_sys_modes now).
(sort_args): Use xfree, not free.
(shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
instead of reset_sys_modes.
src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
back to the middle of frame setup. Handle errors by making sure that
the delete_tty() called from term_init() will see and delete this
frame.
(Fdelete_frame): Kill the frame before calling delete_tty(). Fix
condition for tty deletion.
src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
terminal only.
src/lisp.h: Remove duplicate prototypes.
src/msdos.c (croak): use reset_all_sys_modes().
src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
(child_setup_tty): Reset sigio on stdin, not CURTTY().
(reset_sigio): Added fd parameter, put explicit fcntl there.
(request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
SIGIO signal, don't touch the file params. There are multiple ttys
now, and we can't disable the SIGIO from emacsclient.
(get_tty_size)[VMS]: Use tty_out instead of CURTTY().
(reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
cmgoto and tty_clear_end_of_line instead. The frame may already be
dead. Updated reset_sigio call.
src/term.c (clear_and_of_line): Separate tty-dependent stuff to
tty_clear_end_of_line() for reset_sys_modes.
(tty_clear_end_of_line): New function.
(term_init): Added frame parameter, don't use selected_frame.
Set the frame's output_data.tty value (in case there is an error
later). Set the frame size in Wcm, not in the frame. Only free the
termcap buffer if there is a termcap-related error. Call
init_sys_modes last, not first.
(deleting_tty): New variable.
(delete_tty): Use it for handling recursive calls. Free deleted tty,
except its Wcm (there is still a dangling reference somewhere).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
2003-12-29 07:16:26 +00:00
|
|
|
|
if (FrameRows (tty) <= 0 || FrameCols (tty) <= 0)
|
2008-12-08 14:44:30 +00:00
|
|
|
|
maybe_fatal (must_succeed, terminal,
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
"Could not determine the frame size",
|
|
|
|
|
"Could not determine the frame size");
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
tty->delete_in_insert_mode
|
|
|
|
|
= tty->TS_delete_mode && tty->TS_insert_mode
|
|
|
|
|
&& !strcmp (tty->TS_delete_mode, tty->TS_insert_mode);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
UseTabs (tty) = tabs_safe_p (fileno (tty->input)) && TabWidth (tty) == 8;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2013-10-14 12:19:21 +00:00
|
|
|
|
tty->scroll_region_ok
|
2003-12-27 01:12:57 +00:00
|
|
|
|
= (tty->Wcm->cm_abs
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
&& (tty->TS_set_window || tty->TS_set_scroll_region || tty->TS_set_scroll_region_1));
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2013-10-14 12:19:21 +00:00
|
|
|
|
tty->line_ins_del_ok
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
= (((tty->TS_ins_line || tty->TS_ins_multi_lines)
|
|
|
|
|
&& (tty->TS_del_line || tty->TS_del_multi_lines))
|
2013-10-14 12:19:21 +00:00
|
|
|
|
|| (tty->scroll_region_ok
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
&& tty->TS_fwd_scroll && tty->TS_rev_scroll));
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
2013-10-14 12:19:21 +00:00
|
|
|
|
tty->char_ins_del_ok
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
= ((tty->TS_ins_char || tty->TS_insert_mode
|
|
|
|
|
|| tty->TS_pad_inserted_char || tty->TS_ins_multi_chars)
|
|
|
|
|
&& (tty->TS_del_char || tty->TS_del_multi_chars));
|
1991-05-09 10:29:44 +00:00
|
|
|
|
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
init_baud_rate (fileno (tty->input));
|
* frame.h (struct frame): New fields `can_have_scrollbars' and
`has_vertical_scrollbars'.
(FRAME_CAN_HAVE_SCROLLBARS, FRAME_HAS_VERTICAL_SCROLLBARS): New
accessors, for both the MULTI_FRAME and non-MULTI_FRAME.
(VERTICAL_SCROLLBAR_WIDTH, WINDOW_VERTICAL_SCROLLBAR,
WINDOW_VERTICAL_SCROLLBAR_COLUMN,
WINDOW_VERTICAL_SCROLLBAR_HEIGHT): New macros.
* window.h (struct window): New field `vertical_scrollbar'.
* xterm.h (struct x_display): vertical_scrollbars,
judge_timestamp, vertical_scrollbar_extra: New fields.
(struct scrollbar): New struct.
(VERTICAL_SCROLLBAR_PIXEL_WIDTH, VERTICAL_SCROLLBAR_PIXEL_HEIGHT,
VERTICAL_SCROLLBAR_LEFT_BORDER, VERTICAL_SCROLLBAR_RIGHT_BORDER,
VERTICAL_SCROLLBAR_TOP_BORDER, VERTICAL_SCROLLBAR_BOTTOM_BORDER,
CHAR_TO_PIXEL_WIDTH, CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_WIDTH,
PIXEL_TO_CHAR_HEIGHT): New accessors and macros.
* frame.c (make_frame): Initialize the `can_have_scrollbars' and
`has_vertical_scrollbars' fields of the frame.
* term.c (term_init): Note that TERMCAP terminals don't support
scrollbars.
(mouse_position_hook): Document new args.
(set_vertical_scrollbar_hook, condemn_scrollbars_hook,
redeem_scrollbar_hook, judge_scrollbars_hook): New hooks.
* termhooks.h: Declare and document them.
(enum scrollbar_part): New type.
(struct input_event): Describe the new form of the scrollbar_click
event type. Change `part' from a Lisp_Object to an enum
scrollbar_part. Add a new field `scrollbar'.
* keyboard.c (kbd_buffer_get_event): Pass appropriate new
parameters to *mouse_position_hook, and make_lispy_movement.
* xfns.c (x_set_vertical_scrollbar): New function.
(x_figure_window_size): Use new macros to calculate frame size.
(Fx_create_frame): Note that X Windows frames do support scroll
bars. Default to "yes".
* xterm.c: #include <X11/cursorfont.h> and "window.h".
(x_vertical_scrollbar_cursor): New variable.
(x_term_init): Initialize it.
(last_mouse_bar, last_mouse_bar_frame, last_mouse_part,
last_mouse_scroll_range_start, last_mouse_scroll_range_end): New
variables.
(XTmouse_position): Use them to return scrollbar movement events.
Take new arguments, for that purpose.
(x_window_to_scrollbar, x_scrollbar_create,
x_scrollbar_set_handle, x_scrollbar_remove, x_scrollbar_move,
XTset_scrollbar, XTcondemn_scrollbars, XTredeem_scrollbar,
XTjudge_scrollbars, x_scrollbar_expose,
x_scrollbar_background_expose, x_scrollbar_handle_click,
x_scrollbar_handle_motion): New functions to implement scrollbars.
(x_term_init): Set the termhooks.h hooks to point to them.
(x_set_window_size): Use new macros to calculate frame size. Set
vertical_scrollbar_extra field.
(x_make_frame_visible): Use the frame accessor
FRAME_HAS_VERTICAL_SCROLLBARS to decide if we need to map the
frame's subwindows as well.
(XTread_socket): Use new size-calculation macros from xterm.h when
processing ConfigureNotify events.
(x_wm_set_size_hint): Use PIXEL_TO_CHAR_WIDTH and
PIXEL_TO_CHAR_HEIGHT macros.
* ymakefile (xdisp.o): This now depends on termhooks.h.
(xterm.o): This now depends on window.h.
1992-12-24 06:17:18 +00:00
|
|
|
|
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#endif /* not DOS_NT */
|
2007-09-25 08:53:23 +00:00
|
|
|
|
|
Bugfix festival.
lib-src/emacsclient.c (main_argc, main_argv): New variables.
(main): Initialize them.
(fail): Use them.
(window_change, copy_from_to): Don't kill if emacs_pid is zero.
(pty_conversation): Watch the command socket, too. Read emacs_pid
here. Emacs and emacsclient could deadlock if Emacs tried to do a
reset_sys_modes before sending its pid.
lisp/server.el: Automatically delete the client frame when done editing.
(server-frames): New variable.
(server-process-filter, server-sentinel, server-buffer-done): Use it.
(server-process-filter): Do a redisplay before evaluating other
parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from
messing up the system.
src/dispextern.h: Update prototypes.
src/dispnew.c (window_change_signal): Do nothing if !term_initted.
(init_display): Set the frame size from the tty data after term_init.
src/emacs.c (main): Make sure things that init_sys_modes needs are
initialized before init_display (which calls init_sys_modes now).
(sort_args): Use xfree, not free.
(shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
instead of reset_sys_modes.
src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
back to the middle of frame setup. Handle errors by making sure that
the delete_tty() called from term_init() will see and delete this
frame.
(Fdelete_frame): Kill the frame before calling delete_tty(). Fix
condition for tty deletion.
src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
terminal only.
src/lisp.h: Remove duplicate prototypes.
src/msdos.c (croak): use reset_all_sys_modes().
src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
(child_setup_tty): Reset sigio on stdin, not CURTTY().
(reset_sigio): Added fd parameter, put explicit fcntl there.
(request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
SIGIO signal, don't touch the file params. There are multiple ttys
now, and we can't disable the SIGIO from emacsclient.
(get_tty_size)[VMS]: Use tty_out instead of CURTTY().
(reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
cmgoto and tty_clear_end_of_line instead. The frame may already be
dead. Updated reset_sigio call.
src/term.c (clear_and_of_line): Separate tty-dependent stuff to
tty_clear_end_of_line() for reset_sys_modes.
(tty_clear_end_of_line): New function.
(term_init): Added frame parameter, don't use selected_frame.
Set the frame's output_data.tty value (in case there is an error
later). Set the frame size in Wcm, not in the frame. Only free the
termcap buffer if there is a termcap-related error. Call
init_sys_modes last, not first.
(deleting_tty): New variable.
(delete_tty): Use it for handling recursive calls. Free deleted tty,
except its Wcm (there is still a dangling reference somewhere).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
2003-12-29 07:16:26 +00:00
|
|
|
|
/* Init system terminal modes (RAW or CBREAK, etc.). */
|
|
|
|
|
init_sys_modes (tty);
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
return terminal;
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-07-13 04:47:45 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
vfatal (const char *str, va_list ap)
|
|
|
|
|
{
|
|
|
|
|
fprintf (stderr, "emacs: ");
|
|
|
|
|
vfprintf (stderr, str, ap);
|
|
|
|
|
if (!(strlen (str) > 0 && str[strlen (str) - 1] == '\n'))
|
|
|
|
|
fprintf (stderr, "\n");
|
|
|
|
|
fflush (stderr);
|
|
|
|
|
exit (1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-07-10 22:25:28 +00:00
|
|
|
|
/* Auxiliary error-handling function for init_tty.
|
2008-12-08 14:44:30 +00:00
|
|
|
|
Delete TERMINAL, then call error or fatal with str1 or str2,
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
respectively, according to whether MUST_SUCCEED is true. */
|
2004-04-16 12:51:06 +00:00
|
|
|
|
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
static void
|
* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
* sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
(emacs_set_tty): Now static.
* sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
* term.c (tty_capable_p, tty_default_color_capabilities)
(get_tty_terminal, term_mouse_movement)
(handle_one_term_event, init_tty, maybe_fatal):
* termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
(tgetent, scan_file, name_match, compare_contin):
* terminal.c (get_terminal):
Use bool for boolean.
* sysdep.c (init_system_name): Don't overflow stack on huge hostname.
Prefer char to unsigned char if either will do.
* term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
(tty_write_glyphs): Prefer int to unsigned.
(produce_glyphless_glyph): Remove 2nd (unused) int arg.
All callers changed.
* termcap.c (tprint, main) [TEST]: Remove non-working test.
2013-07-11 02:17:47 +00:00
|
|
|
|
maybe_fatal (bool must_succeed, struct terminal *terminal,
|
2010-07-13 04:47:45 +00:00
|
|
|
|
const char *str1, const char *str2, ...)
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
{
|
2010-07-13 04:47:45 +00:00
|
|
|
|
va_list ap;
|
|
|
|
|
va_start (ap, str2);
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
if (terminal)
|
|
|
|
|
delete_tty (terminal);
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
if (must_succeed)
|
2010-07-13 04:47:45 +00:00
|
|
|
|
vfatal (str2, ap);
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
else
|
2010-07-13 04:47:45 +00:00
|
|
|
|
verror (str1, ap);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-04-14 12:25:56 +00:00
|
|
|
|
void
|
2007-11-22 01:01:26 +00:00
|
|
|
|
fatal (const char *str, ...)
|
1991-05-09 10:29:44 +00:00
|
|
|
|
{
|
2007-11-22 01:01:26 +00:00
|
|
|
|
va_list ap;
|
|
|
|
|
va_start (ap, str);
|
2010-07-13 04:47:45 +00:00
|
|
|
|
vfatal (str, ap);
|
1991-05-09 10:29:44 +00:00
|
|
|
|
}
|
1994-04-08 06:59:55 +00:00
|
|
|
|
|
A few more bugfixes and new features.
(Sigh.) I obviously need to remember to separate individual changes
to multiple commits.
src/emacsclient.c: Improved error handling.
(decode_options): Changed frame option (again) from -f to -t.
(print_help_and_exit): Ditto.
(copy_from_to): Check EINTR after write, not EAGAIN. Removed SIGIO hack.
(pty_conversation): Handle errors transmitted through the socket.
Handle pty errors by not reading from it anymore.
(main): Restore correct errno after socket_status failed. Send -tty
on -t, not -pty.
lisp/server.el (server-process-filter): Watch -tty, not -pty.
Use make-frame-on-tty instead of make-terminal-frame.
Don't set newframe to t if make-frame-on-tty failed.
Don't delete frames here. Print correct message when there are no
files to edit, but a new frame was requested.
(server-sentinel): Delete the frame after the process.
(server-handle-delete-frame): New function for delete-frame-functions.
(server-start): Add server-handle-delete-frame to delete-frame-functions.
(server-buffer-done): Don't delete frames here.
src/alloc.c (mark_ttys): Add prototype.
(Fgarbage_collect): Call mark_ttys.
src/emacs.c: (shut_down_emacs): Don't flush stdout before
reset_sys_modes().
src/process.c (add_keyboard_wait_descriptor_called_flag): Removed.
(add_keyboard_wait_descriptor): Removed stdin hack.
src/sysdep.c: Unconditionally include sysselect.h.
(old_fcntl_flags): Changed to an array.
(init_sigio, reset_sigio): Use it.
(narrow_foreground_group, widen_foreground_group): Use setpgid, not
setpgrp.
(old_fcntl_owner): Changed to an array.
(init_sys_modes, reset_sys_modes): Use it. Fix fsync() and reset_sigio() calls.
src/term.c (Qframe_tty_name, Qframe_tty_type): New variables.
(syms_of_term): Initialize them.
(Fframe_tty_name, Fframe_tty_type): New functions.
(term_init): Call add_keyboard_wait_descriptor().
(Fdelete_tty): New function.
(delete_tty): Call delete_keyboard_wait_descriptor().
(get_current_tty): Removed.
(mark_ttys): New function.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-28
2003-12-31 05:09:29 +00:00
|
|
|
|
|
|
|
|
|
|
2014-07-21 01:41:59 +00:00
|
|
|
|
/* Delete the given tty terminal, closing all frames on it. */
|
Removed %T in mode-line-format. Trivial documentation changes.
lisp/bindings.el (mode-line-buffer-identification): Use the
conditional formatting feature instead of builtin support.
src/buffer.c (Vmode_line_format): Removed %T documentation.
src/xdisp.c (decode_mode_spec): Removed %T processing.
lib-src/emacsclient.c (pass_signal_to_emacs, init_signals): Added
comment.
src/cm.c: Cosmetic changes.
src/termchar.h: Ditto.
src/keyboard.c (interrupt_signal, handle_interrupt): Updated
documentation.
src/process.c (add_keyboard_wait_descriptor): Added docs.
src/sysdep.c (init_all_sys_modes, init_sys_modes)
(reset_all_sys_modes): Added docs.
src/term.c (tty_ring_bell, tty_set_terminal_modes)
(tty_reset_terminal_modes, tty_update_end, set_terminal_window)
(tty_set_terminal_window, clear_to_end, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, write_glyphs)
(tty_write_glyphs, insert_glyphs, tty_insert_glyphs, delete_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, get_named_tty_display)
(init_initial_display, delete_tty): Added docs.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-65
2004-01-25 00:43:38 +00:00
|
|
|
|
|
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
(terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.
* src/term.c (Vring_bell_function, device_list, initial_device)
(next_device_id, ring_bell, update_begin, update_end)
(set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line)
(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
(get_device, Fdisplay_name, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list)
Move to terminal.c.
(syms_of_term): Move their initialization to terminal.c.
* src/terminal.c: New file.
(device_list, next_device_id, initial_device, Vring_bell_function)
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_device, create_device, delete_device)
(Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
(mark_devices, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(init_initial_device, delete_initial_device)
(syms_of_terminal): New functions.
* lisp/simple.el (normal-erase-is-backspace-setup-frame)
(normal-erase-is-backspace-mode): Rephrase things
without terminal-parameter-p.
* lisp/termdev.el (terminal-getenv, terminal-setenv)
(with-terminal-environment): Ditto.
* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
({Src}terminal.c.x): Add dependencies.
* src/Makefile.in (obj): Add terminal.o.
(terminal.o): Add dependencies.
[HAVE_CARBON]: Make terminal.o depend on macgui.h.
* src/alloc.c (mark_devices): Declare.
(Fgarbage_collect): Call `mark_devices'.
* src/dispextern.h (set_scroll_region, turn_off_insert)
(turn_off_highlight, background_highlight, clear_end_of_line_raw)
(tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
(raw_cursor_to, clear_to_end, tty_turn_off_insert)
(tty_turn_off_highlight): Add declaration.
* src/emacs.c (main): Call `syms_of_terminal'.
* src/frame.c (get_future_frame_param): New function.
(Fmake_terminal_frame): Use it.
* src/keyboard.c (pop_kboard): Remove unused variable.
(Fset_output_flow_control): Return nil.
* src/keymap.h (Fset_keymap_parent): Add EXFUN.
* src/lisp.h (syms_of_terminal): Declare it.
* src/sysdep.c (reset_sys_modes): Update for renames.
* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
(turn_on_insert): Rename to `tty_turn_on_insert'.
(turn_off_insert): Rename to `tty_turn_off_insert'.
(turn_off_highlight): Rename to `tty_turn_off_highlight'.
(turn_on_highlight): Rename to `tty_turn_on_highlight'.
(toggle_highligh): Rename to `tty_toggle_highlight'.
(background_highlight): Rename to `tty_background_highlight'.
(highlight_if_desired): Rename to `tty_highlight_if_desired'.
(tty_ring_bell, tty_update_end, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
(delete_tty): Add static modifier.
(tty_reset_terminal_modes, tty_set_terminal_window)
(tty_set_scroll_region, tty_background_highlight)
(tty_highlight_if_desired, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
(tty_delete_glyphs, tty_ins_del_lines, turn_on_face):
Update for renames.
* src/termhooks.h (param_alist): New member to struct device.
* src/xterm.h (x_delete_device): Declare.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
|
|
|
|
static void
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
delete_tty (struct terminal *terminal)
|
2005-06-17 14:08:58 +00:00
|
|
|
|
{
|
Converted display hooks to be display-local. Plus many bugfixes.
lib-src/emacsclient.c (window_change_signal): Renamed to pass_signal_to_emacs.
(init_signal): Pass SIGINT and SIGQUIT to the emacs process.
lisp/faces.el (face-valid-attribute-values): Use the window-system
function, not the variable.
(read-face-attribute, face-spec-set-match-display, frame-set-background-mode)
(face-set-after-frame-default): Ditto.
lisp/frame.el (make-frame-on-tty): Added interactive declaration
(suggested by Robert J. Chassell). Use tty-create-frame-with-faces,
not make-terminal-frame.
src/termhooks.h (struct display_method): Renamed to display for brevity.
(struct display): Added all display hook variables as members of this structure.
Added next_display, reference_count, type and display_info components.
(FRAME_MUST_WRITE_SPACES, FRAME_FAST_CLEAR_END_OF_LINE, FRAME_LINE_INS_DEL_OK)
(FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK, FRAME_SCROLL_REGION_COST)
(FRAME_MEMORY_BELOW_FRAME, FRAME_RIF): Updated for struct display.
(FRAME_DISPLAY): New macro.
(create_display, delete_display): New prototypes.
src/frame.h (struct frame): Added `display' member, removed display_method.
(FRAME_LIVE_P): Look at f->display, not f->output_data.
src/termchar.h (struct tty_display_info): Removed display_method component.
(FRAME_TTY): Use the display structure, not output_data.
src/term.c (display_list): New variable.
(cursor_to_hook, raw_cursor_to_hook, clear_to_end_hook, clear_frame_hook)
(clear_end_of_line_hook, ins_del_lines_hook, delete_glyphs_hook)
(ring_bell_hook, reset_terminal_modes_hook, set_terminal_modes_hook)
(update_begin_hook, update_end_hook, set_terminal_window_hook)
(insert_glyphs_hook, write_glyphs_hook, delete_glyphs_hoo, read_socket_hook)
(frame_up_to_date_hook, mouse_position_hook, frame_rehighlight_hook)
(frame_raise_lower_hook, set_vertical_scroll_bar_hook, condemn_scroll_bars_hook)
(redeem_scroll_bar_hook, judge_scroll_bars_hook): Moved to struct display.
(tty_display_method_template): Removed.
(syms_of_term): Don't initialize tty_display_method_template.
(ring_bell, set_terminal_modes, reset_terminal_modes, update_begin)
(update_end, set_terminal_window, cursor_to, raw_cursor_to, clear_to_end)
(clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Access display hooks through the frame pointer.
(Ftty_display_color_p): Use the frame given as a parameter, or else return nil.
(Ftty_display_color_cells): Ditto.
(get_named_tty): Renamed to get_named_tty_display, changed return type to struct display.
(term_dummy_init): Renamed to initial_term_init. Create and return an initial display.
(term_init): Initialize a new struct display and return a pointer to
it instead of tty_display_info. Removed frame initialization kludge.
(Fdelete_tty): Updated for struct display.
(delete_tty): The parameter type is now struct display, not tty_display_info.
Delete the display, too.
(create_tty_output): New function for creating tty_output structures.
(delete_tty_output): New function for deleting tty_output structures.
(create_display): New function for creating and registering display structures.
(delete_display): New function for deleting and unregistering display structures.
src/dispextern.h: Updated prototypes.
src/dispnew.c: Include frame.h before termhooks.h.
(init_display): Updated term_init call to new signature.
src/emacs.c: Include frame.h (for termhooks.h).
src/keymap.c: Ditto.
src/lread.c: Ditto.
src/xsmfns.c: Ditto.
src/process.c: Include frame.h before termhooks.h.
src/frame.c (Fwindow_system): New function.
(syms_of_frame): Initialize it.
(make_terminal_frame): Open the terminal device before creating the new frame.
Disable scrollbars here, term_init cannot do that anymore.
(Fdelete_frame): Use the new delete_frame_hook, don't do display-specific
frame deletion here. Ditto for delete_display_hook.
(Fmouse_position, Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus): Access display hooks through the frame pointer.
src/keyboard.c: Include frame.h before termhooks.h.
(start_polling, input_polling_used, stop_polling, gobble_input): Ignore read_socket_hook.
(kbd_buffer_get_event, Fset_input_mode): Access display hooks through the frame pointer.
(read_avail_input): Loop through all display devices for and call all read_socket_hook functions. Check ttys even if read_socket_hook returned an error.
src/sysdep.c (discard_tty_input): Ignore read_socket_hook.
(stuff_char): Don't do anything if the current frame is not on a termcap display.
(request_sigio, unrequest_sigio): Ignore read_socket_hook.
(init_sys_modes): Always call narrow_foreground_group. Set up terminal modes and sigio even under X.
src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window): Access display hooks through the frame pointer.
(echo_area_display): Don't be afraid of termcap frames during an X+tty combo session.
src/xfaces.c: Include termhooks.h.
(Ftty_supports_face_attributes_p): Use the given frame, not selected_frame.
src/xfns.c (x_set_scroll_bar_foreground, x_set_scroll_bar_background): Access display hooks through the frame pointer.
(Fx_create_frame, x_create_tip_frame): Initialize the frame's display structure.
src/xmenu.c: Include termhooks.h after frame.h.
src/xselect.c (x_own_selection, some_frame_on_display, x_get_foreign_selection)
(Fx_disown_selection_internal, Fx_get_cut_buffer_internal)
(Fx_store_cut_buffer_internal, Fx_rotate_cut_buffers_internal): Don't do anything
if the selected frame is not an X frame.
src/xterm.c (x_display_method): Removed.
(x_create_frame_display, x_delete_frame_display): New functions for handling struct display objects.
(x_term_init): Set up a new struct display object, too.
(x_delete_display): Delete the struct display corresponding to the X display.
(x_initialize): Moved hook initialization to x_create_frame_display.
src/xterm.h (x_display_method): Removed.
(struct x_display_info): Added frame_display component.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-44
2004-01-05 05:54:35 +00:00
|
|
|
|
struct tty_display_info *tty;
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
2008-12-23 07:28:06 +00:00
|
|
|
|
/* Protect against recursive calls. delete_frame in
|
2006-05-20 17:12:43 +00:00
|
|
|
|
delete_terminal calls us back when it deletes our last frame. */
|
2007-09-20 21:27:01 +00:00
|
|
|
|
if (!terminal->name)
|
Bugfix festival.
lib-src/emacsclient.c (main_argc, main_argv): New variables.
(main): Initialize them.
(fail): Use them.
(window_change, copy_from_to): Don't kill if emacs_pid is zero.
(pty_conversation): Watch the command socket, too. Read emacs_pid
here. Emacs and emacsclient could deadlock if Emacs tried to do a
reset_sys_modes before sending its pid.
lisp/server.el: Automatically delete the client frame when done editing.
(server-frames): New variable.
(server-process-filter, server-sentinel, server-buffer-done): Use it.
(server-process-filter): Do a redisplay before evaluating other
parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from
messing up the system.
src/dispextern.h: Update prototypes.
src/dispnew.c (window_change_signal): Do nothing if !term_initted.
(init_display): Set the frame size from the tty data after term_init.
src/emacs.c (main): Make sure things that init_sys_modes needs are
initialized before init_display (which calls init_sys_modes now).
(sort_args): Use xfree, not free.
(shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
instead of reset_sys_modes.
src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
back to the middle of frame setup. Handle errors by making sure that
the delete_tty() called from term_init() will see and delete this
frame.
(Fdelete_frame): Kill the frame before calling delete_tty(). Fix
condition for tty deletion.
src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
terminal only.
src/lisp.h: Remove duplicate prototypes.
src/msdos.c (croak): use reset_all_sys_modes().
src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
(child_setup_tty): Reset sigio on stdin, not CURTTY().
(reset_sigio): Added fd parameter, put explicit fcntl there.
(request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
SIGIO signal, don't touch the file params. There are multiple ttys
now, and we can't disable the SIGIO from emacsclient.
(get_tty_size)[VMS]: Use tty_out instead of CURTTY().
(reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
cmgoto and tty_clear_end_of_line instead. The frame may already be
dead. Updated reset_sigio call.
src/term.c (clear_and_of_line): Separate tty-dependent stuff to
tty_clear_end_of_line() for reset_sys_modes.
(tty_clear_end_of_line): New function.
(term_init): Added frame parameter, don't use selected_frame.
Set the frame's output_data.tty value (in case there is an error
later). Set the frame size in Wcm, not in the frame. Only free the
termcap buffer if there is a termcap-related error. Call
init_sys_modes last, not first.
(deleting_tty): New variable.
(delete_tty): Use it for handling recursive calls. Free deleted tty,
except its Wcm (there is still a dangling reference somewhere).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
2003-12-29 07:16:26 +00:00
|
|
|
|
return;
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
|
2013-08-15 05:23:40 +00:00
|
|
|
|
eassert (terminal->type == output_termcap);
|
Converted display hooks to be display-local. Plus many bugfixes.
lib-src/emacsclient.c (window_change_signal): Renamed to pass_signal_to_emacs.
(init_signal): Pass SIGINT and SIGQUIT to the emacs process.
lisp/faces.el (face-valid-attribute-values): Use the window-system
function, not the variable.
(read-face-attribute, face-spec-set-match-display, frame-set-background-mode)
(face-set-after-frame-default): Ditto.
lisp/frame.el (make-frame-on-tty): Added interactive declaration
(suggested by Robert J. Chassell). Use tty-create-frame-with-faces,
not make-terminal-frame.
src/termhooks.h (struct display_method): Renamed to display for brevity.
(struct display): Added all display hook variables as members of this structure.
Added next_display, reference_count, type and display_info components.
(FRAME_MUST_WRITE_SPACES, FRAME_FAST_CLEAR_END_OF_LINE, FRAME_LINE_INS_DEL_OK)
(FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK, FRAME_SCROLL_REGION_COST)
(FRAME_MEMORY_BELOW_FRAME, FRAME_RIF): Updated for struct display.
(FRAME_DISPLAY): New macro.
(create_display, delete_display): New prototypes.
src/frame.h (struct frame): Added `display' member, removed display_method.
(FRAME_LIVE_P): Look at f->display, not f->output_data.
src/termchar.h (struct tty_display_info): Removed display_method component.
(FRAME_TTY): Use the display structure, not output_data.
src/term.c (display_list): New variable.
(cursor_to_hook, raw_cursor_to_hook, clear_to_end_hook, clear_frame_hook)
(clear_end_of_line_hook, ins_del_lines_hook, delete_glyphs_hook)
(ring_bell_hook, reset_terminal_modes_hook, set_terminal_modes_hook)
(update_begin_hook, update_end_hook, set_terminal_window_hook)
(insert_glyphs_hook, write_glyphs_hook, delete_glyphs_hoo, read_socket_hook)
(frame_up_to_date_hook, mouse_position_hook, frame_rehighlight_hook)
(frame_raise_lower_hook, set_vertical_scroll_bar_hook, condemn_scroll_bars_hook)
(redeem_scroll_bar_hook, judge_scroll_bars_hook): Moved to struct display.
(tty_display_method_template): Removed.
(syms_of_term): Don't initialize tty_display_method_template.
(ring_bell, set_terminal_modes, reset_terminal_modes, update_begin)
(update_end, set_terminal_window, cursor_to, raw_cursor_to, clear_to_end)
(clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Access display hooks through the frame pointer.
(Ftty_display_color_p): Use the frame given as a parameter, or else return nil.
(Ftty_display_color_cells): Ditto.
(get_named_tty): Renamed to get_named_tty_display, changed return type to struct display.
(term_dummy_init): Renamed to initial_term_init. Create and return an initial display.
(term_init): Initialize a new struct display and return a pointer to
it instead of tty_display_info. Removed frame initialization kludge.
(Fdelete_tty): Updated for struct display.
(delete_tty): The parameter type is now struct display, not tty_display_info.
Delete the display, too.
(create_tty_output): New function for creating tty_output structures.
(delete_tty_output): New function for deleting tty_output structures.
(create_display): New function for creating and registering display structures.
(delete_display): New function for deleting and unregistering display structures.
src/dispextern.h: Updated prototypes.
src/dispnew.c: Include frame.h before termhooks.h.
(init_display): Updated term_init call to new signature.
src/emacs.c: Include frame.h (for termhooks.h).
src/keymap.c: Ditto.
src/lread.c: Ditto.
src/xsmfns.c: Ditto.
src/process.c: Include frame.h before termhooks.h.
src/frame.c (Fwindow_system): New function.
(syms_of_frame): Initialize it.
(make_terminal_frame): Open the terminal device before creating the new frame.
Disable scrollbars here, term_init cannot do that anymore.
(Fdelete_frame): Use the new delete_frame_hook, don't do display-specific
frame deletion here. Ditto for delete_display_hook.
(Fmouse_position, Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus): Access display hooks through the frame pointer.
src/keyboard.c: Include frame.h before termhooks.h.
(start_polling, input_polling_used, stop_polling, gobble_input): Ignore read_socket_hook.
(kbd_buffer_get_event, Fset_input_mode): Access display hooks through the frame pointer.
(read_avail_input): Loop through all display devices for and call all read_socket_hook functions. Check ttys even if read_socket_hook returned an error.
src/sysdep.c (discard_tty_input): Ignore read_socket_hook.
(stuff_char): Don't do anything if the current frame is not on a termcap display.
(request_sigio, unrequest_sigio): Ignore read_socket_hook.
(init_sys_modes): Always call narrow_foreground_group. Set up terminal modes and sigio even under X.
src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window): Access display hooks through the frame pointer.
(echo_area_display): Don't be afraid of termcap frames during an X+tty combo session.
src/xfaces.c: Include termhooks.h.
(Ftty_supports_face_attributes_p): Use the given frame, not selected_frame.
src/xfns.c (x_set_scroll_bar_foreground, x_set_scroll_bar_background): Access display hooks through the frame pointer.
(Fx_create_frame, x_create_tip_frame): Initialize the frame's display structure.
src/xmenu.c: Include termhooks.h after frame.h.
src/xselect.c (x_own_selection, some_frame_on_display, x_get_foreign_selection)
(Fx_disown_selection_internal, Fx_get_cut_buffer_internal)
(Fx_store_cut_buffer_internal, Fx_rotate_cut_buffers_internal): Don't do anything
if the selected frame is not an X frame.
src/xterm.c (x_display_method): Removed.
(x_create_frame_display, x_delete_frame_display): New functions for handling struct display objects.
(x_term_init): Set up a new struct display object, too.
(x_delete_display): Delete the struct display corresponding to the X display.
(x_initialize): Moved hook initialization to x_create_frame_display.
src/xterm.h (x_display_method): Removed.
(struct x_display_info): Added frame_display component.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-44
2004-01-05 05:54:35 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
tty = terminal->display_info.tty;
|
2008-02-27 22:49:29 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty == tty_list)
|
|
|
|
|
tty_list = tty->next;
|
|
|
|
|
else
|
|
|
|
|
{
|
Separate frame-local, tty-dependent parameters from tty-local parameters.
src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters. (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.
src/term.c: Update prototypes. Use tty_display_info instead of tty_output.
src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.
src/cm.h: Update prototypes.
src/dispextern.h: Ditto.
src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.
src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output. Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty. Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty. Use reference count to
decide if the tty should be closed.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.
src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.
src/lisp.h: Declare struct display. Update prototypes.
src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
2004-01-01 17:55:53 +00:00
|
|
|
|
struct tty_display_info *p;
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
for (p = tty_list; p && p->next != tty; p = p->next)
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
if (! p)
|
2014-07-21 01:41:59 +00:00
|
|
|
|
/* This should not happen. */
|
2012-09-04 17:34:54 +00:00
|
|
|
|
emacs_abort ();
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
|
Bugfix festival.
lib-src/emacsclient.c (main_argc, main_argv): New variables.
(main): Initialize them.
(fail): Use them.
(window_change, copy_from_to): Don't kill if emacs_pid is zero.
(pty_conversation): Watch the command socket, too. Read emacs_pid
here. Emacs and emacsclient could deadlock if Emacs tried to do a
reset_sys_modes before sending its pid.
lisp/server.el: Automatically delete the client frame when done editing.
(server-frames): New variable.
(server-process-filter, server-sentinel, server-buffer-done): Use it.
(server-process-filter): Do a redisplay before evaluating other
parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from
messing up the system.
src/dispextern.h: Update prototypes.
src/dispnew.c (window_change_signal): Do nothing if !term_initted.
(init_display): Set the frame size from the tty data after term_init.
src/emacs.c (main): Make sure things that init_sys_modes needs are
initialized before init_display (which calls init_sys_modes now).
(sort_args): Use xfree, not free.
(shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
instead of reset_sys_modes.
src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
back to the middle of frame setup. Handle errors by making sure that
the delete_tty() called from term_init() will see and delete this
frame.
(Fdelete_frame): Kill the frame before calling delete_tty(). Fix
condition for tty deletion.
src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
terminal only.
src/lisp.h: Remove duplicate prototypes.
src/msdos.c (croak): use reset_all_sys_modes().
src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
(child_setup_tty): Reset sigio on stdin, not CURTTY().
(reset_sigio): Added fd parameter, put explicit fcntl there.
(request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
SIGIO signal, don't touch the file params. There are multiple ttys
now, and we can't disable the SIGIO from emacsclient.
(get_tty_size)[VMS]: Use tty_out instead of CURTTY().
(reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
cmgoto and tty_clear_end_of_line instead. The frame may already be
dead. Updated reset_sigio call.
src/term.c (clear_and_of_line): Separate tty-dependent stuff to
tty_clear_end_of_line() for reset_sys_modes.
(tty_clear_end_of_line): New function.
(term_init): Added frame parameter, don't use selected_frame.
Set the frame's output_data.tty value (in case there is an error
later). Set the frame size in Wcm, not in the frame. Only free the
termcap buffer if there is a termcap-related error. Call
init_sys_modes last, not first.
(deleting_tty): New variable.
(delete_tty): Use it for handling recursive calls. Free deleted tty,
except its Wcm (there is still a dangling reference somewhere).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
2003-12-29 07:16:26 +00:00
|
|
|
|
p->next = tty->next;
|
|
|
|
|
tty->next = 0;
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-07-11 00:05:55 +00:00
|
|
|
|
/* reset_sys_modes needs a valid device, so this call needs to be
|
2014-07-21 01:41:59 +00:00
|
|
|
|
before delete_terminal. */
|
2003-12-28 22:28:52 +00:00
|
|
|
|
reset_sys_modes (tty);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
delete_terminal (terminal);
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
|
2008-06-02 06:09:17 +00:00
|
|
|
|
xfree (tty->name);
|
|
|
|
|
xfree (tty->type);
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
if (tty->input)
|
A few more bugfixes and new features.
(Sigh.) I obviously need to remember to separate individual changes
to multiple commits.
src/emacsclient.c: Improved error handling.
(decode_options): Changed frame option (again) from -f to -t.
(print_help_and_exit): Ditto.
(copy_from_to): Check EINTR after write, not EAGAIN. Removed SIGIO hack.
(pty_conversation): Handle errors transmitted through the socket.
Handle pty errors by not reading from it anymore.
(main): Restore correct errno after socket_status failed. Send -tty
on -t, not -pty.
lisp/server.el (server-process-filter): Watch -tty, not -pty.
Use make-frame-on-tty instead of make-terminal-frame.
Don't set newframe to t if make-frame-on-tty failed.
Don't delete frames here. Print correct message when there are no
files to edit, but a new frame was requested.
(server-sentinel): Delete the frame after the process.
(server-handle-delete-frame): New function for delete-frame-functions.
(server-start): Add server-handle-delete-frame to delete-frame-functions.
(server-buffer-done): Don't delete frames here.
src/alloc.c (mark_ttys): Add prototype.
(Fgarbage_collect): Call mark_ttys.
src/emacs.c: (shut_down_emacs): Don't flush stdout before
reset_sys_modes().
src/process.c (add_keyboard_wait_descriptor_called_flag): Removed.
(add_keyboard_wait_descriptor): Removed stdin hack.
src/sysdep.c: Unconditionally include sysselect.h.
(old_fcntl_flags): Changed to an array.
(init_sigio, reset_sigio): Use it.
(narrow_foreground_group, widen_foreground_group): Use setpgid, not
setpgrp.
(old_fcntl_owner): Changed to an array.
(init_sys_modes, reset_sys_modes): Use it. Fix fsync() and reset_sigio() calls.
src/term.c (Qframe_tty_name, Qframe_tty_type): New variables.
(syms_of_term): Initialize them.
(Fframe_tty_name, Fframe_tty_type): New functions.
(term_init): Call add_keyboard_wait_descriptor().
(Fdelete_tty): New function.
(delete_tty): Call delete_keyboard_wait_descriptor().
(get_current_tty): Removed.
(mark_ttys): New function.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-28
2003-12-31 05:09:29 +00:00
|
|
|
|
{
|
|
|
|
|
delete_keyboard_wait_descriptor (fileno (tty->input));
|
|
|
|
|
if (tty->input != stdin)
|
|
|
|
|
fclose (tty->input);
|
|
|
|
|
}
|
|
|
|
|
if (tty->output && tty->output != stdout && tty->output != tty->input)
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
fclose (tty->output);
|
|
|
|
|
if (tty->termscript)
|
|
|
|
|
fclose (tty->termscript);
|
Fixed X support, preliminary support for X-tty combo sessions.
lib-src/emacsclient.c (copy_from_to, pty_conversation): Re-added SIGIO
hack. (Sigh.)
lisp/frame.el (make-frame-on-tty): Use make-terminal-frame, not
make-frame.
src/dispnew.c (line_hash_code, line_draw_cost): Updated to use
the new display_method parameters.
(Fredraw_frame): fflush the tty only if f is a termcap frame.
(direct_output_for_insert): Updated to use the new display_method
parameters. fflush the tty only if f is a termcap frame.
(direct_output_forward_char, update_frame_1, scrolling): Ditto.
(update_frame_line, Fding, bitch_at_user): Ditto.
(Fsend_string_to_terminal): Fail if current frame is not on a tty.
(init_display): Frame size change is safe here.
src/frame.c (Vterminal_frame): Restored previously deleted variable.
(syms_of_frame): Initialize it.
(make_terminal_frame): Copy the frame's display_method from tty_display_info.
(Fmake_terminal_frame): Enable simultaneous X and tty frames (buggy).
(Fredirect_frame_focus): Don't call frame_rehighlight_hook if frame
is on a termcap device.
src/frame.h (struct frame): Renamed display to display_method.
(Vterminal_frame): Re-added declaration.
src/keyboard.c (flow_control): Moved to struct tty_display_info.
(read_avail_input): Check ttys even if there is a read_socket_hook.
(Fset_input_mode): Call reset_sys_modes/init_sys_modes and set
flow_control or meta_key only when the frame is a termcap frame.
(Fcurrent_input_mode): Handle flow_control and meta_key right on
non-termcap frames.
src/scroll.c (calculate_scrolling, calculate_direct_scrolling): Update
to use the new display_method parameters.
(scrolling_1, scroll_cost): Ditto.
src/sysdep.c (init_sys_modes, reset_sys_modes): Always set the
terminal parameters if tty_out->input is not stdin. Updated to the
new location of flow_control.
(hft_init): Moved HFT init code to term_init, as it needs the frame.
src/term.c (tty_display_method_template): New variable.
(update_begin): Added rif hack.
(set_terminal_window, ins_del_lines, term_init): Updated to use the
new display_method parameters.
(insert_glyphs, ins_del_lines): Only call insert_glyphs_hook if the
current frame is not on a tty.
(calculate_costs): Don't calculate costs if not on a tty.
(term_dummy_init): Fixed tty->output initialization. Preallocate Wcm
and display_method.
(term_init): Allocate & initialize display_method. Blindly fixed
WINDOWSNT-specific parts. Added HFT-specific initialization
exception from hft_init.
(delete_tty): Only delete termcap frames. Free() the display_method.
src/termchar.h (struct tty_display_info): Moved high-level terminal
characteristics to struct display_method. Added flow_control and
display_method members.
src/termhooks.h (struct display_method): New struct (renamed from
struct device). Added accessor macros.
src/window.c (init_window_once): Initialize Vterminal_frame.
src/xdisp.c (init_iterator, expose_frame): Added rif hack.
(try_window_id): Updated to use the new display_method parameters.
src/xfaces.c (realize_basic_faces): Don't call
x_update_menu_appearance if the frame is a tty frame.
src/xfns.c (Fx_create_frame): Added rif hack. Initialize
display_method.
(x_create_tip_frame): Initialize display_method.
src/xterm.c (x_display_method): New variable.
(x_flush, x_frame_of_widget, XTmouse_position): Ignore non-X frames.
(x_window_to_scroll_bar, x_window_to_menu_bar): Ditto.
(xim_destroy_callback, xim_instantiate_callback): Ditto.
(frame_highlight, frame_unhighlight): Added rif hack.
(x_initialize): Don't initialize rif. Do initialize x_display_method.
src/xterm.h (x_display_method): New declaration.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-30
2004-01-02 01:15:26 +00:00
|
|
|
|
|
2008-06-02 06:09:17 +00:00
|
|
|
|
xfree (tty->old_tty);
|
|
|
|
|
xfree (tty->Wcm);
|
Fully eliminated global tty state variables.
lib-src/emacsclient.c (main.c): Fix error message.
lisp/frame.el (make-frame-on-tty): New function.
lisp/server.el (server-process-filter): Notify emacsclient if there
was on error during evaluation.
src/cm.c: Fix remaining cases of direct Wcm references.
src/dispextern.h: Updated prototypes.
src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
(init_display): Remove reference to meta_key.
src/frame.c (make_terminal_frame): Renamed first parameter to
tty_name. Call term_init before creating the frame.
(Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
parameters from the currently selected terminal before the global
default.
(Fdelete_frame): Make sure that the new selected frame is live.
src/keyboard.c (meta_key): Moved to struct tty_output.
(read_avail_input): Fix C syntax. Update references to meta_key.
(Fsuspend_emacs): pass current tty to init_sys_modes via
record_unwind_protect.
(Fset_input_mode): Update references to meta_key.
(Fcurrent_input_mode): Ditto.
src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
references. Don't call set_terminal_modes, it needs termcap strings.
(reset_sys_modes): Call tty_reset_terminal_modes instead of
reset_terminal_modes. Updated old_tty references.
src/term.c: Massive updates throuout the file.
(TS_*, TN_*): Moved to struct tty_output.
(RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
(standout_mode, specified_window, tty_cursor_hidden): Ditto.
(tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
(turn_on_insert, turn_off_insert): Added tty parameter.
(turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
(tty_hide_cursor, tty_show_cursor): Ditto.
(background_highlight, highlight_if_desired): Ditto.
(tty_capable_p): Changed first parameter to tty_output.
(term_init): Make sure top_frame is initialized. Don't exit on errors
if this would have been a secondary terminal. Call set_terminal_modes
on the end.
(delete_tty): New function.
(delete_tty_1): New function.
(print_all_frames): New function, marginally useful for debugging.
src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
Removed old_tty_valid member. Added tty-specific variables from term.c.
src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
tty_capable_p.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
2003-12-27 10:00:19 +00:00
|
|
|
|
xfree (tty);
|
|
|
|
|
}
|
|
|
|
|
|
1998-04-14 12:25:56 +00:00
|
|
|
|
void
|
2010-07-05 10:36:06 +00:00
|
|
|
|
syms_of_term (void)
|
1994-04-08 06:59:55 +00:00
|
|
|
|
{
|
Move all DEFVAR'd globals into a structure -- threading infrastructure
* globals.h: New file.
* xterm.h (Vx_pixel_size_width_font_regexp): Remove declaration.
* window.h (Vinitial_window_system, Vminibuf_scroll_window)
(Vwindow_system_version): Remove declaration.
* w32term.h (Vw32_enable_palette)
(Vx_pixel_size_width_font_regexp): Remove declaration.
* w32menu.c (Voverriding_local_map)
(Voverriding_local_map_menu_flag): Remove declaration.
* w32inevt.c (Vw32_alt_is_meta, Vw32_apps_modifier)
(Vw32_capslock_is_shiftlock, Vw32_enable_caps_lock)
(Vw32_enable_num_lock, Vw32_lwindow_modifier)
(Vw32_pass_lwindow_to_system, Vw32_pass_rwindow_to_system)
(Vw32_phantom_key_code, Vw32_recognize_altgr)
(Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
(w32_use_full_screen_buffer): Remove declaration.
* w32.c (Vsystem_configuration, Vw32_downcase_file_names)
(Vw32_generate_fake_inodes, Vw32_get_true_file_attributes)
(w32_num_mouse_buttons, w32_pipe_read_delay): Remove declaration.
* termopts.h (Vtruncate_partial_width_windows, inverse_video)
(no_redraw_on_reenter, visible_bell): Remove declaration.
* sysdep.c (Vsystem_name): Remove declaration.
* syntax.h (parse_sexp_lookup_properties): Remove declaration.
* menu.h (Vmenu_updating_frame): Remove declaration.
* macros.h (Vexecuting_kbd_macro, executing_kbd_macro_index):
Remove declaration.
* lisp.h (Vafter_init_time, Vafter_load_alist)
(Vauto_save_list_file_name, Vbefore_init_time, Vcommand_history)
(Vcompletion_regexp_list, Vcurrent_load_list)
(Vcurrent_prefix_arg, Vdata_directory, Vdebug_on_error)
(Vdoc_directory, Vdoc_file_name, Vdynamic_library_alist)
(Vexec_directory, Vexec_path, Vexec_suffixes)
(Vface_font_rescale_alist, Vface_ignored_fonts, Vfeatures)
(Vhelp_form, Vhistory_length, Vinhibit_field_text_motion)
(Vinhibit_quit, Vinhibit_read_only, Vinhibit_redisplay)
(Vinstallation_directory, Vinvocation_directory)
(Vinvocation_name, Vload_file_rep_suffixes, Vload_history)
(Vload_suffixes, Vmark_even_if_inactive, Vmemory_full)
(Vmessage_log_max, Vobarray, Vprint_length, Vprint_level)
(Vpurify_flag, Vquit_flag, Vsaved_region_selection)
(Vscalable_fonts_allowed, Vselect_active_regions)
(Vshell_file_name, Vstandard_input, Vstandard_output)
(Vsystem_name, Vtemporary_file_directory, Vthrow_on_input)
(Vtop_level, Vtty_erase_char, Vundo_outer_limit)
(Vuser_login_name, Vwindow_scroll_functions)
(Vwindow_system_version, Vx_no_window_manager)
(Vx_resource_class, Vx_resource_name, baud_rate)
(completion_ignore_case, debug_on_next_call, gc_cons_threshold)
(history_delete_duplicates, inhibit_x_resources)
(last_nonmenu_event, load_in_progress, max_specpdl_size)
(minibuffer_auto_raise, print_escape_newlines, scroll_margin)
(use_dialog_box, use_file_dialog): Remove declaration. Include
globals.h.
* keymap.h (Voverriding_local_map)
(Voverriding_local_map_menu_flag, meta_prefix_char): Remove
declaration.
* keyboard.h (Vdouble_click_time, Vfunction_key_map)
(Vinput_method_function, Vkey_translation_map)
(Vlucid_menu_bar_dirty_flag, Vthis_original_command)
(do_mouse_tracking, extra_keyboard_modifiers)
(num_nonmacro_input_events): Remove declaration.
* intervals.h (Vchar_property_alias_alist)
(Vdefault_text_properties, Vinhibit_point_motion_hooks)
(Vtext_property_default_nonsticky): Remove declaration.
* gtkutil.h (x_gtk_file_dialog_help_text)
(x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
(x_gtk_whole_detached_tool_bar): Remove declaration.
* frame.h (Vdefault_frame_alist, Vframe_alpha_lower_limit)
(Vmenu_bar_mode, Vmouse_highlight, Vterminal_frame)
(Vtool_bar_mode, Vx_resource_class, Vx_resource_name)
(focus_follows_mouse): Remove declaration.
* fontset.h (Valternate_fontname_alist, Vfontset_alias_alist)
(Vignore_relative_composition, Votf_script_alist)
(Vuse_default_ascent, Vvertical_centering_font_regexp): Remove
declaration.
* font.h (Vfont_log): Remove declaration.
* dosfns.h (Vdos_display_scancodes, Vdos_version)
(Vdos_windows_version, dos_codepage, dos_country_code)
(dos_decimal_point, dos_hyper_key, dos_keyboard_layout)
(dos_keypad_mode, dos_super_key, dos_timezone_offset): Remove
declaration.
* disptab.h (Vglyph_table, Vstandard_display_table): Remove
declaration.
* dispextern.h (Vface_remapping_alist, Vglyphless_char_display)
(Vmouse_autoselect_window, Voverflow_newline_into_fringe)
(Vshow_trailing_whitespace, Vtool_bar_button_margin)
(Vtool_bar_style, cursor_in_echo_area, display_hourglass_p)
(inverse_video, mode_line_in_non_selected_windows)
(tool_bar_button_relief, tool_bar_max_label_size)
(underline_minimum_offset)
(unibyte_display_via_language_environment, x_stretch_cursor_p):
Remove declaration.
* composite.h (Vauto_composition_function)
(Vcomposition_function_table): Remove declaration.
* commands.h (Vexecuting_kbd_macro)
(Vminibuffer_local_completion_map)
(Vminibuffer_local_filename_completion_map)
(Vminibuffer_local_filename_must_match_map)
(Vminibuffer_local_map, Vminibuffer_local_must_match_map)
(Vminibuffer_local_ns_map, Vthis_command)
(Vunread_command_events, cursor_in_echo_area)
(last_command_event, last_nonmenu_event, unread_command_char):
Remove declaration.
* coding.h (Vcoding_system_for_read, Vcoding_system_for_write)
(Vdefault_file_name_coding_system)
(Vdefault_process_coding_system, Vfile_name_coding_system)
(Vlast_coding_system_used, Vlocale_coding_system)
(Vselect_safe_coding_system_function)
(Vtranslation_table_for_input, coding_system_require_warning)
(eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
(eol_mnemonic_unix, inherit_process_coding_system): Remove
declaration.
* charset.h (Vcharset_list, Vcurrent_iso639_language): Remove
declaration.
* character.h (Vauto_fill_chars, Vchar_direction_table)
(Vchar_script_table, Vchar_width_table, Vprintable_chars)
(Vscript_representative_chars, Vtranslation_table_vector)
(Vunicode_category_table): Remove declaration.
* ccl.h (Vfont_ccl_encoder_alist): Remove declaration.
* buffer.h (Vafter_change_functions, Vbefore_change_functions)
(Vdeactivate_mark, Vfirst_change_hook, Vtransient_mark_mode)
(inhibit_modification_hooks): Remove declaration.
* xterm.c (syms_of_xterm): Update.
(Vx_alt_keysym, Vx_hyper_keysym, Vx_keysym_table)
(Vx_meta_keysym, Vx_super_keysym, Vx_toolkit_scroll_bars)
(x_mouse_click_focus_ignore_position)
(x_underline_at_descent_line)
(x_use_underline_position_properties): Remove.
* xsmfns.c (syms_of_xsmfns): Update.
(Vx_session_id, Vx_session_previous_id): Remove.
* xsettings.c (syms_of_xsettings): Update.
(Vxft_settings, use_system_font): Remove.
* xselect.c (syms_of_xselect): Update.
(Vselection_converter_alist, Vx_lost_selection_functions)
(Vx_sent_selection_functions, x_selection_timeout): Remove.
* xfns.c (syms_of_xfns): Update.
(Vgtk_version_string, Vmotif_version_string)
(Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
(Vx_max_tooltip_size, Vx_mode_pointer_shape)
(Vx_no_window_manager, Vx_nontext_pointer_shape)
(Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
(Vx_sensitive_text_pointer_shape)
(Vx_window_horizontal_drag_shape, x_gtk_file_dialog_help_text)
(x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
(x_gtk_use_system_tooltips, x_gtk_whole_detached_tool_bar):
Remove.
* xfaces.c (syms_of_xfaces): Update.
(Vface_default_stipple, Vface_font_rescale_alist)
(Vface_ignored_fonts, Vface_new_frame_defaults)
(Vface_remapping_alist, Vfont_list_limit)
(Vscalable_fonts_allowed, Vtty_defined_color_alist): Remove.
* xdisp.c (syms_of_xdisp): Update.
(Vauto_resize_tool_bars, Vblink_cursor_alist)
(Vdisplay_pixels_per_inch, Vfontification_functions)
(Vframe_title_format, Vglobal_mode_string)
(Vglyphless_char_display, Vhourglass_delay, Vhscroll_step)
(Vicon_title_format, Vinhibit_redisplay)
(Vline_number_display_limit, Vline_prefix)
(Vmax_mini_window_height, Vmenu_bar_update_hook)
(Vmenu_updating_frame, Vmessage_log_max)
(Vmouse_autoselect_window, Vnobreak_char_display)
(Voverlay_arrow_position, Voverlay_arrow_string)
(Voverlay_arrow_variable_list, Vredisplay_end_trigger_functions)
(Vresize_mini_windows, Vshow_trailing_whitespace)
(Vtool_bar_border, Vtool_bar_button_margin, Vtool_bar_style)
(Vtruncate_partial_width_windows, Vvoid_text_area_pointer)
(Vwindow_scroll_functions, Vwindow_size_change_functions)
(Vwindow_text_change_functions, Vwrap_prefix)
(auto_raise_tool_bar_buttons_p, automatic_hscrolling_p)
(debug_end_pos, display_hourglass_p, emacs_scroll_step)
(highlight_nonselected_windows, hscroll_margin)
(inhibit_eval_during_redisplay, inhibit_free_realized_faces)
(inhibit_menubar_update, inhibit_try_cursor_movement)
(inhibit_try_window_id, inhibit_try_window_reusing)
(line_number_display_limit_width)
(make_cursor_line_fully_visible_p, message_truncate_lines)
(mode_line_inverse_video, multiple_frames, overline_margin)
(scroll_conservatively, scroll_margin, tool_bar_button_relief)
(tool_bar_max_label_size, underline_minimum_offset)
(unibyte_display_via_language_environment, x_stretch_cursor_p):
Remove.
* window.c (syms_of_window): Update.
(Vminibuf_scroll_window, Vother_window_scroll_buffer)
(Vrecenter_redisplay, Vscroll_preserve_screen_position)
(Vtemp_buffer_show_function, Vwindow_configuration_change_hook)
(Vwindow_point_insertion_type, auto_window_vscroll_p)
(mode_line_in_non_selected_windows, next_screen_context_lines)
(window_min_height, window_min_width): Remove.
(scroll_margin): Remove declaration.
* w32term.c (syms_of_w32term): Update.
(Vw32_capslock_is_shiftlock, Vw32_grab_focus_on_raise)
(Vw32_recognize_altgr, Vw32_swap_mouse_buttons)
(Vx_toolkit_scroll_bars, w32_num_mouse_buttons)
(w32_use_visible_system_caret, x_underline_at_descent_line)
(x_use_underline_position_properties): Remove.
(Vcommand_line_args, Vsystem_name, extra_keyboard_modifiers):
Remove declaration.
* w32select.c (syms_of_w32select): Update.
(Vnext_selection_coding_system, Vselection_coding_system): Remove.
* w32proc.c (syms_of_ntproc): Update.
(Vw32_downcase_file_names, Vw32_generate_fake_inodes)
(Vw32_get_true_file_attributes, Vw32_quote_process_args)
(Vw32_start_process_inherit_error_mode)
(Vw32_start_process_share_console)
(Vw32_start_process_show_window, w32_pipe_read_delay): Remove.
(Vsystem_name): Remove declaration.
* w32font.c (syms_of_w32font): Update.
(Vw32_charset_info_alist): Remove.
* w32fns.c (globals_of_w32fns, syms_of_w32fns): Update.
(Vw32_alt_is_meta, Vw32_apps_modifier, Vw32_bdf_filename_alist)
(Vw32_color_map, Vw32_enable_caps_lock, Vw32_enable_num_lock)
(Vw32_enable_palette, Vw32_lwindow_modifier)
(Vw32_pass_alt_to_system, Vw32_pass_lwindow_to_system)
(Vw32_pass_rwindow_to_system, Vw32_phantom_key_code)
(Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
(Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
(Vx_max_tooltip_size, Vx_mode_pointer_shape)
(Vx_no_window_manager, Vx_nontext_pointer_shape)
(Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
(Vx_sensitive_text_pointer_shape)
(Vx_window_horizontal_drag_shape, w32_ansi_code_page)
(w32_enable_synthesized_fonts, w32_mouse_button_tolerance)
(w32_mouse_move_interval)
(w32_pass_extra_mouse_buttons_to_system)
(w32_pass_multimedia_buttons_to_system, w32_quit_key)
(w32_strict_fontnames, w32_strict_painting): Remove.
(Vhourglass_delay, Vmenu_bar_mode, Vtool_bar_mode)
(Vw32_recognize_altgr, Vwindow_system_version)
(w32_num_mouse_buttons, w32_use_visible_system_caret): Remove
declaration.
* w32console.c (syms_of_ntterm): Update.
(w32_use_full_screen_buffer): Remove.
(Vtty_defined_color_alist): Remove declaration.
* w16select.c (syms_of_win16select): Update.
(Vnext_selection_coding_system, Vselection_coding_system): Remove.
* undo.c (syms_of_undo): Update.
(Vundo_outer_limit, Vundo_outer_limit_function)
(undo_inhibit_record_point, undo_limit, undo_strong_limit):
Remove.
* textprop.c (syms_of_textprop): Update.
(Vchar_property_alias_alist, Vdefault_text_properties)
(Vinhibit_point_motion_hooks, Vtext_property_default_nonsticky):
Remove.
* terminal.c (syms_of_terminal): Update.
(Vdelete_terminal_functions, Vring_bell_function): Remove.
* term.c (syms_of_term): Update.
(Vresume_tty_functions, Vsuspend_tty_functions)
(no_redraw_on_reenter, system_uses_terminfo, visible_cursor):
Remove.
* syntax.c (syms_of_syntax): Update.
(Vfind_word_boundary_function_table, multibyte_syntax_as_symbol)
(open_paren_in_column_0_is_defun_start)
(parse_sexp_ignore_comments, parse_sexp_lookup_properties)
(words_include_escapes): Remove.
* search.c (syms_of_search): Update.
(Vinhibit_changing_match_data, Vsearch_spaces_regexp): Remove.
* process.c (syms_of_process): Update.
(Vprocess_adaptive_read_buffering, Vprocess_connection_type)
(delete_exited_processes): Remove.
* print.c (syms_of_print): Update.
(Vfloat_output_format, Vprint_charset_text_property)
(Vprint_circle, Vprint_continuous_numbering, Vprint_gensym)
(Vprint_length, Vprint_level, Vprint_number_table)
(Vstandard_output, print_escape_multibyte)
(print_escape_newlines, print_escape_nonascii, print_quoted):
Remove.
* msdos.c (syms_of_msdos): Update.
(Vdos_unsupported_char_glyph): Remove.
(unibyte_display_via_language_environment): Remove declaration.
* minibuf.c (syms_of_minibuf): Update.
(Vcompletion_regexp_list, Vhistory_add_new_input)
(Vhistory_length, Vminibuffer_completing_file_name)
(Vminibuffer_completion_confirm)
(Vminibuffer_completion_predicate, Vminibuffer_completion_table)
(Vminibuffer_exit_hook, Vminibuffer_help_form)
(Vminibuffer_history_position, Vminibuffer_history_variable)
(Vminibuffer_prompt_properties, Vminibuffer_setup_hook)
(Vread_buffer_function, Vread_expression_map)
(completion_ignore_case, enable_recursive_minibuffers)
(history_delete_duplicates, minibuffer_allow_text_properties)
(minibuffer_auto_raise, read_buffer_completion_ignore_case):
Remove.
* marker.c (syms_of_marker): Update.
(byte_debug_flag): Remove.
* macros.c (syms_of_macros): Update.
(Vexecuting_kbd_macro, executing_kbd_macro_index): Remove.
* lread.c (syms_of_lread): Update.
(Vafter_load_alist, Vbyte_boolean_vars)
(Vbytecomp_version_regexp, Vcurrent_load_list)
(Veval_buffer_list, Vload_file_name, Vload_file_rep_suffixes)
(Vload_history, Vload_path, Vload_read_function)
(Vload_source_file_function, Vload_suffixes, Vobarray)
(Vold_style_backquotes, Vpreloaded_file_list, Vread_circle)
(Vread_symbol_positions_list, Vread_with_symbol_positions)
(Vsource_directory, Vstandard_input, Vuser_init_file, Vvalues)
(force_load_messages, load_convert_to_unibyte)
(load_dangerous_libraries, load_force_doc_strings)
(load_in_progress): Remove.
* keymap.c (syms_of_keymap): Update.
(Vdefine_key_rebound_commands, Vemulation_mode_map_alists)
(Vminibuffer_local_completion_map)
(Vminibuffer_local_filename_completion_map)
(Vminibuffer_local_filename_must_match_map)
(Vminibuffer_local_map, Vminibuffer_local_must_match_map)
(Vminibuffer_local_ns_map, Vminor_mode_map_alist)
(Vminor_mode_overriding_map_alist, Vwhere_is_preferred_modifier):
Remove.
* keyboard.c (syms_of_keyboard): Update.
(Vauto_save_timeout, Vcommand_error_function)
(Vcommand_hook_internal, Vdeactivate_mark)
(Vdeferred_action_function, Vdeferred_action_list)
(Vdisable_point_adjustment, Vdouble_click_time)
(Vecho_keystrokes, Venable_disabled_menus_and_buttons)
(Vfunction_key_map, Vglobal_disable_point_adjustment)
(Vhelp_char, Vhelp_event_list, Vhelp_form)
(Vinput_method_function, Vinput_method_previous_message)
(Vkey_translation_map, Vlast_event_frame)
(Vlucid_menu_bar_dirty_flag, Vmenu_bar_final_items)
(Vminibuffer_message_timeout, Voverriding_local_map)
(Voverriding_local_map_menu_flag, Vpost_command_hook)
(Vpre_command_hook, Vprefix_help_command)
(Vsaved_region_selection, Vselect_active_regions)
(Vshow_help_function, Vspecial_event_map, Vsuggest_key_bindings)
(Vthis_command, Vthis_command_keys_shift_translated)
(Vthis_original_command, Vthrow_on_input, Vtimer_idle_list)
(Vtimer_list, Vtool_bar_separator_image_expression, Vtop_level)
(Vtty_erase_char, Vunread_command_events)
(Vunread_input_method_events, Vunread_post_input_method_events)
(auto_save_interval, cannot_suspend, do_mouse_tracking)
(double_click_fuzz, extra_keyboard_modifiers)
(inhibit_local_menu_bar_menus, last_command_event)
(last_input_event, last_nonmenu_event, menu_prompt_more_char)
(menu_prompting, meta_prefix_char, num_input_keys)
(num_nonmacro_input_events, polling_period, unread_command_char):
Remove.
* insdel.c (syms_of_insdel): Update.
(Vcombine_after_change_calls, check_markers_debug_flag): Remove.
* indent.c (syms_of_indent): Update.
(indent_tabs_mode): Remove.
* image.c (syms_of_image): Update.
(Vimage_cache_eviction_delay, Vimage_types)
(Vimagemagick_render_type, Vmax_image_size, Vx_bitmap_file_path)
(cross_disabled_images): Remove.
* fringe.c (syms_of_fringe): Update.
(Vfringe_bitmaps, Voverflow_newline_into_fringe): Remove.
* frame.c (syms_of_frame): Update.
(Vdefault_frame_alist, Vdefault_frame_scroll_bars)
(Vdelete_frame_functions, Vframe_alpha_lower_limit)
(Vmake_pointer_invisible, Vmenu_bar_mode, Vmouse_highlight)
(Vmouse_position_function, Vterminal_frame, Vtool_bar_mode)
(Vx_resource_class, Vx_resource_name, focus_follows_mouse):
Remove.
* fontset.c (syms_of_fontset): Update.
(Valternate_fontname_alist, Vfont_encoding_charset_alist)
(Vfontset_alias_alist, Vignore_relative_composition)
(Votf_script_alist, Vuse_default_ascent)
(Vvertical_centering_font_regexp): Remove.
* font.c (syms_of_font): Update.
(Vfont_encoding_alist, Vfont_log, Vfont_slant_table)
(Vfont_weight_table, Vfont_width_table): Remove.
* fns.c (syms_of_fns): Update.
(Vfeatures, use_dialog_box, use_file_dialog): Remove.
* filelock.c (syms_of_filelock): Update.
(Vtemporary_file_directory): Remove.
* fileio.c (syms_of_fileio): Update.
(Vafter_insert_file_functions, Vauto_save_include_big_deletions)
(Vauto_save_list_file_name, Vauto_save_visited_file_name)
(Vdefault_file_name_coding_system, Vfile_name_coding_system)
(Vfile_name_handler_alist, Vinhibit_file_name_handlers)
(Vinhibit_file_name_operation, Vset_auto_coding_function)
(Vwrite_region_annotate_functions)
(Vwrite_region_annotations_so_far)
(Vwrite_region_post_annotation_function)
(delete_by_moving_to_trash, write_region_inhibit_fsync): Remove.
(Vw32_get_true_file_attributes): Remove declaration.
* eval.c (syms_of_eval): Update.
(Vdebug_ignored_errors, Vdebug_on_error, Vdebug_on_signal)
(Vdebugger, Vinhibit_quit, Vmacro_declaration_function)
(Vquit_flag, Vsignal_hook_function, Vstack_trace_on_error)
(debug_on_next_call, debug_on_quit, debugger_may_continue)
(max_lisp_eval_depth, max_specpdl_size): Remove.
* emacs.c (syms_of_emacs): Update.
(Vafter_init_time, Vbefore_init_time, Vcommand_line_args)
(Vdynamic_library_alist, Vemacs_copyright, Vemacs_version)
(Vinstallation_directory, Vinvocation_directory)
(Vinvocation_name, Vkill_emacs_hook, Vpath_separator)
(Vprevious_system_messages_locale, Vprevious_system_time_locale)
(Vsystem_configuration, Vsystem_configuration_options)
(Vsystem_messages_locale, Vsystem_time_locale, Vsystem_type)
(inhibit_x_resources, noninteractive1): Remove.
* editfns.c (syms_of_editfns): Update.
(Vbuffer_access_fontified_property)
(Vbuffer_access_fontify_functions, Vinhibit_field_text_motion)
(Voperating_system_release, Vsystem_name, Vuser_full_name)
(Vuser_login_name, Vuser_real_login_name): Remove.
* dosfns.c (syms_of_dosfns): Update.
(Vdos_display_scancodes, Vdos_version, Vdos_windows_version)
(dos_codepage, dos_country_code, dos_decimal_point)
(dos_hyper_key, dos_keyboard_layout, dos_keypad_mode)
(dos_super_key, dos_timezone_offset): Remove.
* doc.c (syms_of_doc): Update.
(Vbuild_files, Vdoc_file_name): Remove.
* dispnew.c (syms_of_display): Update.
(Vglyph_table, Vinitial_window_system)
(Vredisplay_preemption_period, Vstandard_display_table)
(Vwindow_system_version, baud_rate, cursor_in_echo_area)
(inverse_video, redisplay_dont_pause, visible_bell): Remove.
* dired.c (syms_of_dired): Update.
(Vcompletion_ignored_extensions): Remove.
(Vw32_get_true_file_attributes): Remove declaration.
* dbusbind.c (syms_of_dbusbind): Update.
(Vdbus_debug, Vdbus_registered_buses)
(Vdbus_registered_objects_table): Remove.
* data.c (syms_of_data): Update.
(Vmost_negative_fixnum, Vmost_positive_fixnum): Remove.
* composite.c (syms_of_composite): Update.
(Vauto_composition_function, Vauto_composition_mode)
(Vcompose_chars_after_function, Vcomposition_function_table):
Remove.
* coding.c (syms_of_coding): Update.
(Vcharset_revision_table, Vcoding_category_list)
(Vcoding_system_alist, Vcoding_system_for_read)
(Vcoding_system_for_write, Vcoding_system_list)
(Vdefault_process_coding_system, Venable_character_translation)
(Vfile_coding_system_alist, Vlast_code_conversion_error)
(Vlast_coding_system_used, Vlatin_extra_code_table)
(Vlocale_coding_system, Vnetwork_coding_system_alist)
(Vprocess_coding_system_alist)
(Vselect_safe_coding_system_function)
(Vstandard_translation_table_for_decode)
(Vstandard_translation_table_for_encode)
(Vtranslation_table_for_input, coding_system_require_warning)
(eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
(eol_mnemonic_unix, inherit_process_coding_system)
(inhibit_eol_conversion, inhibit_iso_escape_detection)
(inhibit_null_byte_detection): Remove.
* cmds.c (syms_of_cmds): Update.
(Vpost_self_insert_hook): Remove.
* charset.c (syms_of_charset): Update.
(Vcharset_list, Vcharset_map_path, Vcurrent_iso639_language)
(inhibit_load_charset_map): Remove.
* character.c (syms_of_character): Update.
(Vauto_fill_chars, Vchar_direction_table, Vchar_script_table)
(Vchar_width_table, Vprintable_chars)
(Vscript_representative_chars, Vtranslation_table_vector)
(Vunicode_category_table): Remove.
* ccl.c (syms_of_ccl): Update.
(Vcode_conversion_map_vector, Vfont_ccl_encoder_alist)
(Vtranslation_hash_table_vector): Remove.
* category.c (syms_of_category): Update.
(Vword_combining_categories, Vword_separating_categories): Remove.
* callproc.c (syms_of_callproc): Update.
(Vconfigure_info_directory, Vdata_directory, Vdoc_directory)
(Vexec_directory, Vexec_path, Vexec_suffixes)
(Vinitial_environment, Vprocess_environment)
(Vshared_game_score_directory, Vshell_file_name): Remove.
* callint.c (syms_of_callint): Update.
(Vcommand_debug_status, Vcommand_history, Vcurrent_prefix_arg)
(Vmark_even_if_inactive, Vmouse_leave_buffer_hook): Remove.
* bytecode.c (syms_of_bytecode): Update.
(Vbyte_code_meter, byte_metering_on): Remove.
* buffer.c (syms_of_buffer): Update.
(Vafter_change_functions, Vbefore_change_functions)
(Vchange_major_mode_hook, Vfirst_change_hook)
(Vinhibit_read_only, Vkill_buffer_query_functions)
(Vtransient_mark_mode, inhibit_modification_hooks): Remove.
* alloc.c (syms_of_alloc): Update.
(Vgc_cons_percentage, Vgc_elapsed, Vmemory_full)
(Vmemory_signal_data, Vpost_gc_hook, Vpurify_flag)
(cons_cells_consed, floats_consed, garbage_collection_messages)
(gc_cons_threshold, gcs_done, intervals_consed)
(misc_objects_consed, pure_bytes_used, string_chars_consed)
(strings_consed, symbols_consed, vector_cells_consed): Remove.
* lisp.h (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL)
(DEFVAR_INT): Assume global is in `globals'.
* alloc.c (globals): Define.
2011-01-18 20:45:37 +00:00
|
|
|
|
DEFVAR_BOOL ("system-uses-terminfo", system_uses_terminfo,
|
2001-10-17 03:16:12 +00:00
|
|
|
|
doc: /* Non-nil means the system uses terminfo rather than termcap.
|
2001-10-14 10:36:32 +00:00
|
|
|
|
This variable can be used by terminal emulator packages. */);
|
1994-04-08 06:59:55 +00:00
|
|
|
|
#ifdef TERMINFO
|
|
|
|
|
system_uses_terminfo = 1;
|
|
|
|
|
#else
|
|
|
|
|
system_uses_terminfo = 0;
|
|
|
|
|
#endif
|
1996-08-29 20:50:15 +00:00
|
|
|
|
|
Move all DEFVAR'd globals into a structure -- threading infrastructure
* globals.h: New file.
* xterm.h (Vx_pixel_size_width_font_regexp): Remove declaration.
* window.h (Vinitial_window_system, Vminibuf_scroll_window)
(Vwindow_system_version): Remove declaration.
* w32term.h (Vw32_enable_palette)
(Vx_pixel_size_width_font_regexp): Remove declaration.
* w32menu.c (Voverriding_local_map)
(Voverriding_local_map_menu_flag): Remove declaration.
* w32inevt.c (Vw32_alt_is_meta, Vw32_apps_modifier)
(Vw32_capslock_is_shiftlock, Vw32_enable_caps_lock)
(Vw32_enable_num_lock, Vw32_lwindow_modifier)
(Vw32_pass_lwindow_to_system, Vw32_pass_rwindow_to_system)
(Vw32_phantom_key_code, Vw32_recognize_altgr)
(Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
(w32_use_full_screen_buffer): Remove declaration.
* w32.c (Vsystem_configuration, Vw32_downcase_file_names)
(Vw32_generate_fake_inodes, Vw32_get_true_file_attributes)
(w32_num_mouse_buttons, w32_pipe_read_delay): Remove declaration.
* termopts.h (Vtruncate_partial_width_windows, inverse_video)
(no_redraw_on_reenter, visible_bell): Remove declaration.
* sysdep.c (Vsystem_name): Remove declaration.
* syntax.h (parse_sexp_lookup_properties): Remove declaration.
* menu.h (Vmenu_updating_frame): Remove declaration.
* macros.h (Vexecuting_kbd_macro, executing_kbd_macro_index):
Remove declaration.
* lisp.h (Vafter_init_time, Vafter_load_alist)
(Vauto_save_list_file_name, Vbefore_init_time, Vcommand_history)
(Vcompletion_regexp_list, Vcurrent_load_list)
(Vcurrent_prefix_arg, Vdata_directory, Vdebug_on_error)
(Vdoc_directory, Vdoc_file_name, Vdynamic_library_alist)
(Vexec_directory, Vexec_path, Vexec_suffixes)
(Vface_font_rescale_alist, Vface_ignored_fonts, Vfeatures)
(Vhelp_form, Vhistory_length, Vinhibit_field_text_motion)
(Vinhibit_quit, Vinhibit_read_only, Vinhibit_redisplay)
(Vinstallation_directory, Vinvocation_directory)
(Vinvocation_name, Vload_file_rep_suffixes, Vload_history)
(Vload_suffixes, Vmark_even_if_inactive, Vmemory_full)
(Vmessage_log_max, Vobarray, Vprint_length, Vprint_level)
(Vpurify_flag, Vquit_flag, Vsaved_region_selection)
(Vscalable_fonts_allowed, Vselect_active_regions)
(Vshell_file_name, Vstandard_input, Vstandard_output)
(Vsystem_name, Vtemporary_file_directory, Vthrow_on_input)
(Vtop_level, Vtty_erase_char, Vundo_outer_limit)
(Vuser_login_name, Vwindow_scroll_functions)
(Vwindow_system_version, Vx_no_window_manager)
(Vx_resource_class, Vx_resource_name, baud_rate)
(completion_ignore_case, debug_on_next_call, gc_cons_threshold)
(history_delete_duplicates, inhibit_x_resources)
(last_nonmenu_event, load_in_progress, max_specpdl_size)
(minibuffer_auto_raise, print_escape_newlines, scroll_margin)
(use_dialog_box, use_file_dialog): Remove declaration. Include
globals.h.
* keymap.h (Voverriding_local_map)
(Voverriding_local_map_menu_flag, meta_prefix_char): Remove
declaration.
* keyboard.h (Vdouble_click_time, Vfunction_key_map)
(Vinput_method_function, Vkey_translation_map)
(Vlucid_menu_bar_dirty_flag, Vthis_original_command)
(do_mouse_tracking, extra_keyboard_modifiers)
(num_nonmacro_input_events): Remove declaration.
* intervals.h (Vchar_property_alias_alist)
(Vdefault_text_properties, Vinhibit_point_motion_hooks)
(Vtext_property_default_nonsticky): Remove declaration.
* gtkutil.h (x_gtk_file_dialog_help_text)
(x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
(x_gtk_whole_detached_tool_bar): Remove declaration.
* frame.h (Vdefault_frame_alist, Vframe_alpha_lower_limit)
(Vmenu_bar_mode, Vmouse_highlight, Vterminal_frame)
(Vtool_bar_mode, Vx_resource_class, Vx_resource_name)
(focus_follows_mouse): Remove declaration.
* fontset.h (Valternate_fontname_alist, Vfontset_alias_alist)
(Vignore_relative_composition, Votf_script_alist)
(Vuse_default_ascent, Vvertical_centering_font_regexp): Remove
declaration.
* font.h (Vfont_log): Remove declaration.
* dosfns.h (Vdos_display_scancodes, Vdos_version)
(Vdos_windows_version, dos_codepage, dos_country_code)
(dos_decimal_point, dos_hyper_key, dos_keyboard_layout)
(dos_keypad_mode, dos_super_key, dos_timezone_offset): Remove
declaration.
* disptab.h (Vglyph_table, Vstandard_display_table): Remove
declaration.
* dispextern.h (Vface_remapping_alist, Vglyphless_char_display)
(Vmouse_autoselect_window, Voverflow_newline_into_fringe)
(Vshow_trailing_whitespace, Vtool_bar_button_margin)
(Vtool_bar_style, cursor_in_echo_area, display_hourglass_p)
(inverse_video, mode_line_in_non_selected_windows)
(tool_bar_button_relief, tool_bar_max_label_size)
(underline_minimum_offset)
(unibyte_display_via_language_environment, x_stretch_cursor_p):
Remove declaration.
* composite.h (Vauto_composition_function)
(Vcomposition_function_table): Remove declaration.
* commands.h (Vexecuting_kbd_macro)
(Vminibuffer_local_completion_map)
(Vminibuffer_local_filename_completion_map)
(Vminibuffer_local_filename_must_match_map)
(Vminibuffer_local_map, Vminibuffer_local_must_match_map)
(Vminibuffer_local_ns_map, Vthis_command)
(Vunread_command_events, cursor_in_echo_area)
(last_command_event, last_nonmenu_event, unread_command_char):
Remove declaration.
* coding.h (Vcoding_system_for_read, Vcoding_system_for_write)
(Vdefault_file_name_coding_system)
(Vdefault_process_coding_system, Vfile_name_coding_system)
(Vlast_coding_system_used, Vlocale_coding_system)
(Vselect_safe_coding_system_function)
(Vtranslation_table_for_input, coding_system_require_warning)
(eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
(eol_mnemonic_unix, inherit_process_coding_system): Remove
declaration.
* charset.h (Vcharset_list, Vcurrent_iso639_language): Remove
declaration.
* character.h (Vauto_fill_chars, Vchar_direction_table)
(Vchar_script_table, Vchar_width_table, Vprintable_chars)
(Vscript_representative_chars, Vtranslation_table_vector)
(Vunicode_category_table): Remove declaration.
* ccl.h (Vfont_ccl_encoder_alist): Remove declaration.
* buffer.h (Vafter_change_functions, Vbefore_change_functions)
(Vdeactivate_mark, Vfirst_change_hook, Vtransient_mark_mode)
(inhibit_modification_hooks): Remove declaration.
* xterm.c (syms_of_xterm): Update.
(Vx_alt_keysym, Vx_hyper_keysym, Vx_keysym_table)
(Vx_meta_keysym, Vx_super_keysym, Vx_toolkit_scroll_bars)
(x_mouse_click_focus_ignore_position)
(x_underline_at_descent_line)
(x_use_underline_position_properties): Remove.
* xsmfns.c (syms_of_xsmfns): Update.
(Vx_session_id, Vx_session_previous_id): Remove.
* xsettings.c (syms_of_xsettings): Update.
(Vxft_settings, use_system_font): Remove.
* xselect.c (syms_of_xselect): Update.
(Vselection_converter_alist, Vx_lost_selection_functions)
(Vx_sent_selection_functions, x_selection_timeout): Remove.
* xfns.c (syms_of_xfns): Update.
(Vgtk_version_string, Vmotif_version_string)
(Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
(Vx_max_tooltip_size, Vx_mode_pointer_shape)
(Vx_no_window_manager, Vx_nontext_pointer_shape)
(Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
(Vx_sensitive_text_pointer_shape)
(Vx_window_horizontal_drag_shape, x_gtk_file_dialog_help_text)
(x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
(x_gtk_use_system_tooltips, x_gtk_whole_detached_tool_bar):
Remove.
* xfaces.c (syms_of_xfaces): Update.
(Vface_default_stipple, Vface_font_rescale_alist)
(Vface_ignored_fonts, Vface_new_frame_defaults)
(Vface_remapping_alist, Vfont_list_limit)
(Vscalable_fonts_allowed, Vtty_defined_color_alist): Remove.
* xdisp.c (syms_of_xdisp): Update.
(Vauto_resize_tool_bars, Vblink_cursor_alist)
(Vdisplay_pixels_per_inch, Vfontification_functions)
(Vframe_title_format, Vglobal_mode_string)
(Vglyphless_char_display, Vhourglass_delay, Vhscroll_step)
(Vicon_title_format, Vinhibit_redisplay)
(Vline_number_display_limit, Vline_prefix)
(Vmax_mini_window_height, Vmenu_bar_update_hook)
(Vmenu_updating_frame, Vmessage_log_max)
(Vmouse_autoselect_window, Vnobreak_char_display)
(Voverlay_arrow_position, Voverlay_arrow_string)
(Voverlay_arrow_variable_list, Vredisplay_end_trigger_functions)
(Vresize_mini_windows, Vshow_trailing_whitespace)
(Vtool_bar_border, Vtool_bar_button_margin, Vtool_bar_style)
(Vtruncate_partial_width_windows, Vvoid_text_area_pointer)
(Vwindow_scroll_functions, Vwindow_size_change_functions)
(Vwindow_text_change_functions, Vwrap_prefix)
(auto_raise_tool_bar_buttons_p, automatic_hscrolling_p)
(debug_end_pos, display_hourglass_p, emacs_scroll_step)
(highlight_nonselected_windows, hscroll_margin)
(inhibit_eval_during_redisplay, inhibit_free_realized_faces)
(inhibit_menubar_update, inhibit_try_cursor_movement)
(inhibit_try_window_id, inhibit_try_window_reusing)
(line_number_display_limit_width)
(make_cursor_line_fully_visible_p, message_truncate_lines)
(mode_line_inverse_video, multiple_frames, overline_margin)
(scroll_conservatively, scroll_margin, tool_bar_button_relief)
(tool_bar_max_label_size, underline_minimum_offset)
(unibyte_display_via_language_environment, x_stretch_cursor_p):
Remove.
* window.c (syms_of_window): Update.
(Vminibuf_scroll_window, Vother_window_scroll_buffer)
(Vrecenter_redisplay, Vscroll_preserve_screen_position)
(Vtemp_buffer_show_function, Vwindow_configuration_change_hook)
(Vwindow_point_insertion_type, auto_window_vscroll_p)
(mode_line_in_non_selected_windows, next_screen_context_lines)
(window_min_height, window_min_width): Remove.
(scroll_margin): Remove declaration.
* w32term.c (syms_of_w32term): Update.
(Vw32_capslock_is_shiftlock, Vw32_grab_focus_on_raise)
(Vw32_recognize_altgr, Vw32_swap_mouse_buttons)
(Vx_toolkit_scroll_bars, w32_num_mouse_buttons)
(w32_use_visible_system_caret, x_underline_at_descent_line)
(x_use_underline_position_properties): Remove.
(Vcommand_line_args, Vsystem_name, extra_keyboard_modifiers):
Remove declaration.
* w32select.c (syms_of_w32select): Update.
(Vnext_selection_coding_system, Vselection_coding_system): Remove.
* w32proc.c (syms_of_ntproc): Update.
(Vw32_downcase_file_names, Vw32_generate_fake_inodes)
(Vw32_get_true_file_attributes, Vw32_quote_process_args)
(Vw32_start_process_inherit_error_mode)
(Vw32_start_process_share_console)
(Vw32_start_process_show_window, w32_pipe_read_delay): Remove.
(Vsystem_name): Remove declaration.
* w32font.c (syms_of_w32font): Update.
(Vw32_charset_info_alist): Remove.
* w32fns.c (globals_of_w32fns, syms_of_w32fns): Update.
(Vw32_alt_is_meta, Vw32_apps_modifier, Vw32_bdf_filename_alist)
(Vw32_color_map, Vw32_enable_caps_lock, Vw32_enable_num_lock)
(Vw32_enable_palette, Vw32_lwindow_modifier)
(Vw32_pass_alt_to_system, Vw32_pass_lwindow_to_system)
(Vw32_pass_rwindow_to_system, Vw32_phantom_key_code)
(Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
(Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
(Vx_max_tooltip_size, Vx_mode_pointer_shape)
(Vx_no_window_manager, Vx_nontext_pointer_shape)
(Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
(Vx_sensitive_text_pointer_shape)
(Vx_window_horizontal_drag_shape, w32_ansi_code_page)
(w32_enable_synthesized_fonts, w32_mouse_button_tolerance)
(w32_mouse_move_interval)
(w32_pass_extra_mouse_buttons_to_system)
(w32_pass_multimedia_buttons_to_system, w32_quit_key)
(w32_strict_fontnames, w32_strict_painting): Remove.
(Vhourglass_delay, Vmenu_bar_mode, Vtool_bar_mode)
(Vw32_recognize_altgr, Vwindow_system_version)
(w32_num_mouse_buttons, w32_use_visible_system_caret): Remove
declaration.
* w32console.c (syms_of_ntterm): Update.
(w32_use_full_screen_buffer): Remove.
(Vtty_defined_color_alist): Remove declaration.
* w16select.c (syms_of_win16select): Update.
(Vnext_selection_coding_system, Vselection_coding_system): Remove.
* undo.c (syms_of_undo): Update.
(Vundo_outer_limit, Vundo_outer_limit_function)
(undo_inhibit_record_point, undo_limit, undo_strong_limit):
Remove.
* textprop.c (syms_of_textprop): Update.
(Vchar_property_alias_alist, Vdefault_text_properties)
(Vinhibit_point_motion_hooks, Vtext_property_default_nonsticky):
Remove.
* terminal.c (syms_of_terminal): Update.
(Vdelete_terminal_functions, Vring_bell_function): Remove.
* term.c (syms_of_term): Update.
(Vresume_tty_functions, Vsuspend_tty_functions)
(no_redraw_on_reenter, system_uses_terminfo, visible_cursor):
Remove.
* syntax.c (syms_of_syntax): Update.
(Vfind_word_boundary_function_table, multibyte_syntax_as_symbol)
(open_paren_in_column_0_is_defun_start)
(parse_sexp_ignore_comments, parse_sexp_lookup_properties)
(words_include_escapes): Remove.
* search.c (syms_of_search): Update.
(Vinhibit_changing_match_data, Vsearch_spaces_regexp): Remove.
* process.c (syms_of_process): Update.
(Vprocess_adaptive_read_buffering, Vprocess_connection_type)
(delete_exited_processes): Remove.
* print.c (syms_of_print): Update.
(Vfloat_output_format, Vprint_charset_text_property)
(Vprint_circle, Vprint_continuous_numbering, Vprint_gensym)
(Vprint_length, Vprint_level, Vprint_number_table)
(Vstandard_output, print_escape_multibyte)
(print_escape_newlines, print_escape_nonascii, print_quoted):
Remove.
* msdos.c (syms_of_msdos): Update.
(Vdos_unsupported_char_glyph): Remove.
(unibyte_display_via_language_environment): Remove declaration.
* minibuf.c (syms_of_minibuf): Update.
(Vcompletion_regexp_list, Vhistory_add_new_input)
(Vhistory_length, Vminibuffer_completing_file_name)
(Vminibuffer_completion_confirm)
(Vminibuffer_completion_predicate, Vminibuffer_completion_table)
(Vminibuffer_exit_hook, Vminibuffer_help_form)
(Vminibuffer_history_position, Vminibuffer_history_variable)
(Vminibuffer_prompt_properties, Vminibuffer_setup_hook)
(Vread_buffer_function, Vread_expression_map)
(completion_ignore_case, enable_recursive_minibuffers)
(history_delete_duplicates, minibuffer_allow_text_properties)
(minibuffer_auto_raise, read_buffer_completion_ignore_case):
Remove.
* marker.c (syms_of_marker): Update.
(byte_debug_flag): Remove.
* macros.c (syms_of_macros): Update.
(Vexecuting_kbd_macro, executing_kbd_macro_index): Remove.
* lread.c (syms_of_lread): Update.
(Vafter_load_alist, Vbyte_boolean_vars)
(Vbytecomp_version_regexp, Vcurrent_load_list)
(Veval_buffer_list, Vload_file_name, Vload_file_rep_suffixes)
(Vload_history, Vload_path, Vload_read_function)
(Vload_source_file_function, Vload_suffixes, Vobarray)
(Vold_style_backquotes, Vpreloaded_file_list, Vread_circle)
(Vread_symbol_positions_list, Vread_with_symbol_positions)
(Vsource_directory, Vstandard_input, Vuser_init_file, Vvalues)
(force_load_messages, load_convert_to_unibyte)
(load_dangerous_libraries, load_force_doc_strings)
(load_in_progress): Remove.
* keymap.c (syms_of_keymap): Update.
(Vdefine_key_rebound_commands, Vemulation_mode_map_alists)
(Vminibuffer_local_completion_map)
(Vminibuffer_local_filename_completion_map)
(Vminibuffer_local_filename_must_match_map)
(Vminibuffer_local_map, Vminibuffer_local_must_match_map)
(Vminibuffer_local_ns_map, Vminor_mode_map_alist)
(Vminor_mode_overriding_map_alist, Vwhere_is_preferred_modifier):
Remove.
* keyboard.c (syms_of_keyboard): Update.
(Vauto_save_timeout, Vcommand_error_function)
(Vcommand_hook_internal, Vdeactivate_mark)
(Vdeferred_action_function, Vdeferred_action_list)
(Vdisable_point_adjustment, Vdouble_click_time)
(Vecho_keystrokes, Venable_disabled_menus_and_buttons)
(Vfunction_key_map, Vglobal_disable_point_adjustment)
(Vhelp_char, Vhelp_event_list, Vhelp_form)
(Vinput_method_function, Vinput_method_previous_message)
(Vkey_translation_map, Vlast_event_frame)
(Vlucid_menu_bar_dirty_flag, Vmenu_bar_final_items)
(Vminibuffer_message_timeout, Voverriding_local_map)
(Voverriding_local_map_menu_flag, Vpost_command_hook)
(Vpre_command_hook, Vprefix_help_command)
(Vsaved_region_selection, Vselect_active_regions)
(Vshow_help_function, Vspecial_event_map, Vsuggest_key_bindings)
(Vthis_command, Vthis_command_keys_shift_translated)
(Vthis_original_command, Vthrow_on_input, Vtimer_idle_list)
(Vtimer_list, Vtool_bar_separator_image_expression, Vtop_level)
(Vtty_erase_char, Vunread_command_events)
(Vunread_input_method_events, Vunread_post_input_method_events)
(auto_save_interval, cannot_suspend, do_mouse_tracking)
(double_click_fuzz, extra_keyboard_modifiers)
(inhibit_local_menu_bar_menus, last_command_event)
(last_input_event, last_nonmenu_event, menu_prompt_more_char)
(menu_prompting, meta_prefix_char, num_input_keys)
(num_nonmacro_input_events, polling_period, unread_command_char):
Remove.
* insdel.c (syms_of_insdel): Update.
(Vcombine_after_change_calls, check_markers_debug_flag): Remove.
* indent.c (syms_of_indent): Update.
(indent_tabs_mode): Remove.
* image.c (syms_of_image): Update.
(Vimage_cache_eviction_delay, Vimage_types)
(Vimagemagick_render_type, Vmax_image_size, Vx_bitmap_file_path)
(cross_disabled_images): Remove.
* fringe.c (syms_of_fringe): Update.
(Vfringe_bitmaps, Voverflow_newline_into_fringe): Remove.
* frame.c (syms_of_frame): Update.
(Vdefault_frame_alist, Vdefault_frame_scroll_bars)
(Vdelete_frame_functions, Vframe_alpha_lower_limit)
(Vmake_pointer_invisible, Vmenu_bar_mode, Vmouse_highlight)
(Vmouse_position_function, Vterminal_frame, Vtool_bar_mode)
(Vx_resource_class, Vx_resource_name, focus_follows_mouse):
Remove.
* fontset.c (syms_of_fontset): Update.
(Valternate_fontname_alist, Vfont_encoding_charset_alist)
(Vfontset_alias_alist, Vignore_relative_composition)
(Votf_script_alist, Vuse_default_ascent)
(Vvertical_centering_font_regexp): Remove.
* font.c (syms_of_font): Update.
(Vfont_encoding_alist, Vfont_log, Vfont_slant_table)
(Vfont_weight_table, Vfont_width_table): Remove.
* fns.c (syms_of_fns): Update.
(Vfeatures, use_dialog_box, use_file_dialog): Remove.
* filelock.c (syms_of_filelock): Update.
(Vtemporary_file_directory): Remove.
* fileio.c (syms_of_fileio): Update.
(Vafter_insert_file_functions, Vauto_save_include_big_deletions)
(Vauto_save_list_file_name, Vauto_save_visited_file_name)
(Vdefault_file_name_coding_system, Vfile_name_coding_system)
(Vfile_name_handler_alist, Vinhibit_file_name_handlers)
(Vinhibit_file_name_operation, Vset_auto_coding_function)
(Vwrite_region_annotate_functions)
(Vwrite_region_annotations_so_far)
(Vwrite_region_post_annotation_function)
(delete_by_moving_to_trash, write_region_inhibit_fsync): Remove.
(Vw32_get_true_file_attributes): Remove declaration.
* eval.c (syms_of_eval): Update.
(Vdebug_ignored_errors, Vdebug_on_error, Vdebug_on_signal)
(Vdebugger, Vinhibit_quit, Vmacro_declaration_function)
(Vquit_flag, Vsignal_hook_function, Vstack_trace_on_error)
(debug_on_next_call, debug_on_quit, debugger_may_continue)
(max_lisp_eval_depth, max_specpdl_size): Remove.
* emacs.c (syms_of_emacs): Update.
(Vafter_init_time, Vbefore_init_time, Vcommand_line_args)
(Vdynamic_library_alist, Vemacs_copyright, Vemacs_version)
(Vinstallation_directory, Vinvocation_directory)
(Vinvocation_name, Vkill_emacs_hook, Vpath_separator)
(Vprevious_system_messages_locale, Vprevious_system_time_locale)
(Vsystem_configuration, Vsystem_configuration_options)
(Vsystem_messages_locale, Vsystem_time_locale, Vsystem_type)
(inhibit_x_resources, noninteractive1): Remove.
* editfns.c (syms_of_editfns): Update.
(Vbuffer_access_fontified_property)
(Vbuffer_access_fontify_functions, Vinhibit_field_text_motion)
(Voperating_system_release, Vsystem_name, Vuser_full_name)
(Vuser_login_name, Vuser_real_login_name): Remove.
* dosfns.c (syms_of_dosfns): Update.
(Vdos_display_scancodes, Vdos_version, Vdos_windows_version)
(dos_codepage, dos_country_code, dos_decimal_point)
(dos_hyper_key, dos_keyboard_layout, dos_keypad_mode)
(dos_super_key, dos_timezone_offset): Remove.
* doc.c (syms_of_doc): Update.
(Vbuild_files, Vdoc_file_name): Remove.
* dispnew.c (syms_of_display): Update.
(Vglyph_table, Vinitial_window_system)
(Vredisplay_preemption_period, Vstandard_display_table)
(Vwindow_system_version, baud_rate, cursor_in_echo_area)
(inverse_video, redisplay_dont_pause, visible_bell): Remove.
* dired.c (syms_of_dired): Update.
(Vcompletion_ignored_extensions): Remove.
(Vw32_get_true_file_attributes): Remove declaration.
* dbusbind.c (syms_of_dbusbind): Update.
(Vdbus_debug, Vdbus_registered_buses)
(Vdbus_registered_objects_table): Remove.
* data.c (syms_of_data): Update.
(Vmost_negative_fixnum, Vmost_positive_fixnum): Remove.
* composite.c (syms_of_composite): Update.
(Vauto_composition_function, Vauto_composition_mode)
(Vcompose_chars_after_function, Vcomposition_function_table):
Remove.
* coding.c (syms_of_coding): Update.
(Vcharset_revision_table, Vcoding_category_list)
(Vcoding_system_alist, Vcoding_system_for_read)
(Vcoding_system_for_write, Vcoding_system_list)
(Vdefault_process_coding_system, Venable_character_translation)
(Vfile_coding_system_alist, Vlast_code_conversion_error)
(Vlast_coding_system_used, Vlatin_extra_code_table)
(Vlocale_coding_system, Vnetwork_coding_system_alist)
(Vprocess_coding_system_alist)
(Vselect_safe_coding_system_function)
(Vstandard_translation_table_for_decode)
(Vstandard_translation_table_for_encode)
(Vtranslation_table_for_input, coding_system_require_warning)
(eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
(eol_mnemonic_unix, inherit_process_coding_system)
(inhibit_eol_conversion, inhibit_iso_escape_detection)
(inhibit_null_byte_detection): Remove.
* cmds.c (syms_of_cmds): Update.
(Vpost_self_insert_hook): Remove.
* charset.c (syms_of_charset): Update.
(Vcharset_list, Vcharset_map_path, Vcurrent_iso639_language)
(inhibit_load_charset_map): Remove.
* character.c (syms_of_character): Update.
(Vauto_fill_chars, Vchar_direction_table, Vchar_script_table)
(Vchar_width_table, Vprintable_chars)
(Vscript_representative_chars, Vtranslation_table_vector)
(Vunicode_category_table): Remove.
* ccl.c (syms_of_ccl): Update.
(Vcode_conversion_map_vector, Vfont_ccl_encoder_alist)
(Vtranslation_hash_table_vector): Remove.
* category.c (syms_of_category): Update.
(Vword_combining_categories, Vword_separating_categories): Remove.
* callproc.c (syms_of_callproc): Update.
(Vconfigure_info_directory, Vdata_directory, Vdoc_directory)
(Vexec_directory, Vexec_path, Vexec_suffixes)
(Vinitial_environment, Vprocess_environment)
(Vshared_game_score_directory, Vshell_file_name): Remove.
* callint.c (syms_of_callint): Update.
(Vcommand_debug_status, Vcommand_history, Vcurrent_prefix_arg)
(Vmark_even_if_inactive, Vmouse_leave_buffer_hook): Remove.
* bytecode.c (syms_of_bytecode): Update.
(Vbyte_code_meter, byte_metering_on): Remove.
* buffer.c (syms_of_buffer): Update.
(Vafter_change_functions, Vbefore_change_functions)
(Vchange_major_mode_hook, Vfirst_change_hook)
(Vinhibit_read_only, Vkill_buffer_query_functions)
(Vtransient_mark_mode, inhibit_modification_hooks): Remove.
* alloc.c (syms_of_alloc): Update.
(Vgc_cons_percentage, Vgc_elapsed, Vmemory_full)
(Vmemory_signal_data, Vpost_gc_hook, Vpurify_flag)
(cons_cells_consed, floats_consed, garbage_collection_messages)
(gc_cons_threshold, gcs_done, intervals_consed)
(misc_objects_consed, pure_bytes_used, string_chars_consed)
(strings_consed, symbols_consed, vector_cells_consed): Remove.
* lisp.h (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL)
(DEFVAR_INT): Assume global is in `globals'.
* alloc.c (globals): Define.
2011-01-18 20:45:37 +00:00
|
|
|
|
DEFVAR_LISP ("suspend-tty-functions", Vsuspend_tty_functions,
|
2012-08-05 07:45:12 +00:00
|
|
|
|
doc: /* Functions run after suspending a tty.
|
2009-04-22 03:51:25 +00:00
|
|
|
|
The functions are run with one argument, the terminal object to be suspended.
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
See `suspend-tty'. */);
|
2007-09-04 23:28:49 +00:00
|
|
|
|
Vsuspend_tty_functions = Qnil;
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
|
|
|
|
|
|
Move all DEFVAR'd globals into a structure -- threading infrastructure
* globals.h: New file.
* xterm.h (Vx_pixel_size_width_font_regexp): Remove declaration.
* window.h (Vinitial_window_system, Vminibuf_scroll_window)
(Vwindow_system_version): Remove declaration.
* w32term.h (Vw32_enable_palette)
(Vx_pixel_size_width_font_regexp): Remove declaration.
* w32menu.c (Voverriding_local_map)
(Voverriding_local_map_menu_flag): Remove declaration.
* w32inevt.c (Vw32_alt_is_meta, Vw32_apps_modifier)
(Vw32_capslock_is_shiftlock, Vw32_enable_caps_lock)
(Vw32_enable_num_lock, Vw32_lwindow_modifier)
(Vw32_pass_lwindow_to_system, Vw32_pass_rwindow_to_system)
(Vw32_phantom_key_code, Vw32_recognize_altgr)
(Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
(w32_use_full_screen_buffer): Remove declaration.
* w32.c (Vsystem_configuration, Vw32_downcase_file_names)
(Vw32_generate_fake_inodes, Vw32_get_true_file_attributes)
(w32_num_mouse_buttons, w32_pipe_read_delay): Remove declaration.
* termopts.h (Vtruncate_partial_width_windows, inverse_video)
(no_redraw_on_reenter, visible_bell): Remove declaration.
* sysdep.c (Vsystem_name): Remove declaration.
* syntax.h (parse_sexp_lookup_properties): Remove declaration.
* menu.h (Vmenu_updating_frame): Remove declaration.
* macros.h (Vexecuting_kbd_macro, executing_kbd_macro_index):
Remove declaration.
* lisp.h (Vafter_init_time, Vafter_load_alist)
(Vauto_save_list_file_name, Vbefore_init_time, Vcommand_history)
(Vcompletion_regexp_list, Vcurrent_load_list)
(Vcurrent_prefix_arg, Vdata_directory, Vdebug_on_error)
(Vdoc_directory, Vdoc_file_name, Vdynamic_library_alist)
(Vexec_directory, Vexec_path, Vexec_suffixes)
(Vface_font_rescale_alist, Vface_ignored_fonts, Vfeatures)
(Vhelp_form, Vhistory_length, Vinhibit_field_text_motion)
(Vinhibit_quit, Vinhibit_read_only, Vinhibit_redisplay)
(Vinstallation_directory, Vinvocation_directory)
(Vinvocation_name, Vload_file_rep_suffixes, Vload_history)
(Vload_suffixes, Vmark_even_if_inactive, Vmemory_full)
(Vmessage_log_max, Vobarray, Vprint_length, Vprint_level)
(Vpurify_flag, Vquit_flag, Vsaved_region_selection)
(Vscalable_fonts_allowed, Vselect_active_regions)
(Vshell_file_name, Vstandard_input, Vstandard_output)
(Vsystem_name, Vtemporary_file_directory, Vthrow_on_input)
(Vtop_level, Vtty_erase_char, Vundo_outer_limit)
(Vuser_login_name, Vwindow_scroll_functions)
(Vwindow_system_version, Vx_no_window_manager)
(Vx_resource_class, Vx_resource_name, baud_rate)
(completion_ignore_case, debug_on_next_call, gc_cons_threshold)
(history_delete_duplicates, inhibit_x_resources)
(last_nonmenu_event, load_in_progress, max_specpdl_size)
(minibuffer_auto_raise, print_escape_newlines, scroll_margin)
(use_dialog_box, use_file_dialog): Remove declaration. Include
globals.h.
* keymap.h (Voverriding_local_map)
(Voverriding_local_map_menu_flag, meta_prefix_char): Remove
declaration.
* keyboard.h (Vdouble_click_time, Vfunction_key_map)
(Vinput_method_function, Vkey_translation_map)
(Vlucid_menu_bar_dirty_flag, Vthis_original_command)
(do_mouse_tracking, extra_keyboard_modifiers)
(num_nonmacro_input_events): Remove declaration.
* intervals.h (Vchar_property_alias_alist)
(Vdefault_text_properties, Vinhibit_point_motion_hooks)
(Vtext_property_default_nonsticky): Remove declaration.
* gtkutil.h (x_gtk_file_dialog_help_text)
(x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
(x_gtk_whole_detached_tool_bar): Remove declaration.
* frame.h (Vdefault_frame_alist, Vframe_alpha_lower_limit)
(Vmenu_bar_mode, Vmouse_highlight, Vterminal_frame)
(Vtool_bar_mode, Vx_resource_class, Vx_resource_name)
(focus_follows_mouse): Remove declaration.
* fontset.h (Valternate_fontname_alist, Vfontset_alias_alist)
(Vignore_relative_composition, Votf_script_alist)
(Vuse_default_ascent, Vvertical_centering_font_regexp): Remove
declaration.
* font.h (Vfont_log): Remove declaration.
* dosfns.h (Vdos_display_scancodes, Vdos_version)
(Vdos_windows_version, dos_codepage, dos_country_code)
(dos_decimal_point, dos_hyper_key, dos_keyboard_layout)
(dos_keypad_mode, dos_super_key, dos_timezone_offset): Remove
declaration.
* disptab.h (Vglyph_table, Vstandard_display_table): Remove
declaration.
* dispextern.h (Vface_remapping_alist, Vglyphless_char_display)
(Vmouse_autoselect_window, Voverflow_newline_into_fringe)
(Vshow_trailing_whitespace, Vtool_bar_button_margin)
(Vtool_bar_style, cursor_in_echo_area, display_hourglass_p)
(inverse_video, mode_line_in_non_selected_windows)
(tool_bar_button_relief, tool_bar_max_label_size)
(underline_minimum_offset)
(unibyte_display_via_language_environment, x_stretch_cursor_p):
Remove declaration.
* composite.h (Vauto_composition_function)
(Vcomposition_function_table): Remove declaration.
* commands.h (Vexecuting_kbd_macro)
(Vminibuffer_local_completion_map)
(Vminibuffer_local_filename_completion_map)
(Vminibuffer_local_filename_must_match_map)
(Vminibuffer_local_map, Vminibuffer_local_must_match_map)
(Vminibuffer_local_ns_map, Vthis_command)
(Vunread_command_events, cursor_in_echo_area)
(last_command_event, last_nonmenu_event, unread_command_char):
Remove declaration.
* coding.h (Vcoding_system_for_read, Vcoding_system_for_write)
(Vdefault_file_name_coding_system)
(Vdefault_process_coding_system, Vfile_name_coding_system)
(Vlast_coding_system_used, Vlocale_coding_system)
(Vselect_safe_coding_system_function)
(Vtranslation_table_for_input, coding_system_require_warning)
(eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
(eol_mnemonic_unix, inherit_process_coding_system): Remove
declaration.
* charset.h (Vcharset_list, Vcurrent_iso639_language): Remove
declaration.
* character.h (Vauto_fill_chars, Vchar_direction_table)
(Vchar_script_table, Vchar_width_table, Vprintable_chars)
(Vscript_representative_chars, Vtranslation_table_vector)
(Vunicode_category_table): Remove declaration.
* ccl.h (Vfont_ccl_encoder_alist): Remove declaration.
* buffer.h (Vafter_change_functions, Vbefore_change_functions)
(Vdeactivate_mark, Vfirst_change_hook, Vtransient_mark_mode)
(inhibit_modification_hooks): Remove declaration.
* xterm.c (syms_of_xterm): Update.
(Vx_alt_keysym, Vx_hyper_keysym, Vx_keysym_table)
(Vx_meta_keysym, Vx_super_keysym, Vx_toolkit_scroll_bars)
(x_mouse_click_focus_ignore_position)
(x_underline_at_descent_line)
(x_use_underline_position_properties): Remove.
* xsmfns.c (syms_of_xsmfns): Update.
(Vx_session_id, Vx_session_previous_id): Remove.
* xsettings.c (syms_of_xsettings): Update.
(Vxft_settings, use_system_font): Remove.
* xselect.c (syms_of_xselect): Update.
(Vselection_converter_alist, Vx_lost_selection_functions)
(Vx_sent_selection_functions, x_selection_timeout): Remove.
* xfns.c (syms_of_xfns): Update.
(Vgtk_version_string, Vmotif_version_string)
(Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
(Vx_max_tooltip_size, Vx_mode_pointer_shape)
(Vx_no_window_manager, Vx_nontext_pointer_shape)
(Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
(Vx_sensitive_text_pointer_shape)
(Vx_window_horizontal_drag_shape, x_gtk_file_dialog_help_text)
(x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
(x_gtk_use_system_tooltips, x_gtk_whole_detached_tool_bar):
Remove.
* xfaces.c (syms_of_xfaces): Update.
(Vface_default_stipple, Vface_font_rescale_alist)
(Vface_ignored_fonts, Vface_new_frame_defaults)
(Vface_remapping_alist, Vfont_list_limit)
(Vscalable_fonts_allowed, Vtty_defined_color_alist): Remove.
* xdisp.c (syms_of_xdisp): Update.
(Vauto_resize_tool_bars, Vblink_cursor_alist)
(Vdisplay_pixels_per_inch, Vfontification_functions)
(Vframe_title_format, Vglobal_mode_string)
(Vglyphless_char_display, Vhourglass_delay, Vhscroll_step)
(Vicon_title_format, Vinhibit_redisplay)
(Vline_number_display_limit, Vline_prefix)
(Vmax_mini_window_height, Vmenu_bar_update_hook)
(Vmenu_updating_frame, Vmessage_log_max)
(Vmouse_autoselect_window, Vnobreak_char_display)
(Voverlay_arrow_position, Voverlay_arrow_string)
(Voverlay_arrow_variable_list, Vredisplay_end_trigger_functions)
(Vresize_mini_windows, Vshow_trailing_whitespace)
(Vtool_bar_border, Vtool_bar_button_margin, Vtool_bar_style)
(Vtruncate_partial_width_windows, Vvoid_text_area_pointer)
(Vwindow_scroll_functions, Vwindow_size_change_functions)
(Vwindow_text_change_functions, Vwrap_prefix)
(auto_raise_tool_bar_buttons_p, automatic_hscrolling_p)
(debug_end_pos, display_hourglass_p, emacs_scroll_step)
(highlight_nonselected_windows, hscroll_margin)
(inhibit_eval_during_redisplay, inhibit_free_realized_faces)
(inhibit_menubar_update, inhibit_try_cursor_movement)
(inhibit_try_window_id, inhibit_try_window_reusing)
(line_number_display_limit_width)
(make_cursor_line_fully_visible_p, message_truncate_lines)
(mode_line_inverse_video, multiple_frames, overline_margin)
(scroll_conservatively, scroll_margin, tool_bar_button_relief)
(tool_bar_max_label_size, underline_minimum_offset)
(unibyte_display_via_language_environment, x_stretch_cursor_p):
Remove.
* window.c (syms_of_window): Update.
(Vminibuf_scroll_window, Vother_window_scroll_buffer)
(Vrecenter_redisplay, Vscroll_preserve_screen_position)
(Vtemp_buffer_show_function, Vwindow_configuration_change_hook)
(Vwindow_point_insertion_type, auto_window_vscroll_p)
(mode_line_in_non_selected_windows, next_screen_context_lines)
(window_min_height, window_min_width): Remove.
(scroll_margin): Remove declaration.
* w32term.c (syms_of_w32term): Update.
(Vw32_capslock_is_shiftlock, Vw32_grab_focus_on_raise)
(Vw32_recognize_altgr, Vw32_swap_mouse_buttons)
(Vx_toolkit_scroll_bars, w32_num_mouse_buttons)
(w32_use_visible_system_caret, x_underline_at_descent_line)
(x_use_underline_position_properties): Remove.
(Vcommand_line_args, Vsystem_name, extra_keyboard_modifiers):
Remove declaration.
* w32select.c (syms_of_w32select): Update.
(Vnext_selection_coding_system, Vselection_coding_system): Remove.
* w32proc.c (syms_of_ntproc): Update.
(Vw32_downcase_file_names, Vw32_generate_fake_inodes)
(Vw32_get_true_file_attributes, Vw32_quote_process_args)
(Vw32_start_process_inherit_error_mode)
(Vw32_start_process_share_console)
(Vw32_start_process_show_window, w32_pipe_read_delay): Remove.
(Vsystem_name): Remove declaration.
* w32font.c (syms_of_w32font): Update.
(Vw32_charset_info_alist): Remove.
* w32fns.c (globals_of_w32fns, syms_of_w32fns): Update.
(Vw32_alt_is_meta, Vw32_apps_modifier, Vw32_bdf_filename_alist)
(Vw32_color_map, Vw32_enable_caps_lock, Vw32_enable_num_lock)
(Vw32_enable_palette, Vw32_lwindow_modifier)
(Vw32_pass_alt_to_system, Vw32_pass_lwindow_to_system)
(Vw32_pass_rwindow_to_system, Vw32_phantom_key_code)
(Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
(Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
(Vx_max_tooltip_size, Vx_mode_pointer_shape)
(Vx_no_window_manager, Vx_nontext_pointer_shape)
(Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
(Vx_sensitive_text_pointer_shape)
(Vx_window_horizontal_drag_shape, w32_ansi_code_page)
(w32_enable_synthesized_fonts, w32_mouse_button_tolerance)
(w32_mouse_move_interval)
(w32_pass_extra_mouse_buttons_to_system)
(w32_pass_multimedia_buttons_to_system, w32_quit_key)
(w32_strict_fontnames, w32_strict_painting): Remove.
(Vhourglass_delay, Vmenu_bar_mode, Vtool_bar_mode)
(Vw32_recognize_altgr, Vwindow_system_version)
(w32_num_mouse_buttons, w32_use_visible_system_caret): Remove
declaration.
* w32console.c (syms_of_ntterm): Update.
(w32_use_full_screen_buffer): Remove.
(Vtty_defined_color_alist): Remove declaration.
* w16select.c (syms_of_win16select): Update.
(Vnext_selection_coding_system, Vselection_coding_system): Remove.
* undo.c (syms_of_undo): Update.
(Vundo_outer_limit, Vundo_outer_limit_function)
(undo_inhibit_record_point, undo_limit, undo_strong_limit):
Remove.
* textprop.c (syms_of_textprop): Update.
(Vchar_property_alias_alist, Vdefault_text_properties)
(Vinhibit_point_motion_hooks, Vtext_property_default_nonsticky):
Remove.
* terminal.c (syms_of_terminal): Update.
(Vdelete_terminal_functions, Vring_bell_function): Remove.
* term.c (syms_of_term): Update.
(Vresume_tty_functions, Vsuspend_tty_functions)
(no_redraw_on_reenter, system_uses_terminfo, visible_cursor):
Remove.
* syntax.c (syms_of_syntax): Update.
(Vfind_word_boundary_function_table, multibyte_syntax_as_symbol)
(open_paren_in_column_0_is_defun_start)
(parse_sexp_ignore_comments, parse_sexp_lookup_properties)
(words_include_escapes): Remove.
* search.c (syms_of_search): Update.
(Vinhibit_changing_match_data, Vsearch_spaces_regexp): Remove.
* process.c (syms_of_process): Update.
(Vprocess_adaptive_read_buffering, Vprocess_connection_type)
(delete_exited_processes): Remove.
* print.c (syms_of_print): Update.
(Vfloat_output_format, Vprint_charset_text_property)
(Vprint_circle, Vprint_continuous_numbering, Vprint_gensym)
(Vprint_length, Vprint_level, Vprint_number_table)
(Vstandard_output, print_escape_multibyte)
(print_escape_newlines, print_escape_nonascii, print_quoted):
Remove.
* msdos.c (syms_of_msdos): Update.
(Vdos_unsupported_char_glyph): Remove.
(unibyte_display_via_language_environment): Remove declaration.
* minibuf.c (syms_of_minibuf): Update.
(Vcompletion_regexp_list, Vhistory_add_new_input)
(Vhistory_length, Vminibuffer_completing_file_name)
(Vminibuffer_completion_confirm)
(Vminibuffer_completion_predicate, Vminibuffer_completion_table)
(Vminibuffer_exit_hook, Vminibuffer_help_form)
(Vminibuffer_history_position, Vminibuffer_history_variable)
(Vminibuffer_prompt_properties, Vminibuffer_setup_hook)
(Vread_buffer_function, Vread_expression_map)
(completion_ignore_case, enable_recursive_minibuffers)
(history_delete_duplicates, minibuffer_allow_text_properties)
(minibuffer_auto_raise, read_buffer_completion_ignore_case):
Remove.
* marker.c (syms_of_marker): Update.
(byte_debug_flag): Remove.
* macros.c (syms_of_macros): Update.
(Vexecuting_kbd_macro, executing_kbd_macro_index): Remove.
* lread.c (syms_of_lread): Update.
(Vafter_load_alist, Vbyte_boolean_vars)
(Vbytecomp_version_regexp, Vcurrent_load_list)
(Veval_buffer_list, Vload_file_name, Vload_file_rep_suffixes)
(Vload_history, Vload_path, Vload_read_function)
(Vload_source_file_function, Vload_suffixes, Vobarray)
(Vold_style_backquotes, Vpreloaded_file_list, Vread_circle)
(Vread_symbol_positions_list, Vread_with_symbol_positions)
(Vsource_directory, Vstandard_input, Vuser_init_file, Vvalues)
(force_load_messages, load_convert_to_unibyte)
(load_dangerous_libraries, load_force_doc_strings)
(load_in_progress): Remove.
* keymap.c (syms_of_keymap): Update.
(Vdefine_key_rebound_commands, Vemulation_mode_map_alists)
(Vminibuffer_local_completion_map)
(Vminibuffer_local_filename_completion_map)
(Vminibuffer_local_filename_must_match_map)
(Vminibuffer_local_map, Vminibuffer_local_must_match_map)
(Vminibuffer_local_ns_map, Vminor_mode_map_alist)
(Vminor_mode_overriding_map_alist, Vwhere_is_preferred_modifier):
Remove.
* keyboard.c (syms_of_keyboard): Update.
(Vauto_save_timeout, Vcommand_error_function)
(Vcommand_hook_internal, Vdeactivate_mark)
(Vdeferred_action_function, Vdeferred_action_list)
(Vdisable_point_adjustment, Vdouble_click_time)
(Vecho_keystrokes, Venable_disabled_menus_and_buttons)
(Vfunction_key_map, Vglobal_disable_point_adjustment)
(Vhelp_char, Vhelp_event_list, Vhelp_form)
(Vinput_method_function, Vinput_method_previous_message)
(Vkey_translation_map, Vlast_event_frame)
(Vlucid_menu_bar_dirty_flag, Vmenu_bar_final_items)
(Vminibuffer_message_timeout, Voverriding_local_map)
(Voverriding_local_map_menu_flag, Vpost_command_hook)
(Vpre_command_hook, Vprefix_help_command)
(Vsaved_region_selection, Vselect_active_regions)
(Vshow_help_function, Vspecial_event_map, Vsuggest_key_bindings)
(Vthis_command, Vthis_command_keys_shift_translated)
(Vthis_original_command, Vthrow_on_input, Vtimer_idle_list)
(Vtimer_list, Vtool_bar_separator_image_expression, Vtop_level)
(Vtty_erase_char, Vunread_command_events)
(Vunread_input_method_events, Vunread_post_input_method_events)
(auto_save_interval, cannot_suspend, do_mouse_tracking)
(double_click_fuzz, extra_keyboard_modifiers)
(inhibit_local_menu_bar_menus, last_command_event)
(last_input_event, last_nonmenu_event, menu_prompt_more_char)
(menu_prompting, meta_prefix_char, num_input_keys)
(num_nonmacro_input_events, polling_period, unread_command_char):
Remove.
* insdel.c (syms_of_insdel): Update.
(Vcombine_after_change_calls, check_markers_debug_flag): Remove.
* indent.c (syms_of_indent): Update.
(indent_tabs_mode): Remove.
* image.c (syms_of_image): Update.
(Vimage_cache_eviction_delay, Vimage_types)
(Vimagemagick_render_type, Vmax_image_size, Vx_bitmap_file_path)
(cross_disabled_images): Remove.
* fringe.c (syms_of_fringe): Update.
(Vfringe_bitmaps, Voverflow_newline_into_fringe): Remove.
* frame.c (syms_of_frame): Update.
(Vdefault_frame_alist, Vdefault_frame_scroll_bars)
(Vdelete_frame_functions, Vframe_alpha_lower_limit)
(Vmake_pointer_invisible, Vmenu_bar_mode, Vmouse_highlight)
(Vmouse_position_function, Vterminal_frame, Vtool_bar_mode)
(Vx_resource_class, Vx_resource_name, focus_follows_mouse):
Remove.
* fontset.c (syms_of_fontset): Update.
(Valternate_fontname_alist, Vfont_encoding_charset_alist)
(Vfontset_alias_alist, Vignore_relative_composition)
(Votf_script_alist, Vuse_default_ascent)
(Vvertical_centering_font_regexp): Remove.
* font.c (syms_of_font): Update.
(Vfont_encoding_alist, Vfont_log, Vfont_slant_table)
(Vfont_weight_table, Vfont_width_table): Remove.
* fns.c (syms_of_fns): Update.
(Vfeatures, use_dialog_box, use_file_dialog): Remove.
* filelock.c (syms_of_filelock): Update.
(Vtemporary_file_directory): Remove.
* fileio.c (syms_of_fileio): Update.
(Vafter_insert_file_functions, Vauto_save_include_big_deletions)
(Vauto_save_list_file_name, Vauto_save_visited_file_name)
(Vdefault_file_name_coding_system, Vfile_name_coding_system)
(Vfile_name_handler_alist, Vinhibit_file_name_handlers)
(Vinhibit_file_name_operation, Vset_auto_coding_function)
(Vwrite_region_annotate_functions)
(Vwrite_region_annotations_so_far)
(Vwrite_region_post_annotation_function)
(delete_by_moving_to_trash, write_region_inhibit_fsync): Remove.
(Vw32_get_true_file_attributes): Remove declaration.
* eval.c (syms_of_eval): Update.
(Vdebug_ignored_errors, Vdebug_on_error, Vdebug_on_signal)
(Vdebugger, Vinhibit_quit, Vmacro_declaration_function)
(Vquit_flag, Vsignal_hook_function, Vstack_trace_on_error)
(debug_on_next_call, debug_on_quit, debugger_may_continue)
(max_lisp_eval_depth, max_specpdl_size): Remove.
* emacs.c (syms_of_emacs): Update.
(Vafter_init_time, Vbefore_init_time, Vcommand_line_args)
(Vdynamic_library_alist, Vemacs_copyright, Vemacs_version)
(Vinstallation_directory, Vinvocation_directory)
(Vinvocation_name, Vkill_emacs_hook, Vpath_separator)
(Vprevious_system_messages_locale, Vprevious_system_time_locale)
(Vsystem_configuration, Vsystem_configuration_options)
(Vsystem_messages_locale, Vsystem_time_locale, Vsystem_type)
(inhibit_x_resources, noninteractive1): Remove.
* editfns.c (syms_of_editfns): Update.
(Vbuffer_access_fontified_property)
(Vbuffer_access_fontify_functions, Vinhibit_field_text_motion)
(Voperating_system_release, Vsystem_name, Vuser_full_name)
(Vuser_login_name, Vuser_real_login_name): Remove.
* dosfns.c (syms_of_dosfns): Update.
(Vdos_display_scancodes, Vdos_version, Vdos_windows_version)
(dos_codepage, dos_country_code, dos_decimal_point)
(dos_hyper_key, dos_keyboard_layout, dos_keypad_mode)
(dos_super_key, dos_timezone_offset): Remove.
* doc.c (syms_of_doc): Update.
(Vbuild_files, Vdoc_file_name): Remove.
* dispnew.c (syms_of_display): Update.
(Vglyph_table, Vinitial_window_system)
(Vredisplay_preemption_period, Vstandard_display_table)
(Vwindow_system_version, baud_rate, cursor_in_echo_area)
(inverse_video, redisplay_dont_pause, visible_bell): Remove.
* dired.c (syms_of_dired): Update.
(Vcompletion_ignored_extensions): Remove.
(Vw32_get_true_file_attributes): Remove declaration.
* dbusbind.c (syms_of_dbusbind): Update.
(Vdbus_debug, Vdbus_registered_buses)
(Vdbus_registered_objects_table): Remove.
* data.c (syms_of_data): Update.
(Vmost_negative_fixnum, Vmost_positive_fixnum): Remove.
* composite.c (syms_of_composite): Update.
(Vauto_composition_function, Vauto_composition_mode)
(Vcompose_chars_after_function, Vcomposition_function_table):
Remove.
* coding.c (syms_of_coding): Update.
(Vcharset_revision_table, Vcoding_category_list)
(Vcoding_system_alist, Vcoding_system_for_read)
(Vcoding_system_for_write, Vcoding_system_list)
(Vdefault_process_coding_system, Venable_character_translation)
(Vfile_coding_system_alist, Vlast_code_conversion_error)
(Vlast_coding_system_used, Vlatin_extra_code_table)
(Vlocale_coding_system, Vnetwork_coding_system_alist)
(Vprocess_coding_system_alist)
(Vselect_safe_coding_system_function)
(Vstandard_translation_table_for_decode)
(Vstandard_translation_table_for_encode)
(Vtranslation_table_for_input, coding_system_require_warning)
(eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
(eol_mnemonic_unix, inherit_process_coding_system)
(inhibit_eol_conversion, inhibit_iso_escape_detection)
(inhibit_null_byte_detection): Remove.
* cmds.c (syms_of_cmds): Update.
(Vpost_self_insert_hook): Remove.
* charset.c (syms_of_charset): Update.
(Vcharset_list, Vcharset_map_path, Vcurrent_iso639_language)
(inhibit_load_charset_map): Remove.
* character.c (syms_of_character): Update.
(Vauto_fill_chars, Vchar_direction_table, Vchar_script_table)
(Vchar_width_table, Vprintable_chars)
(Vscript_representative_chars, Vtranslation_table_vector)
(Vunicode_category_table): Remove.
* ccl.c (syms_of_ccl): Update.
(Vcode_conversion_map_vector, Vfont_ccl_encoder_alist)
(Vtranslation_hash_table_vector): Remove.
* category.c (syms_of_category): Update.
(Vword_combining_categories, Vword_separating_categories): Remove.
* callproc.c (syms_of_callproc): Update.
(Vconfigure_info_directory, Vdata_directory, Vdoc_directory)
(Vexec_directory, Vexec_path, Vexec_suffixes)
(Vinitial_environment, Vprocess_environment)
(Vshared_game_score_directory, Vshell_file_name): Remove.
* callint.c (syms_of_callint): Update.
(Vcommand_debug_status, Vcommand_history, Vcurrent_prefix_arg)
(Vmark_even_if_inactive, Vmouse_leave_buffer_hook): Remove.
* bytecode.c (syms_of_bytecode): Update.
(Vbyte_code_meter, byte_metering_on): Remove.
* buffer.c (syms_of_buffer): Update.
(Vafter_change_functions, Vbefore_change_functions)
(Vchange_major_mode_hook, Vfirst_change_hook)
(Vinhibit_read_only, Vkill_buffer_query_functions)
(Vtransient_mark_mode, inhibit_modification_hooks): Remove.
* alloc.c (syms_of_alloc): Update.
(Vgc_cons_percentage, Vgc_elapsed, Vmemory_full)
(Vmemory_signal_data, Vpost_gc_hook, Vpurify_flag)
(cons_cells_consed, floats_consed, garbage_collection_messages)
(gc_cons_threshold, gcs_done, intervals_consed)
(misc_objects_consed, pure_bytes_used, string_chars_consed)
(strings_consed, symbols_consed, vector_cells_consed): Remove.
* lisp.h (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL)
(DEFVAR_INT): Assume global is in `globals'.
* alloc.c (globals): Define.
2011-01-18 20:45:37 +00:00
|
|
|
|
DEFVAR_LISP ("resume-tty-functions", Vresume_tty_functions,
|
2012-08-05 07:45:12 +00:00
|
|
|
|
doc: /* Functions run after resuming a tty.
|
2009-04-22 03:51:25 +00:00
|
|
|
|
The functions are run with one argument, the terminal object that was revived.
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
See `resume-tty'. */);
|
2007-09-04 23:28:49 +00:00
|
|
|
|
Vresume_tty_functions = Qnil;
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
|
Move all DEFVAR'd globals into a structure -- threading infrastructure
* globals.h: New file.
* xterm.h (Vx_pixel_size_width_font_regexp): Remove declaration.
* window.h (Vinitial_window_system, Vminibuf_scroll_window)
(Vwindow_system_version): Remove declaration.
* w32term.h (Vw32_enable_palette)
(Vx_pixel_size_width_font_regexp): Remove declaration.
* w32menu.c (Voverriding_local_map)
(Voverriding_local_map_menu_flag): Remove declaration.
* w32inevt.c (Vw32_alt_is_meta, Vw32_apps_modifier)
(Vw32_capslock_is_shiftlock, Vw32_enable_caps_lock)
(Vw32_enable_num_lock, Vw32_lwindow_modifier)
(Vw32_pass_lwindow_to_system, Vw32_pass_rwindow_to_system)
(Vw32_phantom_key_code, Vw32_recognize_altgr)
(Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
(w32_use_full_screen_buffer): Remove declaration.
* w32.c (Vsystem_configuration, Vw32_downcase_file_names)
(Vw32_generate_fake_inodes, Vw32_get_true_file_attributes)
(w32_num_mouse_buttons, w32_pipe_read_delay): Remove declaration.
* termopts.h (Vtruncate_partial_width_windows, inverse_video)
(no_redraw_on_reenter, visible_bell): Remove declaration.
* sysdep.c (Vsystem_name): Remove declaration.
* syntax.h (parse_sexp_lookup_properties): Remove declaration.
* menu.h (Vmenu_updating_frame): Remove declaration.
* macros.h (Vexecuting_kbd_macro, executing_kbd_macro_index):
Remove declaration.
* lisp.h (Vafter_init_time, Vafter_load_alist)
(Vauto_save_list_file_name, Vbefore_init_time, Vcommand_history)
(Vcompletion_regexp_list, Vcurrent_load_list)
(Vcurrent_prefix_arg, Vdata_directory, Vdebug_on_error)
(Vdoc_directory, Vdoc_file_name, Vdynamic_library_alist)
(Vexec_directory, Vexec_path, Vexec_suffixes)
(Vface_font_rescale_alist, Vface_ignored_fonts, Vfeatures)
(Vhelp_form, Vhistory_length, Vinhibit_field_text_motion)
(Vinhibit_quit, Vinhibit_read_only, Vinhibit_redisplay)
(Vinstallation_directory, Vinvocation_directory)
(Vinvocation_name, Vload_file_rep_suffixes, Vload_history)
(Vload_suffixes, Vmark_even_if_inactive, Vmemory_full)
(Vmessage_log_max, Vobarray, Vprint_length, Vprint_level)
(Vpurify_flag, Vquit_flag, Vsaved_region_selection)
(Vscalable_fonts_allowed, Vselect_active_regions)
(Vshell_file_name, Vstandard_input, Vstandard_output)
(Vsystem_name, Vtemporary_file_directory, Vthrow_on_input)
(Vtop_level, Vtty_erase_char, Vundo_outer_limit)
(Vuser_login_name, Vwindow_scroll_functions)
(Vwindow_system_version, Vx_no_window_manager)
(Vx_resource_class, Vx_resource_name, baud_rate)
(completion_ignore_case, debug_on_next_call, gc_cons_threshold)
(history_delete_duplicates, inhibit_x_resources)
(last_nonmenu_event, load_in_progress, max_specpdl_size)
(minibuffer_auto_raise, print_escape_newlines, scroll_margin)
(use_dialog_box, use_file_dialog): Remove declaration. Include
globals.h.
* keymap.h (Voverriding_local_map)
(Voverriding_local_map_menu_flag, meta_prefix_char): Remove
declaration.
* keyboard.h (Vdouble_click_time, Vfunction_key_map)
(Vinput_method_function, Vkey_translation_map)
(Vlucid_menu_bar_dirty_flag, Vthis_original_command)
(do_mouse_tracking, extra_keyboard_modifiers)
(num_nonmacro_input_events): Remove declaration.
* intervals.h (Vchar_property_alias_alist)
(Vdefault_text_properties, Vinhibit_point_motion_hooks)
(Vtext_property_default_nonsticky): Remove declaration.
* gtkutil.h (x_gtk_file_dialog_help_text)
(x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
(x_gtk_whole_detached_tool_bar): Remove declaration.
* frame.h (Vdefault_frame_alist, Vframe_alpha_lower_limit)
(Vmenu_bar_mode, Vmouse_highlight, Vterminal_frame)
(Vtool_bar_mode, Vx_resource_class, Vx_resource_name)
(focus_follows_mouse): Remove declaration.
* fontset.h (Valternate_fontname_alist, Vfontset_alias_alist)
(Vignore_relative_composition, Votf_script_alist)
(Vuse_default_ascent, Vvertical_centering_font_regexp): Remove
declaration.
* font.h (Vfont_log): Remove declaration.
* dosfns.h (Vdos_display_scancodes, Vdos_version)
(Vdos_windows_version, dos_codepage, dos_country_code)
(dos_decimal_point, dos_hyper_key, dos_keyboard_layout)
(dos_keypad_mode, dos_super_key, dos_timezone_offset): Remove
declaration.
* disptab.h (Vglyph_table, Vstandard_display_table): Remove
declaration.
* dispextern.h (Vface_remapping_alist, Vglyphless_char_display)
(Vmouse_autoselect_window, Voverflow_newline_into_fringe)
(Vshow_trailing_whitespace, Vtool_bar_button_margin)
(Vtool_bar_style, cursor_in_echo_area, display_hourglass_p)
(inverse_video, mode_line_in_non_selected_windows)
(tool_bar_button_relief, tool_bar_max_label_size)
(underline_minimum_offset)
(unibyte_display_via_language_environment, x_stretch_cursor_p):
Remove declaration.
* composite.h (Vauto_composition_function)
(Vcomposition_function_table): Remove declaration.
* commands.h (Vexecuting_kbd_macro)
(Vminibuffer_local_completion_map)
(Vminibuffer_local_filename_completion_map)
(Vminibuffer_local_filename_must_match_map)
(Vminibuffer_local_map, Vminibuffer_local_must_match_map)
(Vminibuffer_local_ns_map, Vthis_command)
(Vunread_command_events, cursor_in_echo_area)
(last_command_event, last_nonmenu_event, unread_command_char):
Remove declaration.
* coding.h (Vcoding_system_for_read, Vcoding_system_for_write)
(Vdefault_file_name_coding_system)
(Vdefault_process_coding_system, Vfile_name_coding_system)
(Vlast_coding_system_used, Vlocale_coding_system)
(Vselect_safe_coding_system_function)
(Vtranslation_table_for_input, coding_system_require_warning)
(eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
(eol_mnemonic_unix, inherit_process_coding_system): Remove
declaration.
* charset.h (Vcharset_list, Vcurrent_iso639_language): Remove
declaration.
* character.h (Vauto_fill_chars, Vchar_direction_table)
(Vchar_script_table, Vchar_width_table, Vprintable_chars)
(Vscript_representative_chars, Vtranslation_table_vector)
(Vunicode_category_table): Remove declaration.
* ccl.h (Vfont_ccl_encoder_alist): Remove declaration.
* buffer.h (Vafter_change_functions, Vbefore_change_functions)
(Vdeactivate_mark, Vfirst_change_hook, Vtransient_mark_mode)
(inhibit_modification_hooks): Remove declaration.
* xterm.c (syms_of_xterm): Update.
(Vx_alt_keysym, Vx_hyper_keysym, Vx_keysym_table)
(Vx_meta_keysym, Vx_super_keysym, Vx_toolkit_scroll_bars)
(x_mouse_click_focus_ignore_position)
(x_underline_at_descent_line)
(x_use_underline_position_properties): Remove.
* xsmfns.c (syms_of_xsmfns): Update.
(Vx_session_id, Vx_session_previous_id): Remove.
* xsettings.c (syms_of_xsettings): Update.
(Vxft_settings, use_system_font): Remove.
* xselect.c (syms_of_xselect): Update.
(Vselection_converter_alist, Vx_lost_selection_functions)
(Vx_sent_selection_functions, x_selection_timeout): Remove.
* xfns.c (syms_of_xfns): Update.
(Vgtk_version_string, Vmotif_version_string)
(Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
(Vx_max_tooltip_size, Vx_mode_pointer_shape)
(Vx_no_window_manager, Vx_nontext_pointer_shape)
(Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
(Vx_sensitive_text_pointer_shape)
(Vx_window_horizontal_drag_shape, x_gtk_file_dialog_help_text)
(x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
(x_gtk_use_system_tooltips, x_gtk_whole_detached_tool_bar):
Remove.
* xfaces.c (syms_of_xfaces): Update.
(Vface_default_stipple, Vface_font_rescale_alist)
(Vface_ignored_fonts, Vface_new_frame_defaults)
(Vface_remapping_alist, Vfont_list_limit)
(Vscalable_fonts_allowed, Vtty_defined_color_alist): Remove.
* xdisp.c (syms_of_xdisp): Update.
(Vauto_resize_tool_bars, Vblink_cursor_alist)
(Vdisplay_pixels_per_inch, Vfontification_functions)
(Vframe_title_format, Vglobal_mode_string)
(Vglyphless_char_display, Vhourglass_delay, Vhscroll_step)
(Vicon_title_format, Vinhibit_redisplay)
(Vline_number_display_limit, Vline_prefix)
(Vmax_mini_window_height, Vmenu_bar_update_hook)
(Vmenu_updating_frame, Vmessage_log_max)
(Vmouse_autoselect_window, Vnobreak_char_display)
(Voverlay_arrow_position, Voverlay_arrow_string)
(Voverlay_arrow_variable_list, Vredisplay_end_trigger_functions)
(Vresize_mini_windows, Vshow_trailing_whitespace)
(Vtool_bar_border, Vtool_bar_button_margin, Vtool_bar_style)
(Vtruncate_partial_width_windows, Vvoid_text_area_pointer)
(Vwindow_scroll_functions, Vwindow_size_change_functions)
(Vwindow_text_change_functions, Vwrap_prefix)
(auto_raise_tool_bar_buttons_p, automatic_hscrolling_p)
(debug_end_pos, display_hourglass_p, emacs_scroll_step)
(highlight_nonselected_windows, hscroll_margin)
(inhibit_eval_during_redisplay, inhibit_free_realized_faces)
(inhibit_menubar_update, inhibit_try_cursor_movement)
(inhibit_try_window_id, inhibit_try_window_reusing)
(line_number_display_limit_width)
(make_cursor_line_fully_visible_p, message_truncate_lines)
(mode_line_inverse_video, multiple_frames, overline_margin)
(scroll_conservatively, scroll_margin, tool_bar_button_relief)
(tool_bar_max_label_size, underline_minimum_offset)
(unibyte_display_via_language_environment, x_stretch_cursor_p):
Remove.
* window.c (syms_of_window): Update.
(Vminibuf_scroll_window, Vother_window_scroll_buffer)
(Vrecenter_redisplay, Vscroll_preserve_screen_position)
(Vtemp_buffer_show_function, Vwindow_configuration_change_hook)
(Vwindow_point_insertion_type, auto_window_vscroll_p)
(mode_line_in_non_selected_windows, next_screen_context_lines)
(window_min_height, window_min_width): Remove.
(scroll_margin): Remove declaration.
* w32term.c (syms_of_w32term): Update.
(Vw32_capslock_is_shiftlock, Vw32_grab_focus_on_raise)
(Vw32_recognize_altgr, Vw32_swap_mouse_buttons)
(Vx_toolkit_scroll_bars, w32_num_mouse_buttons)
(w32_use_visible_system_caret, x_underline_at_descent_line)
(x_use_underline_position_properties): Remove.
(Vcommand_line_args, Vsystem_name, extra_keyboard_modifiers):
Remove declaration.
* w32select.c (syms_of_w32select): Update.
(Vnext_selection_coding_system, Vselection_coding_system): Remove.
* w32proc.c (syms_of_ntproc): Update.
(Vw32_downcase_file_names, Vw32_generate_fake_inodes)
(Vw32_get_true_file_attributes, Vw32_quote_process_args)
(Vw32_start_process_inherit_error_mode)
(Vw32_start_process_share_console)
(Vw32_start_process_show_window, w32_pipe_read_delay): Remove.
(Vsystem_name): Remove declaration.
* w32font.c (syms_of_w32font): Update.
(Vw32_charset_info_alist): Remove.
* w32fns.c (globals_of_w32fns, syms_of_w32fns): Update.
(Vw32_alt_is_meta, Vw32_apps_modifier, Vw32_bdf_filename_alist)
(Vw32_color_map, Vw32_enable_caps_lock, Vw32_enable_num_lock)
(Vw32_enable_palette, Vw32_lwindow_modifier)
(Vw32_pass_alt_to_system, Vw32_pass_lwindow_to_system)
(Vw32_pass_rwindow_to_system, Vw32_phantom_key_code)
(Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
(Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
(Vx_max_tooltip_size, Vx_mode_pointer_shape)
(Vx_no_window_manager, Vx_nontext_pointer_shape)
(Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
(Vx_sensitive_text_pointer_shape)
(Vx_window_horizontal_drag_shape, w32_ansi_code_page)
(w32_enable_synthesized_fonts, w32_mouse_button_tolerance)
(w32_mouse_move_interval)
(w32_pass_extra_mouse_buttons_to_system)
(w32_pass_multimedia_buttons_to_system, w32_quit_key)
(w32_strict_fontnames, w32_strict_painting): Remove.
(Vhourglass_delay, Vmenu_bar_mode, Vtool_bar_mode)
(Vw32_recognize_altgr, Vwindow_system_version)
(w32_num_mouse_buttons, w32_use_visible_system_caret): Remove
declaration.
* w32console.c (syms_of_ntterm): Update.
(w32_use_full_screen_buffer): Remove.
(Vtty_defined_color_alist): Remove declaration.
* w16select.c (syms_of_win16select): Update.
(Vnext_selection_coding_system, Vselection_coding_system): Remove.
* undo.c (syms_of_undo): Update.
(Vundo_outer_limit, Vundo_outer_limit_function)
(undo_inhibit_record_point, undo_limit, undo_strong_limit):
Remove.
* textprop.c (syms_of_textprop): Update.
(Vchar_property_alias_alist, Vdefault_text_properties)
(Vinhibit_point_motion_hooks, Vtext_property_default_nonsticky):
Remove.
* terminal.c (syms_of_terminal): Update.
(Vdelete_terminal_functions, Vring_bell_function): Remove.
* term.c (syms_of_term): Update.
(Vresume_tty_functions, Vsuspend_tty_functions)
(no_redraw_on_reenter, system_uses_terminfo, visible_cursor):
Remove.
* syntax.c (syms_of_syntax): Update.
(Vfind_word_boundary_function_table, multibyte_syntax_as_symbol)
(open_paren_in_column_0_is_defun_start)
(parse_sexp_ignore_comments, parse_sexp_lookup_properties)
(words_include_escapes): Remove.
* search.c (syms_of_search): Update.
(Vinhibit_changing_match_data, Vsearch_spaces_regexp): Remove.
* process.c (syms_of_process): Update.
(Vprocess_adaptive_read_buffering, Vprocess_connection_type)
(delete_exited_processes): Remove.
* print.c (syms_of_print): Update.
(Vfloat_output_format, Vprint_charset_text_property)
(Vprint_circle, Vprint_continuous_numbering, Vprint_gensym)
(Vprint_length, Vprint_level, Vprint_number_table)
(Vstandard_output, print_escape_multibyte)
(print_escape_newlines, print_escape_nonascii, print_quoted):
Remove.
* msdos.c (syms_of_msdos): Update.
(Vdos_unsupported_char_glyph): Remove.
(unibyte_display_via_language_environment): Remove declaration.
* minibuf.c (syms_of_minibuf): Update.
(Vcompletion_regexp_list, Vhistory_add_new_input)
(Vhistory_length, Vminibuffer_completing_file_name)
(Vminibuffer_completion_confirm)
(Vminibuffer_completion_predicate, Vminibuffer_completion_table)
(Vminibuffer_exit_hook, Vminibuffer_help_form)
(Vminibuffer_history_position, Vminibuffer_history_variable)
(Vminibuffer_prompt_properties, Vminibuffer_setup_hook)
(Vread_buffer_function, Vread_expression_map)
(completion_ignore_case, enable_recursive_minibuffers)
(history_delete_duplicates, minibuffer_allow_text_properties)
(minibuffer_auto_raise, read_buffer_completion_ignore_case):
Remove.
* marker.c (syms_of_marker): Update.
(byte_debug_flag): Remove.
* macros.c (syms_of_macros): Update.
(Vexecuting_kbd_macro, executing_kbd_macro_index): Remove.
* lread.c (syms_of_lread): Update.
(Vafter_load_alist, Vbyte_boolean_vars)
(Vbytecomp_version_regexp, Vcurrent_load_list)
(Veval_buffer_list, Vload_file_name, Vload_file_rep_suffixes)
(Vload_history, Vload_path, Vload_read_function)
(Vload_source_file_function, Vload_suffixes, Vobarray)
(Vold_style_backquotes, Vpreloaded_file_list, Vread_circle)
(Vread_symbol_positions_list, Vread_with_symbol_positions)
(Vsource_directory, Vstandard_input, Vuser_init_file, Vvalues)
(force_load_messages, load_convert_to_unibyte)
(load_dangerous_libraries, load_force_doc_strings)
(load_in_progress): Remove.
* keymap.c (syms_of_keymap): Update.
(Vdefine_key_rebound_commands, Vemulation_mode_map_alists)
(Vminibuffer_local_completion_map)
(Vminibuffer_local_filename_completion_map)
(Vminibuffer_local_filename_must_match_map)
(Vminibuffer_local_map, Vminibuffer_local_must_match_map)
(Vminibuffer_local_ns_map, Vminor_mode_map_alist)
(Vminor_mode_overriding_map_alist, Vwhere_is_preferred_modifier):
Remove.
* keyboard.c (syms_of_keyboard): Update.
(Vauto_save_timeout, Vcommand_error_function)
(Vcommand_hook_internal, Vdeactivate_mark)
(Vdeferred_action_function, Vdeferred_action_list)
(Vdisable_point_adjustment, Vdouble_click_time)
(Vecho_keystrokes, Venable_disabled_menus_and_buttons)
(Vfunction_key_map, Vglobal_disable_point_adjustment)
(Vhelp_char, Vhelp_event_list, Vhelp_form)
(Vinput_method_function, Vinput_method_previous_message)
(Vkey_translation_map, Vlast_event_frame)
(Vlucid_menu_bar_dirty_flag, Vmenu_bar_final_items)
(Vminibuffer_message_timeout, Voverriding_local_map)
(Voverriding_local_map_menu_flag, Vpost_command_hook)
(Vpre_command_hook, Vprefix_help_command)
(Vsaved_region_selection, Vselect_active_regions)
(Vshow_help_function, Vspecial_event_map, Vsuggest_key_bindings)
(Vthis_command, Vthis_command_keys_shift_translated)
(Vthis_original_command, Vthrow_on_input, Vtimer_idle_list)
(Vtimer_list, Vtool_bar_separator_image_expression, Vtop_level)
(Vtty_erase_char, Vunread_command_events)
(Vunread_input_method_events, Vunread_post_input_method_events)
(auto_save_interval, cannot_suspend, do_mouse_tracking)
(double_click_fuzz, extra_keyboard_modifiers)
(inhibit_local_menu_bar_menus, last_command_event)
(last_input_event, last_nonmenu_event, menu_prompt_more_char)
(menu_prompting, meta_prefix_char, num_input_keys)
(num_nonmacro_input_events, polling_period, unread_command_char):
Remove.
* insdel.c (syms_of_insdel): Update.
(Vcombine_after_change_calls, check_markers_debug_flag): Remove.
* indent.c (syms_of_indent): Update.
(indent_tabs_mode): Remove.
* image.c (syms_of_image): Update.
(Vimage_cache_eviction_delay, Vimage_types)
(Vimagemagick_render_type, Vmax_image_size, Vx_bitmap_file_path)
(cross_disabled_images): Remove.
* fringe.c (syms_of_fringe): Update.
(Vfringe_bitmaps, Voverflow_newline_into_fringe): Remove.
* frame.c (syms_of_frame): Update.
(Vdefault_frame_alist, Vdefault_frame_scroll_bars)
(Vdelete_frame_functions, Vframe_alpha_lower_limit)
(Vmake_pointer_invisible, Vmenu_bar_mode, Vmouse_highlight)
(Vmouse_position_function, Vterminal_frame, Vtool_bar_mode)
(Vx_resource_class, Vx_resource_name, focus_follows_mouse):
Remove.
* fontset.c (syms_of_fontset): Update.
(Valternate_fontname_alist, Vfont_encoding_charset_alist)
(Vfontset_alias_alist, Vignore_relative_composition)
(Votf_script_alist, Vuse_default_ascent)
(Vvertical_centering_font_regexp): Remove.
* font.c (syms_of_font): Update.
(Vfont_encoding_alist, Vfont_log, Vfont_slant_table)
(Vfont_weight_table, Vfont_width_table): Remove.
* fns.c (syms_of_fns): Update.
(Vfeatures, use_dialog_box, use_file_dialog): Remove.
* filelock.c (syms_of_filelock): Update.
(Vtemporary_file_directory): Remove.
* fileio.c (syms_of_fileio): Update.
(Vafter_insert_file_functions, Vauto_save_include_big_deletions)
(Vauto_save_list_file_name, Vauto_save_visited_file_name)
(Vdefault_file_name_coding_system, Vfile_name_coding_system)
(Vfile_name_handler_alist, Vinhibit_file_name_handlers)
(Vinhibit_file_name_operation, Vset_auto_coding_function)
(Vwrite_region_annotate_functions)
(Vwrite_region_annotations_so_far)
(Vwrite_region_post_annotation_function)
(delete_by_moving_to_trash, write_region_inhibit_fsync): Remove.
(Vw32_get_true_file_attributes): Remove declaration.
* eval.c (syms_of_eval): Update.
(Vdebug_ignored_errors, Vdebug_on_error, Vdebug_on_signal)
(Vdebugger, Vinhibit_quit, Vmacro_declaration_function)
(Vquit_flag, Vsignal_hook_function, Vstack_trace_on_error)
(debug_on_next_call, debug_on_quit, debugger_may_continue)
(max_lisp_eval_depth, max_specpdl_size): Remove.
* emacs.c (syms_of_emacs): Update.
(Vafter_init_time, Vbefore_init_time, Vcommand_line_args)
(Vdynamic_library_alist, Vemacs_copyright, Vemacs_version)
(Vinstallation_directory, Vinvocation_directory)
(Vinvocation_name, Vkill_emacs_hook, Vpath_separator)
(Vprevious_system_messages_locale, Vprevious_system_time_locale)
(Vsystem_configuration, Vsystem_configuration_options)
(Vsystem_messages_locale, Vsystem_time_locale, Vsystem_type)
(inhibit_x_resources, noninteractive1): Remove.
* editfns.c (syms_of_editfns): Update.
(Vbuffer_access_fontified_property)
(Vbuffer_access_fontify_functions, Vinhibit_field_text_motion)
(Voperating_system_release, Vsystem_name, Vuser_full_name)
(Vuser_login_name, Vuser_real_login_name): Remove.
* dosfns.c (syms_of_dosfns): Update.
(Vdos_display_scancodes, Vdos_version, Vdos_windows_version)
(dos_codepage, dos_country_code, dos_decimal_point)
(dos_hyper_key, dos_keyboard_layout, dos_keypad_mode)
(dos_super_key, dos_timezone_offset): Remove.
* doc.c (syms_of_doc): Update.
(Vbuild_files, Vdoc_file_name): Remove.
* dispnew.c (syms_of_display): Update.
(Vglyph_table, Vinitial_window_system)
(Vredisplay_preemption_period, Vstandard_display_table)
(Vwindow_system_version, baud_rate, cursor_in_echo_area)
(inverse_video, redisplay_dont_pause, visible_bell): Remove.
* dired.c (syms_of_dired): Update.
(Vcompletion_ignored_extensions): Remove.
(Vw32_get_true_file_attributes): Remove declaration.
* dbusbind.c (syms_of_dbusbind): Update.
(Vdbus_debug, Vdbus_registered_buses)
(Vdbus_registered_objects_table): Remove.
* data.c (syms_of_data): Update.
(Vmost_negative_fixnum, Vmost_positive_fixnum): Remove.
* composite.c (syms_of_composite): Update.
(Vauto_composition_function, Vauto_composition_mode)
(Vcompose_chars_after_function, Vcomposition_function_table):
Remove.
* coding.c (syms_of_coding): Update.
(Vcharset_revision_table, Vcoding_category_list)
(Vcoding_system_alist, Vcoding_system_for_read)
(Vcoding_system_for_write, Vcoding_system_list)
(Vdefault_process_coding_system, Venable_character_translation)
(Vfile_coding_system_alist, Vlast_code_conversion_error)
(Vlast_coding_system_used, Vlatin_extra_code_table)
(Vlocale_coding_system, Vnetwork_coding_system_alist)
(Vprocess_coding_system_alist)
(Vselect_safe_coding_system_function)
(Vstandard_translation_table_for_decode)
(Vstandard_translation_table_for_encode)
(Vtranslation_table_for_input, coding_system_require_warning)
(eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
(eol_mnemonic_unix, inherit_process_coding_system)
(inhibit_eol_conversion, inhibit_iso_escape_detection)
(inhibit_null_byte_detection): Remove.
* cmds.c (syms_of_cmds): Update.
(Vpost_self_insert_hook): Remove.
* charset.c (syms_of_charset): Update.
(Vcharset_list, Vcharset_map_path, Vcurrent_iso639_language)
(inhibit_load_charset_map): Remove.
* character.c (syms_of_character): Update.
(Vauto_fill_chars, Vchar_direction_table, Vchar_script_table)
(Vchar_width_table, Vprintable_chars)
(Vscript_representative_chars, Vtranslation_table_vector)
(Vunicode_category_table): Remove.
* ccl.c (syms_of_ccl): Update.
(Vcode_conversion_map_vector, Vfont_ccl_encoder_alist)
(Vtranslation_hash_table_vector): Remove.
* category.c (syms_of_category): Update.
(Vword_combining_categories, Vword_separating_categories): Remove.
* callproc.c (syms_of_callproc): Update.
(Vconfigure_info_directory, Vdata_directory, Vdoc_directory)
(Vexec_directory, Vexec_path, Vexec_suffixes)
(Vinitial_environment, Vprocess_environment)
(Vshared_game_score_directory, Vshell_file_name): Remove.
* callint.c (syms_of_callint): Update.
(Vcommand_debug_status, Vcommand_history, Vcurrent_prefix_arg)
(Vmark_even_if_inactive, Vmouse_leave_buffer_hook): Remove.
* bytecode.c (syms_of_bytecode): Update.
(Vbyte_code_meter, byte_metering_on): Remove.
* buffer.c (syms_of_buffer): Update.
(Vafter_change_functions, Vbefore_change_functions)
(Vchange_major_mode_hook, Vfirst_change_hook)
(Vinhibit_read_only, Vkill_buffer_query_functions)
(Vtransient_mark_mode, inhibit_modification_hooks): Remove.
* alloc.c (syms_of_alloc): Update.
(Vgc_cons_percentage, Vgc_elapsed, Vmemory_full)
(Vmemory_signal_data, Vpost_gc_hook, Vpurify_flag)
(cons_cells_consed, floats_consed, garbage_collection_messages)
(gc_cons_threshold, gcs_done, intervals_consed)
(misc_objects_consed, pure_bytes_used, string_chars_consed)
(strings_consed, symbols_consed, vector_cells_consed): Remove.
* lisp.h (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL)
(DEFVAR_INT): Assume global is in `globals'.
* alloc.c (globals): Define.
2011-01-18 20:45:37 +00:00
|
|
|
|
DEFVAR_BOOL ("visible-cursor", visible_cursor,
|
2005-12-30 21:48:35 +00:00
|
|
|
|
doc: /* Non-nil means to make the cursor very visible.
|
|
|
|
|
This only has an effect when running in a text terminal.
|
|
|
|
|
What means \"very visible\" is up to your terminal. It may make the cursor
|
|
|
|
|
bigger, or it may make it blink, or it may do nothing at all. */);
|
|
|
|
|
visible_cursor = 1;
|
|
|
|
|
|
Rewritten.
(append_glyph): New.
(update_end): Turn cursor on only if selected window's
cursor_off_p flag is not set.
(TS_cursor_visible): Renamed from TS_visual_mode.
(TS_cursor_normal): Renamed from TS_end_visual_mode.
(TS_cursor_invisible): New.
(term_init): Initialize TS_cursor_invisible.
(tty_hide_cursor): New.
(tty_show_cursor): New.
(update_end): Show tty cursor.
(update_begin): Hide tty cursor to prevent cursor flickering
during redisplays triggered by timers (stealth fontification).
(estimate_mode_line_height): New.
(estimate_mode_line_height_hook): New.
(OUTPUT_IF): Make replacement text have statement form.
(OUTPUT1_IF): Ditto.
(TS_italic_mode, TS_end_italic_mode): Removed.
(TS_bold_mode): Removed.
(TS_underscore_mode, TS_end_underscore_mode): Removed.
(TS_enter_bold_mode, TS_enter_dim_mode, TS_enter_blink_mode): New.
(TS_enter_reverse_mode): New.
(TS_enter_underline_mode, TS_exit_underline_mode): New.
(TN_magic_cookie_glitch_ul): New.
(TS_enter_alt_charset_mode, TS_exit_alt_charset_mode): New.
(TS_exit_attribute_mode): New.
(TN_max_colors, TN_max_pairs, TS_orig_pairs): New.
(TS_set_foreground, TS_set_background): New.
(reset_terminal_modes): Switch colors back to default.
(write_glyphs): Turn face on before writing text, turn it off
afterwards.
(insert_glyphs): Ditto.
(term_init): Initialize new terminal capability variables.
(turn_on_face): Turn a face on.
(turn_off_face): Turn a face off.
(global): Rewrite for new glyphs.
1999-07-21 21:43:52 +00:00
|
|
|
|
defsubr (&Stty_display_color_p);
|
2002-01-25 13:21:49 +00:00
|
|
|
|
defsubr (&Stty_display_color_cells);
|
2005-06-17 14:08:58 +00:00
|
|
|
|
defsubr (&Stty_no_underline);
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
defsubr (&Stty_type);
|
|
|
|
|
defsubr (&Scontrolling_tty_p);
|
2012-06-19 06:49:50 +00:00
|
|
|
|
defsubr (&Stty_top_frame);
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
defsubr (&Ssuspend_tty);
|
|
|
|
|
defsubr (&Sresume_tty);
|
2007-05-20 05:13:28 +00:00
|
|
|
|
#ifdef HAVE_GPM
|
2007-09-28 19:47:02 +00:00
|
|
|
|
defsubr (&Sgpm_mouse_start);
|
|
|
|
|
defsubr (&Sgpm_mouse_stop);
|
2007-05-20 05:13:28 +00:00
|
|
|
|
#endif /* HAVE_GPM */
|
2008-07-25 18:12:00 +00:00
|
|
|
|
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#ifndef DOS_NT
|
2008-07-25 18:12:00 +00:00
|
|
|
|
default_orig_pair = NULL;
|
|
|
|
|
default_set_foreground = NULL;
|
|
|
|
|
default_set_background = NULL;
|
2008-08-23 16:55:52 +00:00
|
|
|
|
#endif /* !DOS_NT */
|
2008-12-08 14:44:30 +00:00
|
|
|
|
|
|
|
|
|
encode_terminal_src = NULL;
|
|
|
|
|
encode_terminal_dst = NULL;
|
2013-09-21 14:53:04 +00:00
|
|
|
|
|
2014-04-17 07:54:23 +00:00
|
|
|
|
DEFSYM (Qtty_mode_set_strings, "tty-mode-set-strings");
|
|
|
|
|
DEFSYM (Qtty_mode_reset_strings, "tty-mode-reset-strings");
|
|
|
|
|
|
Fix the MSDOS build.
src/unexcoff.c [MSDOS]: Include libc/atexit.h.
(copy_text_and_data): Zero out the atexit chain pointer before
dumping Emacs.
src/termhooks.h (encode_terminal_code): Update prototype.
src/term.c (encode_terminal_code) [DOS_NT]: Make it externally
visible for all DOS_NT ports, not just WINDOWSNT.
(syms_of_term) [!MSDOS]: Don't define 'tty-menu-*' symbols on MSDOS.
src/sysdep.c (emacs_sigaction_init, init_signals): Don't use SIGCHLD
unless it is defined.
(emacs_pipe) [MSDOS]: Redirect to 'pipe'.
src/process.c (close_on_exec, accept4, process_socket): Move into
the "ifdef subprocesses" part.
(catch_child_signal): Condition by "ifdef subprocesses".
(syms_of_process) <Qinternal_default_process_sentinel>
<Qinternal_default_process_filter>: Condition by "ifdef subprocesses".
src/msdos.h: Add prototypes for new functions.
(EINPROGRESS): Define.
(O_CLOEXEC): Define to zero.
src/msdos.c (check_window_system): Remove unnecessary an
incompatible duplicate function.
(sys_opendir, readlinkat, faccessat, fstatat, unsetenv): New
functions in support of new functionality.
src/menu.c (single_menu_item): Add visual indication of submenu
also for menus on MSDOS frames.
(Fx_popup_menu) [!MSDOS]: Do not call tty_menu_show on MSDOS.
src/lisp.h (CHECK_PROCESS) [!subprocesses]: Do not define
when async subprocesses aren't supported.
src/font.h (FONT_WIDTH) [MSDOS]: MSDOS-specific definition.
src/emacs.c (close_output_streams): Zero out errno before calling
close_stream.
src/dired.c [MSDOS]: Include msdos.h.
src/conf_post.h (opendir) [MSDOS]: Redirect to sys_opendir.
(DATA_START) [MSDOS]: Define.
(SYSTEM_PURESIZE_EXTRA) [MSDOS]: Enlarge by 25K.
src/callproc.c (block_child_signal, unblock_child_signal) [MSDOS]:
Ifdef away for MSDOS.
(record_kill_process) [MSDOS]: Ifdef away the entire body for MSDOS.
(call_process_cleanup) [MSDOS]: Ifdef away portions not relevant
for MSDOS.
(call_process) [MSDOS]: Fix call sequence of dostounix_filename.
Use temporary file template that is compatible with mkostemp.
Move vfork-related portions under #ifndef MSDOS.
(syms_of_callproc): Unify templates of MSDOS and WINDOWSNT.
lisp/term/pc-win.el (x-list-fonts, x-get-selection-value): Provide
doc strings, as required by snarf-documentation.
msdos/sedlisp.inp:
msdos/sedlibmk.inp:
msdos/sedleim.inp:
msdos/sed3v2.inp:
msdos/sed2v2.inp:
msdos/sed1v2.inp: Update Sed scripts for Emacs 24.4.
msdos/inttypes.h: Add PRIdMAX.
msdos/INSTALL: Update for Emacs 24.4.
msdos/sedadmin.inp: New file.
2014-04-16 13:27:28 +00:00
|
|
|
|
#ifndef MSDOS
|
2013-09-23 13:15:29 +00:00
|
|
|
|
DEFSYM (Qtty_menu_next_item, "tty-menu-next-item");
|
|
|
|
|
DEFSYM (Qtty_menu_prev_item, "tty-menu-prev-item");
|
|
|
|
|
DEFSYM (Qtty_menu_next_menu, "tty-menu-next-menu");
|
|
|
|
|
DEFSYM (Qtty_menu_prev_menu, "tty-menu-prev-menu");
|
|
|
|
|
DEFSYM (Qtty_menu_select, "tty-menu-select");
|
|
|
|
|
DEFSYM (Qtty_menu_ignore, "tty-menu-ignore");
|
|
|
|
|
DEFSYM (Qtty_menu_exit, "tty-menu-exit");
|
2013-09-25 14:51:39 +00:00
|
|
|
|
DEFSYM (Qtty_menu_mouse_movement, "tty-menu-mouse-movement");
|
2013-09-23 13:15:29 +00:00
|
|
|
|
DEFSYM (Qtty_menu_navigation_map, "tty-menu-navigation-map");
|
Fix the MSDOS build.
src/unexcoff.c [MSDOS]: Include libc/atexit.h.
(copy_text_and_data): Zero out the atexit chain pointer before
dumping Emacs.
src/termhooks.h (encode_terminal_code): Update prototype.
src/term.c (encode_terminal_code) [DOS_NT]: Make it externally
visible for all DOS_NT ports, not just WINDOWSNT.
(syms_of_term) [!MSDOS]: Don't define 'tty-menu-*' symbols on MSDOS.
src/sysdep.c (emacs_sigaction_init, init_signals): Don't use SIGCHLD
unless it is defined.
(emacs_pipe) [MSDOS]: Redirect to 'pipe'.
src/process.c (close_on_exec, accept4, process_socket): Move into
the "ifdef subprocesses" part.
(catch_child_signal): Condition by "ifdef subprocesses".
(syms_of_process) <Qinternal_default_process_sentinel>
<Qinternal_default_process_filter>: Condition by "ifdef subprocesses".
src/msdos.h: Add prototypes for new functions.
(EINPROGRESS): Define.
(O_CLOEXEC): Define to zero.
src/msdos.c (check_window_system): Remove unnecessary an
incompatible duplicate function.
(sys_opendir, readlinkat, faccessat, fstatat, unsetenv): New
functions in support of new functionality.
src/menu.c (single_menu_item): Add visual indication of submenu
also for menus on MSDOS frames.
(Fx_popup_menu) [!MSDOS]: Do not call tty_menu_show on MSDOS.
src/lisp.h (CHECK_PROCESS) [!subprocesses]: Do not define
when async subprocesses aren't supported.
src/font.h (FONT_WIDTH) [MSDOS]: MSDOS-specific definition.
src/emacs.c (close_output_streams): Zero out errno before calling
close_stream.
src/dired.c [MSDOS]: Include msdos.h.
src/conf_post.h (opendir) [MSDOS]: Redirect to sys_opendir.
(DATA_START) [MSDOS]: Define.
(SYSTEM_PURESIZE_EXTRA) [MSDOS]: Enlarge by 25K.
src/callproc.c (block_child_signal, unblock_child_signal) [MSDOS]:
Ifdef away for MSDOS.
(record_kill_process) [MSDOS]: Ifdef away the entire body for MSDOS.
(call_process_cleanup) [MSDOS]: Ifdef away portions not relevant
for MSDOS.
(call_process) [MSDOS]: Fix call sequence of dostounix_filename.
Use temporary file template that is compatible with mkostemp.
Move vfork-related portions under #ifndef MSDOS.
(syms_of_callproc): Unify templates of MSDOS and WINDOWSNT.
lisp/term/pc-win.el (x-list-fonts, x-get-selection-value): Provide
doc strings, as required by snarf-documentation.
msdos/sedlisp.inp:
msdos/sedlibmk.inp:
msdos/sedleim.inp:
msdos/sed3v2.inp:
msdos/sed2v2.inp:
msdos/sed1v2.inp: Update Sed scripts for Emacs 24.4.
msdos/inttypes.h: Add PRIdMAX.
msdos/INSTALL: Update for Emacs 24.4.
msdos/sedadmin.inp: New file.
2014-04-16 13:27:28 +00:00
|
|
|
|
#endif
|
1994-04-08 06:59:55 +00:00
|
|
|
|
}
|