sprintf (buf, "#<%s-console", !CONSOLE_LIVE_P (con) ? "dead" :
CONSOLE_TYPE_NAME (con));
write_c_string (buf, printcharfun);
- if (CONSOLE_LIVE_P (con))
+ if (CONSOLE_LIVE_P (con) && !NILP (CONSOLE_CONNECTION (con)))
{
write_c_string (" on ", printcharfun);
print_internal (CONSOLE_CONNECTION (con), printcharfun, 1);
}
DEFUN ("valid-console-type-p", Fvalid_console_type_p, 1, 1, 0, /*
-Given a CONSOLE-TYPE, return t if it is valid.
+Return t if CONSOLE-TYPE is a valid console type.
Valid types are 'x, 'tty, and 'stream.
*/
(console_type))
Given a console, device, frame, or window, return the associated console.
Return nil otherwise.
*/
- (obj))
+ (object))
{
- return CDFW_CONSOLE (obj);
+ return CDFW_CONSOLE (object);
}
\f
}
DEFUN ("console-type", Fconsole_type, 0, 1, 0, /*
-Return the type of the specified console (e.g. `x' or `tty').
+Return the console type (e.g. `x' or `tty') of CONSOLE.
Value is `tty' for a tty console (a character-only terminal),
`x' for a console that is an X display,
`mswindows' for a console that is a Windows NT/95/97 connection,
}
DEFUN ("console-name", Fconsole_name, 0, 1, 0, /*
-Return the name of the specified console.
+Return the name of CONSOLE.
*/
(console))
{
semi_canonicalize_console_connection (struct console_methods *meths,
Lisp_Object name, Error_behavior errb)
{
- return CONTYPE_METH_OR_GIVEN (meths, semi_canonicalize_console_connection,
- (name, errb), name);
+ if (HAS_CONTYPE_METH_P (meths, semi_canonicalize_console_connection))
+ return CONTYPE_METH (meths, semi_canonicalize_console_connection,
+ (name, errb));
+ else
+ return CONTYPE_METH_OR_GIVEN (meths, canonicalize_console_connection,
+ (name, errb), name);
}
static Lisp_Object
canonicalize_console_connection (struct console_methods *meths,
Lisp_Object name, Error_behavior errb)
{
- return CONTYPE_METH_OR_GIVEN (meths, canonicalize_console_connection,
- (name, errb), name);
+ if (HAS_CONTYPE_METH_P (meths, canonicalize_console_connection))
+ return CONTYPE_METH (meths, canonicalize_console_connection,
+ (name, errb));
+ else
+ return CONTYPE_METH_OR_GIVEN (meths, semi_canonicalize_console_connection,
+ (name, errb), name);
}
static Lisp_Object
/* Do it this way so that the console list is in order of creation */
Vconsole_list = nconc2 (Vconsole_list, Fcons (console, Qnil));
- if (CONMETH (con, initially_selected_for_input, (con)))
+ if (CONMETH_OR_GIVEN (con, initially_selected_for_input, (con), 0))
event_stream_select_console (con);
UNGCPRO;
DEFUN ("console-device-list", Fconsole_device_list, 0, 1, 0, /*
Return a list of all devices on CONSOLE.
-If CONSOLE is nil, the selected console will be used.
+If CONSOLE is nil, the selected console is used.
*/
(console))
{
}
DEFUN ("console-on-window-system-p", Fconsole_on_window_system_p, 0, 1, 0, /*
-Return non-nil if this console is on a window system.
+Return t if CONSOLE is on a window system.
+If CONSOLE is nil, the selected console is used.
This generally means that there is support for the mouse, the menubar,
the toolbar, glyphs, etc.
*/
Extcount count;
Extbyte *p;
- GET_STRING_EXT_DATA_ALLOCA (stuffstring, FORMAT_KEYBOARD, p, count);
+ TO_EXTERNAL_FORMAT (LISP_STRING, stuffstring,
+ ALLOCA, (p, count),
+ Qkeyboard);
while (count-- > 0)
stuff_char (XCONSOLE (Vcontrolling_terminal), *p++);
stuff_char (XCONSOLE (Vcontrolling_terminal), '\n');
TTY_FLAGS (con).flow_control = !NILP (flow);
TTY_FLAGS (con).meta_key = meta_key;
init_one_console (con);
+ MARK_FRAME_CHANGED (XFRAME (CONSOLE_SELECTED_FRAME (con)));
}
#endif
void
syms_of_console (void)
{
+ INIT_LRECORD_IMPLEMENTATION (console);
+
DEFSUBR (Fvalid_console_type_p);
DEFSUBR (Fconsole_type_list);
DEFSUBR (Fcdfw_console);
}
static const struct lrecord_description cte_description_1[] = {
- { XD_LISP_OBJECT, offsetof(console_type_entry, symbol), 1 },
- { XD_STRUCT_PTR, offsetof(console_type_entry, meths), 1, &console_methods_description },
+ { XD_LISP_OBJECT, offsetof (console_type_entry, symbol) },
+ { XD_STRUCT_PTR, offsetof (console_type_entry, meths), 1, &console_methods_description },
{ XD_END }
};
static const struct struct_description cte_description = {
- sizeof(console_type_entry),
+ sizeof (console_type_entry),
cte_description_1
};
static const struct lrecord_description cted_description_1[] = {
- XD_DYNARR_DESC(console_type_entry_dynarr, &cte_description),
+ XD_DYNARR_DESC (console_type_entry_dynarr, &cte_description),
{ XD_END }
};
const struct struct_description cted_description = {
- sizeof(console_type_entry_dynarr),
+ sizeof (console_type_entry_dynarr),
cted_description_1
};
static const struct lrecord_description console_methods_description_1[] = {
- { XD_LISP_OBJECT, offsetof(struct console_methods, symbol), 2 },
- { XD_LISP_OBJECT, offsetof(struct console_methods, image_conversion_list), 1 },
+ { XD_LISP_OBJECT, offsetof (struct console_methods, symbol) },
+ { XD_LISP_OBJECT, offsetof (struct console_methods, predicate_symbol) },
+ { XD_LISP_OBJECT, offsetof (struct console_methods, image_conversion_list) },
{ XD_END }
};
const struct struct_description console_methods_description = {
- sizeof(struct console_methods),
+ sizeof (struct console_methods),
console_methods_description_1
};
}
/* The docstrings for DEFVAR_* are recorded externally by make-docfile. */
-
-/* Declaring this stuff as const produces 'Cannot reinitialize' messages
- from SunPro C's fix-and-continue feature (a way neato feature that
- makes debugging unbelievably more bearable) */
#define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magicfun) do { \
- static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \
- = { { { symbol_value_forward_lheader_initializer, \
- (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \
- forward_type }, magicfun }; \
+ static const struct symbol_value_forward I_hate_C = \
+ { /* struct symbol_value_forward */ \
+ { /* struct symbol_value_magic */ \
+ { /* struct lcrecord_header */ \
+ { /* struct lrecord_header */ \
+ lrecord_type_symbol_value_forward, /* lrecord_type_index */ \
+ 1, /* mark bit */ \
+ 1, /* c_readonly bit */ \
+ 1 /* lisp_readonly bit */ \
+ }, \
+ 0, /* next */ \
+ 0, /* uid */ \
+ 0 /* free */ \
+ }, \
+ &(console_local_flags.field_name), \
+ forward_type \
+ }, \
+ magicfun \
+ }; \
+ \
{ \
int offset = ((char *)symbol_value_forward_forward (&I_hate_C) \
- (char *)&console_local_flags); \
static const struct lrecord_description console_slots_description_1[] = {
- { XD_LISP_OBJECT, 0, CONSOLE_SLOTS_COUNT },
+ { XD_LISP_OBJECT_ARRAY, 0, CONSOLE_SLOTS_COUNT },
{ XD_END }
};
*/ );
#ifdef HAVE_TTY
- /* ### Should this somehow go to TTY data? How do we make it
+ /* #### Should this somehow go to TTY data? How do we make it
accessible from Lisp, then? */
DEFVAR_CONSOLE_LOCAL ("tty-erase-char", tty_erase_char /*
The ERASE character as set by the user with stty.
*/ );
#endif
- /* While this should be CONST it can't be because some things
+ /* While this should be const it can't be because some things
(i.e. edebug) do manipulate it. */
DEFVAR_CONSOLE_LOCAL ("defining-kbd-macro", defining_kbd_macro /*
-Non-nil while a console macro is being defined. Don't set this!
+Non-nil while a keyboard macro is being defined. Don't set this!
*/ );
DEFVAR_CONSOLE_LOCAL ("last-kbd-macro", last_kbd_macro /*
-Last kbd macro defined, as a vector of events; nil if none defined.
+Last keyboard macro defined, as a vector of events; nil if none defined.
*/ );
DEFVAR_CONSOLE_LOCAL ("prefix-arg", prefix_arg /*