1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00
Commit Graph

68 Commits

Author SHA1 Message Date
Paul Eggert
63cfb75f3a Include-file cleanup for src directory
Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707).
In a few cases, add ‘#include "foo.h"’ if the file needs foo.h
but does not include it directly.  As a general rule, a source
file should include foo.h if it needs the interfaces that foo.h
defines.
* src/alloc.c: Don’t include process.h.  Include dispextern.h,
systime.h.
* src/atimer.c: Don’t include blockinput.h.
* src/buffer.c: Include coding.h, systime.h.  Don’t include
keyboard.h, coding.h.
* src/callint.c: Don’t include commands.h, keymap.h.
* src/callproc.c: Don’t include character.h, ccl.h, composite.h,
systty.h, termhooks.h.
* src/casetab.c: Don’t include character.h.
* src/category.c: Don’t include charset.h, keymap.h.
* src/ccl.h: Don’t include character.h.
* src/character.c: Don’t include charset.h.
* src/charset.c: Don’t include disptab.h.
* src/chartab.c: Don’t include ccl.h.
* src/cm.c: Don’t include frame.h, termhooks.h.
* src/cmds.c: Don’t include window.h, dispextern.h.
* src/coding.c: Don’t include window.h, frame.h.
* src/composite.c: Include composite.h.  Don’t include window.h,
font.h.
* src/data.c: Don’t include syssignal.h, termhooks.h, font.h.
* src/dbusbind.c: Don’t include frame.h.
* src/decompress.c: Don’t include character.h.
* src/dired.c: Don’t include character.h, commands.h, charset.h.
* src/dispnew.c: Don’t include character.h, indent.h, intervals.h,
process.h, timespec.h.  Include systime.h.
* src/doc.c: Include coding.h.  Don’t include keyboard.h.
* src/editfns.c: Include composite.h.  Don’t include frame.h.
* src/emacs.c: Include fcntl.h, coding.h.  Don’t include
commands.h, systty.h..
* src/fileio.c: Don’t include intervals.h, dispextern.h.
Include composite.h.
* src/filelock.c: Don’t include character.h, systime.h.
* src/fns.c: Don’t include time.h, commands.h, keyboard.h,
keymap.h, frame.h, blockinput.h, xterm.h.  Include composite.h.
* src/font.c: Include termhooks.h.
* src/font.h: Don’t include ccl.h, frame.h.  Add forward decls of
struct composition_it, struct face, struct glyph_string.
* src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h,
intervals.h, window.h, termhooks.h.
* src/frame.c: Don’t include character.h, commands.h, font.h.
* src/frame.h: Don’t include dispextern.h.
* src/fringe.c: Don’t include character.h.
* src/ftcrfont.c: Don’t include dispextern.h, frame.h,
character.h, charset.h, fontset.h.
* src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h,
fontset.h.
* src/ftxfont.c: Don’t include dispextern.h, character.h,
charset.h, fontset.h.
* src/gfilenotify.c: Don’t include frame.h, process.h.
* src/gtkutil.c: Include dispextern.h, frame.h, systime.h.
Don’t include syssignal.h, buffer.h, charset.h, font.h.
* src/gtkutil.h: Don’t include frame.h.
* src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h.
Don’t include character.h.
* src/indent.c: Don’t include keyboard.h, termchar.h.
* src/inotify.c: Don’t include character.h, frame.h.
* src/insdel.c: Include composite.h.  Don’t include blockinput.h.
* src/intervals.c: Don’t include character.h, keyboard.h.
* src/intervals.h: Don’t include dispextern.h, composite.h.
* src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h.
Include coding.h.
* src/keyboard.h: Don’t incldue systime.h.
* src/keymap.c: Don’t include charset.h, frame.h.
* src/lread.c: Include dispextern.h and systime.h.
Don’t include frame.h.  Include systime.h.
* src/macros.c: Don’t include commands.h, character.h, buffer.h.
* src/menu.c: Include character.h, coding.h.  Don’t include
dispextern.h.
* src/menu.h: Don’t include systime.h.
* src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h,
intervals.h, termhooks.h.
* src/print.c: Include coding.h.  Don’t include keyboard.h,
window.h, dispextern.h, termchar.h, termhooks.h, font.h.
Add forward decl of struct terminal.
* src/process.c: Don’t include termhooks.h, commands.h,
dispextern.h, composite.h.
* src/region-cache.c: Don’t include character.h.
* src/scroll.c: Don’t include keyboard.h, window.h.
* src/search.c: Don’t include category.h, commands.h.
* src/sound.c: Don’t include dispextern.h.
* src/syntax.c: Don’t include command.h, keymap.h.
* src/sysdep.c: Don’t include window.h, dispextern.h.
* src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’,
* src/term.c: Don’t include systty.h, intervals.h, xterm.h.
* src/terminal.c: Include character.h.
Don’t include charset.h, coding.h.
* src/textprop.c: Don’t include character.h.
* src/undo.c: Don’t include character.h, commands.h, window.h.
* src/unexsol.c: Don’t include character.h, charset.h.
* src/widget.c: Include widget.h.  Don’t include keyboard.h,
window.h, dispextern.h, blockinput.h, character.h, font.h.
* src/widgetprv.h: Don’t include widget.h.
* src/window.c: Don’t include character.h, menu.h, intervals.h.
* src/xdisp.c: Include composite.h, systime.h.  Don’t include
macros.h, process.h.
* src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h,
intervals.h.
* src/xfns.c: Don’t include menu.h, character.h, intervals.h,
epaths.h, fontset.h, systime.h, atimer.h, termchar.h.
* src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h.
* src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h.
* src/xgselect.c: Don’t include timespec.h, frame.h.
Include systime.h.
* src/xgselect.h: Don’t include time.h.
Use a forward decl to struct timespec instead.
* src/xmenu.c: Don’t include keymap.h, character.h, charset.h,
dispextern.h.  Include systime.h.
* src/xml.c: Don’t include character.h.
* src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h.
* src/xselect.c: Don’t include dispextern.h, character.h,
buffer.h, process.h.
* src/xsmfns.c: Don’t include systime.h, sysselect.h.
* src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h,
intervals.h process.h, keymap.h, xgselect.h.  Include composite.h.
2015-10-20 18:35:53 -07:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Andreas Schwab
908589fd28 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 13:59:45 +01:00
Paul Eggert
e37778785a Remove obsolete references to VAX in comments. 2013-02-10 16:35:37 -08:00
Paul Eggert
ab422c4d68 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
Paul Eggert
0328b6de4a Port better to POSIX hosts lacking _setjmp.
* configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols.
(_setjmp, _longjmp): Remove.
* src/lisp.h: Include <setjmp.h> here, since we use its symbols here.
All instances of '#include <setjmp.h>' removed, if the
only reason for the instance was because "lisp.h" was included.
(sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
and _longjmp with the new symbols.  Emacs already uses _setjmp if
available, so this change affects only POSIXish hosts that have
sigsetjmp but not _setjmp, such as some versions of Solaris and
Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
* src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
(png_load_body) [HAVE_PNG]:
(PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
(PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
since PNG requires jmp_buf.  This is the only exception to the
general rule that we now use sys_setjmp and sys_longjmp.
This exception is OK since this code does not change the signal
mask or longjmp out of a signal handler.

Fixes: debbugs:12446
2012-09-15 00:06:56 -07:00
Paul Eggert
1088b9226e Simplify redefinition of 'abort' (Bug#12316).
Do not try to redefine the 'abort' function.  Instead, redo
the code so that it calls 'emacs_abort' rather than 'abort'.
This removes the need for the NO_ABORT configure-time macro
and makes it easier to change the abort code to do a backtrace.
* configure.ac (NO_ABRT): Remove.
* admin/CPP-DEFINES (NO_ABORT): Remove.
* nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove.
* src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
* src/emacs.c (abort) [!DOS_NT && !NO_ABORT]:
Remove; sysdep.c's emacs_abort now takes its place.
* src/lisp.h (emacs_abort): New decl.  All calls from Emacs code to
'abort' changed to use 'emacs_abort'.
* src/msdos.c (dos_abort) [defined abort]: Remove; not used.
(abort) [!defined abort]: Rename to ...
(emacs_abort): ... new name.
* src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
the place of the old 'abort' in emacs.c.
* src/w32.c, src/w32fns.c (abort): Do not #undef.
* src/w32.c (emacs_abort): Rename from w32_abort.
2012-09-04 10:34:54 -07:00
Glenn Morris
acaf905b11 Add 2012 to FSF copyright years for Emacs files 2012-01-05 01:46:05 -08:00
Andreas Schwab
268c2c36f4 Protoize
* src/alloc.c (reset_malloc_hooks): Protoize.
* src/cm.c (losecursor): Likewise.
* src/ralloc.c (r_alloc_check): Likewise.
2011-07-10 10:52:10 +02:00
Paul Eggert
12ea59a297 * cm.c (calccost): Turn while-do into do-while, for clarity. 2011-03-23 01:06:21 -07:00
Paul Eggert
af8a867c62 Make tparam.h and terminfo.c consistent.
* cm.c (tputs, tgoto, BC, UP): Remove extern decls.  Include
tparam.h instead, since it declares them.
* cm.h (PC): Remove extern decl; tparam.h now does this.
* deps.mk (cm.o, terminfo.o): Depend on tparam.h.
* terminfo.c: Include tparam.h, to check interfaces.
(tparm): Make 1st arg a const pointer in decl.  Put it at top level.
(tparam): Adjust signature to match interface in tparam.h;
this removes some undefined behavior.  Check that outstring and len
are zero, which they always are with Emacs.
* tparam.h (PC, BC, UP): New extern decls.
2011-03-19 15:46:50 -07:00
Paul Eggert
fbceeba21b * cm.c (calccost, cmgoto): Use const pointers where appropriate.
* cm.h (struct cm): Likewise.
* dispextern.h (do_line_insertion_deletion_costs): Likewise.
* scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
* term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
(term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
(turn_on_face, init_tty): Likewise.
* termchar.h (struct tty_display_info): Likewise.
* term.c (tgetflag, tgetnum, tgetstr): Redefine to use const pointers.
2011-03-08 18:12:00 -08:00
Paul Eggert
6be7d3dab6 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
deduce are never used uninitialized.
2011-03-08 09:28:17 -08:00
Glenn Morris
73b0cd5003 Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
Glenn Morris
0d9f702fd0 Nuke arch-tags. 2011-01-15 15:16:57 -08:00
Stefan Monnier
77ab81d054 Merge from emacs-23 2011-01-14 12:18:41 -05:00
Glenn Morris
5df4f04cd3 Add 2011 to FSF/AIST copyright years. 2011-01-02 15:50:46 -08:00
Andreas Schwab
72af86bd8c 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-08 00:18:28 +02:00
Juanma Barranquero
d3da34e0da Convert most remaining function definitions to standard C.
* buffer.c, cm.c, eval.c, keyboard.c, process.c, term.c, vm-limit.c,
* xdisp.c: Convert function definitions to standard C.

* cm.c (cmputc): Arg C is now int, not char.
* process.c (Fmake_network_process): Cast sockaddr_in* to sockaddr*.
2010-07-05 12:36:06 +02:00
Juanma Barranquero
3a35a84c93 Fix prototypes.
* src/cm.c (evalcost): Fix arg type.
* src/cm.h (evalcost): Fix prototype.
* src/lisp.h (memory_warnings): Fix prototype.

* lib-src/ebrowse.c (match_qualified_namespace_alias):
  Pass sym* to find_namespace, not link*.
* lib-src/emacsclient.c (send_to_emacs, quote_argument): Arg s is HSOCKET.
* lib-src/sorted-doc.c (qsort_compare): New typedef.
  (main): Use it to cast cmpdoc.
2010-07-03 09:44:17 +02:00
Jan D
f57e2426f0 Remove __P and P_ from .c and .m files and definition of P_
* lisp.h:
* atimer.h: Remove define for P_.

* alloc.c: Remove __P and P_ from .c and .m files.
* atimer.c:
* buffer.c:
* callint.c:
* category.c:
* charset.c:
* chartab.c:
* cm.c:
* coding.c:
* composite.c:
* data.c:
* dired.c:
* dispnew.c:
* doc.c:
* editfns.c:
* emacs.c:
* eval.c:
* fileio.c:
* filelock.c:
* fns.c:
* font.c:
* fontset.c:
* frame.c:
* ftfont.c:
* ftxfont.c:
* gmalloc.c:
* gtkutil.c:
* image.c:
* indent.c:
* intervals.c:
* keyboard.c:
* keymap.c:
* lread.c:
* marker.c:
* menu.c:
* minibuf.c:
* print.c:
* process.c:
* scroll.c:
* search.c:
* sound.c:
* strftime.c:
* syntax.c:
* sysdep.c:
* term.c:
* terminal.c:
* textprop.c:
* unexalpha.c:
* w32console.c:
* w32fns.c:
* w32font.c:
* w32menu.c:
* w32term.c:
* w32uniscribe.c:
* window.c:
* xdisp.c:
* xfaces.c:
* xfns.c:
* xfont.c:
* xftfont.c:
* xmenu.c:
* xselect.c:
* xterm.c: Likewise.

* ebrowse.c: Remove P_ and __P.
* etags.c:
* movemail.c:
* pop.c:
* update-game-score.c: Likewise.
2010-07-02 14:19:53 +02:00
Eli Zaretskii
6da23aaa4f Don't use termcap.c on Posix platforms, only on MS-DOS.
configure.in <AC_CHECK_HEADERS>: Remove termcap.h.
 configure: Regenerated.
 src/Makefilie.in (termcapobj): Move termcap.o from here...
 (MSDOS_OBJ): ...to here.
 (termcapobj) [!LIBS_TERMCAP]: Remove specialized value, as it is
 now identical to when LIBS_TERMCAP is defined.
 src/term.c: Remove (ifdef'ed away) inclusion of termcap.h.
 src/cm.c: Remove (ifdef'ed away) inclusion of termcap.h.
 src/config.in: Regenerated.
2010-03-12 11:34:27 -05:00
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08:00
Dan Nicolaescu
d7306fe6b1 * alloc.c: Do not define struct catchtag.
* eval.c: Move struct catchtag definition ...
* lisp.h: ... here.

* image.c: Move png.h #include earlier to avoid warnings.

* xterm.c:
* xsmfns.c:
* xselect.c:
* xrdb.c:
* xmenu.c:
* xftfont.c:
* xfont.c:
* xfns.c:
* xfaces.c:
* xdisp.c:
* window.c:
* widget.c:
* w32xfns.c:
* w32uniscribe.c:
* w32term.c:
* w32select.c:
* w32reg.c:
* w32proc.c:
* w32menu.c:
* w32inevt.c:
* w32heap.c:
* w32font.c:
* w32fns.c:
* w32console.c:
* w32.c:
* w16select.c:
* vm-limit.c:
* unexsol.c:
* unexec.c:
* unexcw.c:
* unexaix.c:
* undo.c:
* tparam.c:
* textprop.c:
* terminfo.c:
* terminal.c:
* termcap.c:
* term.c:
* syntax.c:
* sound.c:
* sheap.c:
* search.c:
* scroll.c:
* region-cache.c:
* regex.c:
* ralloc.c:
* process.c:
* print.c:
* msdos.c:
* minibuf.c:
* menu.c:
* marker.c:
* macros.c:
* keymap.c:
* keyboard.c:
* intervals.c:
* insdel.c:
* indent.c:
* gtkutil.c:
* ftxfont.c:
* ftfont.c:
* fringe.c:
* frame.c:
* fontset.c:
* font.c:
* fns.c:
* floatfns.c:
* filelock.c:
* fileio.c:
* emacs.c:
* editfns.c:
* dosfns.c:
* doprnt.c:
* doc.c:
* dispnew.c:
* dired.c:
* dbusbind.c:
* data.c:
* composite.c:
* coding.c:
* cmds.c:
* cm.c:
* chartab.c:
* charset.c:
* character.c:
* ccl.c:
* category.c:
* casetab.c:
* casefiddle.c:
* callproc.c:
* callint.c:
* bytecode.c:
* buffer.c:
* atimer.c: Include setjmp.h.  (Bug#4643)

* xlwmenu.c:
* lwlib.c:
* lwlib-utils.c:
* lwlib-Xm.c:
* lwlib-Xlw.c:
* lwlib-Xaw.c: Include setjmp.h.
2009-10-19 04:27:09 +00:00
Glenn Morris
76b6f70759 Add 2009 to copyright years. 2009-01-08 03:15:17 +00:00
Glenn Morris
9ec0b715e2 Switch to recommended form of GPLv3 permissions notice. 2008-05-14 07:50:26 +00:00
Miles Bader
59ce725a3b Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-987
2008-01-08 20:46:54 +00:00
Glenn Morris
8cabe764e9 Add 2008 to copyright years. 2008-01-08 04:37:27 +00:00
Miles Bader
9899d01a0c Merge from emacs--devo--0
Patches applied:

 * emacs--devo--0  (patch 824-838)

   - Update from CVS
   - Merge from emacs--rel--22
   - Remove lisp/erc/erc-nicklist.el
   - Update some .arch-inventory files
   - Fix void function definition error in cus-edit.el
   - Restore lisp/emacs-lisp/cl-loaddefs.el

 * emacs--rel--22  (patch 70-83)

   - Update from CVS
   - Remove lisp/erc/erc-nicklist.el
   - Update some .arch-inventory files
   - Indicate that emacs--devo--0--patch-834 does not need to be applied
   - Merge from gnus--rel--5.10
   - Restore lisp/emacs-lisp/cl-loaddefs.el

 * gnus--rel--5.10  (patch 239-241)

   - Merge from emacs--devo--0
   - Update from CVS

Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-28
2007-07-31 05:50:45 +00:00
Glenn Morris
684d6f5bcc Switch license to GPLv3 or later. 2007-07-25 05:19:07 +00:00
Karoly Lorentey
93afd0f1d4 Merged from emacs@sv.gnu.org
Patches applied:

 * emacs@sv.gnu.org/emacs--devo--0--patch-599
   Merge from erc--main--0

 * emacs@sv.gnu.org/emacs--devo--0--patch-600
   Merge from erc--main--0

 * emacs@sv.gnu.org/emacs--devo--0--patch-601
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-602
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-603
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-604
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-605
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-606
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-607
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-608
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-609
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-610
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-611
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-612
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-613
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-614
   Make byte compiler correctly write circular constants

 * emacs@sv.gnu.org/emacs--devo--0--patch-615
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-616
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-617
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-618
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-192
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-193
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-194
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-195
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-196
   Update from CVS

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-594
2007-01-29 22:21:19 +00:00
Glenn Morris
429ab54e01 Update copyright for years from Emacs 21 to present (mainly adding
2001).
2007-01-14 03:38:22 +00:00
Karoly Lorentey
1913a2b35d Merged from emacs@sv.gnu.org
Patches applied:

 * emacs@sv.gnu.org/emacs--devo--0--patch-49
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-50
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-51
   Make constrain-to-field notice overlays

 * emacs@sv.gnu.org/emacs--devo--0--patch-52
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-53
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-54
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-55
   Merge from erc--emacs--0

 * emacs@sv.gnu.org/emacs--devo--0--patch-56
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-57
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-58
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-59
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-60
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-61
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-62
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-63
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-64
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-65
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-66
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-67
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-68
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-69
   rcirc: Add flexible response formatting; Add nick abbrevs

 * emacs@sv.gnu.org/emacs--devo--0--patch-70
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-71
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-72
   Update from CVS: man/dired.texi (Tumme): More tumme documentation.

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-18
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-19
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-20
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-21
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-22
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-23
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-24
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-25
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-26
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-27
   Update from CVS: lisp/gnus.el: Remove bogus comment.

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-28
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-29
   Add sendmail.el and smptmail.el from Emacs tree to contrib/

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-508
2006-02-12 00:15:44 +00:00
Thien-Thi Nguyen
aaef169dc6 Update years in copyright notice; nfc. 2006-02-06 15:23:23 +00:00
Karoly Lorentey
fbf3497344 Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Patches applied:

 * lorentey@elte.hu--2004/emacs--cvs-trunk--0--base-0
   tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-474

 * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-1
   Add CVS metadata files.

 * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-2
   Update from CVS.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-393
2005-09-04 03:48:17 +00:00
Thien-Thi Nguyen
0b5538bd85 Update years in copyright notice; nfc. 2005-08-07 12:33:19 +00:00
Karoly Lorentey
d5dc920668 Merged from miles@gnu.org--gnu-2005 (patch 469)
Patches applied:

 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-469
   Update from CVS

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-372
2005-07-05 22:22:24 +00:00
Lute Kamstra
4fc5845fe8 Update FSF's address. 2005-07-04 16:49:24 +00:00
Karoly Lorentey
0b0d3e0bce 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
Karoly Lorentey
c3b4957fff Cosmetic changes.
src/cm.c (calccost, cmgoto): Cosmetic changes.
src/keyboard.c (kbd_buffer_get_event, Fcurrent_input_mode): Ditto.
src/term.c: Cosmetic changes.

src/termchar.h (top_frame): Removed obsolete TODO comment.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-67
2004-01-25 01:17:40 +00:00
Karoly Lorentey
da8e11156a 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
Karoly Lorentey
428a555ec5 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
Karoly Lorentey
4d553a13ab Portability fixes (now it compiles & runs fine on Solaris).
lib-src/emacsclient.c: Removed tty proxy kludge.  Emacs should just
use the same terminal as emacsclient.
(ec_get_tty, ec_set_tty, master, pty_name, old_tty, tty, old_tty_valid)
(tty_erase_char, quit_char, flow_control, meta_key, _sobuf, init_tty)
(window_change, reset_tty, init_pty, copy_from_to)
(pty_conversation): Removed.
(window_change_signal): Just forward the signal to Emacs, don't do
anything else.
(init_signals): Don't set handlers for SIGHUP & SIGINT.
(strprefix): New function.
(main): Don't touch the terminal, simply tell its name to Emacs.

lisp/server.el (server-frames): Changed name and semantics to server-ttys.
(server-tty-live-p): New function.
(server-sentinel): Delete the whole tty, not just the frame.
(server-handle-delete-frame): Removed.
(server-handle-delete-tty): New function. Close the client connection if
the tty is deleted.
(server-start): Clean up server-ttys, not server-frames.  Set up
delete-tty-after-functions.
(server-process-filter): Set up server-ttys, not server-frames.
Updated protocol for sending our pid to emacsclient.
(server-buffer-done): Don't delete the client process directly, delete
the tty instead, and rely on the delete-tty hook to close the
connection.  Otherwise the terminal could be left in a bad state.

src/cm.c (cmputc): Don't abort on write errors.

src/indent.c: #include <stdio.h>, for termchar.h.
src/window.c: Ditto.
src/xfaces.c: Ditto.

src/sysdep.c (init_sigio, reset_sigio, request_sigio)[!SIGIO]
(unrequest_sigio)[!SIGIO]: If SIGIO is not supported, don't do
anything. (For Solaris.)
(init_sys_modes): Moved tty_set_terminal_modes call back to here,
disable window system check.
(reset_sys_modes): Reset the terminal even if X is running.

src/term.c (Vdelete_tty_after_functions): New variable.
(syms_of_term): Initialize it.
(Fdelete_tty): Updated docs.
(delete_tty): Run delete-tty-after-functions.
(term_init): Removed tty_set_terminal_modes call.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-35
2004-01-03 08:31:14 +00:00
Karoly Lorentey
28d7d09f84 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
Karoly Lorentey
b2af72d2f0 Make sure secondary frames are deleted when emacsclient quits.
lisp/server.el (server-sentinel): Delete frame if alive.  Fix delq
invocation on server-frames.  
(server-process-filter, server-buffer-done): Fix delq invocation on
server-frames.

src/cm.c (cmputc): Abort on write error, see what happens.

src/keyboard.c (read_avail_input): Do delete_tty on read errors.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-21
2003-12-29 08:28:35 +00:00
Karoly Lorentey
04c3243c2a Trivial changes
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-18
2003-12-28 22:28:52 +00:00
Karoly Lorentey
fca177d467 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
Karoly Lorentey
6548cf002c Full support for multiple terminal I/O (with some rough edges).
lib-src/emacsclient.c (emacs_pid): New variable.  
(window_change): Forward the SIGWINCH signal to the Emacs process
after copying the size parameters to the proxy terminal.
(copy_from_to): New parameter (sigio), kill Emacs with SIGIO if it is
nonzero.
(main): Set emacs_pid.

lisp/server.el (server-process-filter): Send the pid of Emacs to emacsclient.

src/cm.c: Added tty parameters to all functions and all Wcm macro calls.

src/cm.h: Added tty parameters to all macros.   Updated function prototypes.
(Wcm): Moved to struct tty_output.

src/dispextern.h: Updated function prototypes.

src/dispnew.c: Added tty parameters to all Wcm macro calls.
(do_switch_frame): Make old frame obscured, not invisible, to solve
problems with other-frame.
(Wcm): Moved to struct tty_output.

src/keyboard.c (read_avail_input): Select the frame corresponding to
the tty that was read.  Slight rearrangement of tty loop.

src/lisp.h (tabs_safe_p): Removed duplicate prototype.

src/sysdep.c (hft_init, hft_reset): Added tty_output parameter.
(discard_tty_input): Discard input from all ttys on APOLLO, too.
Whatever it is.
(narrow_foreground_group, widen_foreground_group): Added tty parameter
(not really useful, the functions only work on the controlling tty.)
(tabs_safe_p): Added tty parameter.

src/term.c Added tty parameters to all Wcm macro calls.
Standardised updating_frame vs. selected frame and tty_output access.
(term_init): Allocate Wcm.
(syms_of_term): Provide the `multi-tty' feature.

src/termchar.h (struct tty_output): Added Wcm.

src/xdisp.c (try_window_id): Make sure we use the tty device
corresponding to the current frame.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-8
2003-12-27 01:12:57 +00:00
Karoly Lorentey
28d440abfe 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