summaryrefslogtreecommitdiff
path: root/src/term.c
Commit message (Collapse)AuthorAgeFilesLines
* Minor cleanup for terminal setup.Dmitry Antipov2014-05-141-22/+2
| | | | | | | | | | | * termhooks.h (create_terminal): Adjust prototype. * terminal.c (create_terminal): Pass output method and RIF as args. (init_initial_terminal): * nsterm.m (ns_create_terminal): * term.c (init_tty): * w32term.c (w32_create_terminal): * xterm.c (x_create_terminal): Adjust users. Avoid redundant NULL initializers and add comments.
* Merge from emacs-24; up to 2014-05-04T21:18:30Z!eggert@cs.ucla.eduPaul Eggert2014-05-041-4/+4
|\
| * src/term.c (tty_menu_activate): A better initialization for cursor coordinates.Eli Zaretskii2014-05-011-4/+4
| |
* | Merge from emacs-24; up to 2014-05-01T10:21:17Z!rgm@gnu.orgJuanma Barranquero2014-04-301-0/+20
|\ \ | |/
| * * term.c (tty_menu_activate): Don't assume row and col are initialized.Paul Eggert2014-04-301-1/+4
| | | | | | | | | | GCC 4.9.0 warned about this, and I couldn't easily prove to my own satisfaction that they would always be initialized.
| * Place hardware TTY cursor at the active menu item when displaying a menu.Eli Zaretskii2014-04-291-0/+17
| | | | | | | | | | | | | | | | | | | | src/term.c (tty_menu_display): Move the cursor to the active menu item. (tty_menu_activate): Return the cursor to the active menu item after displaying the menu and after displaying help-echo. See http://lists.gnu.org/archive/html/emacs-devel/2014-04/msg00402.html for the details of why this is needed by screen readers and Braille displays.
* | * term.c (tty_send_additional_strings): No need to fflush here,Paul Eggert2014-04-171-3/+2
| | | | | | | | | | | | as callers fflush. (tty_set_terminal_modes): fflush after sending additional strings, not before.
* | 2014-04-17 Daniel Colascione <dancol@dancol.org>Daniel Colascione2014-04-171-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for bracketed paste mode; add infrastructure for managing terminal mode enabling and disabling automatically. * xt-mouse.el: (xterm-mouse-mode): Simplify. (xterm-mouse-tracking-enable-sequence) (xterm-mouse-tracking-disable-sequence): New constants. (turn-on-xterm-mouse-tracking-on-terminal) (turn-off-xterm-mouse-tracking-on-terminal): Use tty-mode-set-strings and tty-mode-reset-strings terminal parameters instead of random hooks. (turn-on-xterm-mouse-tracking) (turn-off-xterm-mouse-tracking): Delete. * term/xterm.el (xterm-extra-capabilities): Fix bitrotted comment. (xterm-paste-ending-sequence): New constant. (xterm-paste): New command used for bracketed paste support. (xterm-modify-other-keys-terminal-list): Delete obsolete variable. (terminal-init-xterm-bracketed-paste-mode): New function. (terminal-init-xterm): Call it. (terminal-init-xterm-modify-other-keys): Use tty-mode-set-strings and tty-mode-reset-strings instead of random hooks. (xterm-turn-on-modify-other-keys) (xterm-turn-off-modify-other-keys) (xterm-remove-modify-other-keys): Delete obsolete functions. * term/screen.el: Rewrite to just use the xterm code. Add copyright notice. Mention tmux.
* | Merge from emacs-24; up to 2014-04-16T15:28:26Z!monnier@iro.umontreal.caPaul Eggert2014-04-161-1/+3
|\ \ | |/
| * Fix the MSDOS build.Eli Zaretskii2014-04-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Rename EARRAYSIZE to ARRAYELTSDaniel Colascione2014-04-031-1/+1
| |
* | Clean up array size calculationsDaniel Colascione2014-04-031-1/+1
| |
* | Handle sigmask better with nested signal handlers.Paul Eggert2014-03-251-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Improve init_tty readabilityDaniel Colascione2014-03-231-2/+5
|/
* * src/frame.h (SET_FRAME_VISIBLE): Keep frame_garbaged up to date.Stefan Monnier2014-03-201-10/+10
| | | | | * src/xterm.c (handle_one_xevent) <MapNotify>: Don't garbage the frame. * src/frame.c (frame_garbaged): Make "docstring" more precise.
* Fix a few crashes and leaks when cloning C strings.Paul Eggert2014-02-281-11/+3
| | | | | | | | | | | * alloc.c, lisp.h (dupstring): New function. * gtkutil.c (xg_get_font): * term.c (tty_default_color_capabilities): * xsettings.c (store_monospaced_changed) (store_font_name_changed, parse_settings) (read_and_apply_settings, init_gsettings, init_gconf): Use it. This avoids some unlikely crashes due to accessing freed storage, and avoids some minor memory leaks in the more-typical case.
* Fix bug #16479 with client connections while TTY menu is open.Eli Zaretskii2014-01-251-1/+10
| | | | | | | src/term.c (read_menu_input): If the selected frame changes, exit the menu. (tty_menu_show): If the selected frame changes while we displayed a menu, throw to top level.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* Use bool for boolean, focusing on headers.Paul Eggert2013-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * nsterm.m (x_free_frame_resources):Dmitry Antipov2013-12-111-7/+2
| | | | | | | | * term.c (tty_free_frame_resources): * xterm.c (x_free_frame_resources): Do not check for non-NULL face cache because it's implied by free_frame_faces anyway. * w32term.c (x_free_frame_resources): Likewise. Do not call free_frame_faces twice.
* * src/term.c (term_get_fkeys_1): Remove non-standard IBM terminfoJuri Linkov2013-12-111-12/+0
| | | | | | as obsolete to avoid conflicts with <S-up>. Fixes: debbugs:13471
* Support resizing frames and windows pixelwise.Martin Rudalics2013-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dispextern.h (enum window_part): Add ON_SCROLL_BAR, ON_RIGHT_DIVIDER and ON_BOTTOM_DIVIDER. (struct glyph_matrix): Replace window_left_col and window_top_line by window_pixel_left and window_pixel_top. (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P): Minor rewrite. (enum face_id): Add WINDOW_DIVIDER_FACE_ID. (draw_window_divider, move_it_to, x_draw_right_divider) (x_draw_bottom_divider, change_frame_size): Add or fix declarations. * dispnew.c (change_frame_size_1): Change prototype. (adjust_glyph_matrix, required_matrix_width) (adjust_frame_glyphs_for_window_redisplay): Use pixel values instead of lines and columns. (marginal_area_string): Use WINDOW_FRINGES_WIDTH instead of WINDOW_TOTAL_FRINGE_WIDTH. (handle_window_change_signal, do_pending_window_change) (init_display): Adjusts calls of change_frame_size. (change_frame_size, change_frame_size_1): Handle pixelwise changes. * frame.c (Qright_divider_width, Qbottom_divider_width): New Lisp objects. (set_menu_bar_lines_1, set_menu_bar_lines, make_frame) (make_terminal_frame, Fmake_terminal_frame, Fframe_parameters) (x_set_internal_border_width, x_set_vertical_scroll_bars) (x_set_scroll_bar_width, x_figure_window_size): Handle pixel values. (set_frame_param): New function. (Fframe_text_cols, Fframe_text_lines, Fframe_total_cols) (Fframe_text_width, Fframe_text_height, Fscroll_bar_width) (Ffringe_width, Fborder_width, Fright_divider_width) (Fbottom_divider_width): New functions, defsubr them. (Fset_frame_height, Fset_frame_width, Fset_frame_size): New argument pixelwise. (struct frame_parm_table): New members Qright_divider_width and Qbottom_divider_width. (x_set_frame_parameters): Handle parameters for pixelwise sizes. (x_report_frame_params): Handle Qright_divider_width and Qbottom_divider_width. (x_set_right_divider_width, x_set_bottom_divider_width): New functions. (frame_resize_pixelwise): New option. * frame.h (struct frame): Add tool_bar_height, menu_bar_height, new_pixelwise, right_divider_width and bottom_divider_width; remove total_lines; rename text_lines, text_cols, new_text_lines and new_text_cols to text_height, text_width, new_height and new_width respectively. (FRAME_LINES, FRAME_COLS): Rename to FRAME_TEXT_HEIGHT and FRAME_TEXT_WIDTH respectively. (FRAME_MENU_BAR_HEIGHT, FRAME_TOOL_BAR_HEIGHT) (FRAME_RIGHT_DIVIDER_WIDTH, FRAME_BOTTOM_DIVIDER_WIDTH) (FRAME_TEXT_TO_PIXEL_WIDTH, FRAME_PIXEL_TO_TEXT_WIDTH): New macros. (FRAME_TOP_MARGIN_HEIGHT, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH) (FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH, FRAME_SCROLL_BAR_AREA_WIDTH) (SET_FRAME_COLS, SET_FRAME_WIDTH, SET_FRAME_HEIGHT) (FRAME_TEXT_COLS_TO_PIXEL_WIDTH, FRAME_PIXEL_WIDTH_TO_TEXT_COLS) (FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Rewrite macros. (FRAME_TOTAL_COLS_ARG): Remove macro. * fringe.c (draw_fringe_bitmap_1): Handle right divder. * gtkutil.c (xg_frame_resized, xg_frame_set_char_size) (x_wm_set_size_hint): Handle frame pixel sizes. * indent.c (compute_motion, Fcompute_motion): Call window_body_width instead of window_body_cols. * keyboard.c (Qright_divider, Qbottom_divider): New symbols. (make_lispy_position): Handle right and bottom dividers. (Fsuspend_emacs): Pixelize call of change_frame_size. * keyboard.h: Extern Qright_divider, Qbottom_divider. * lisp.h: Extern set_frame_param. * nsfns.m (x_set_tool_bar_lines): Pixelize call of x_set_window_size. (Fx_create_frame): Add entry for vertical_drag_cursor. Pixelize call of change_frame_size. * nsterm.h (struct ns_output): Add vertical_drag_cursor. * nsterm.m (ns_update_window_end): Optionally draw right divider. (x_set_window_size): Add argument pixelwise. Call check_frame_size and change_frame_size with pixelwise zero. (ns_draw_window_divider): New function. (ns_redisplay_interface): Add ns_draw_window_divider. (updateFrameSize:): Call change_frame_size with pixelwise zero. (x_new_font): Call x_set_window_size with pixelwise zero. * print.c (print_object): For a window print its sequence number again. * term.c (Fresume_tty): Pixelize call of change_frame_size. * w32fns.c (x_set_mouse_color): Handle vertical drag cursor. (x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise. (w32_createwindow): Use scroll bar area width. (w32_wnd_proc): Handle bottom divider width. For WM_WINDOWPOSCHANGING return zero if we resize pixelwise. (Fx_create_frame): Default divider width parameters. Caclulate sizes pixelwise. Add vertical drag cursor support. (x_create_tip_frame): Default divider widths to zero. Pixelize call to change_frame_size. (Fx_show_tip): Add handling of divider widths. Pixelize window position and sizes. (Fw32_frame_rect): New function. (frame_parm_handler w32_frame_parm_handlers): Add divider widths. (Vx_window_vertical_drag_shape): Add variable. * w32inevt.c (resize_event, maybe_generate_resize_event): Pixelize change_frame_size calls. * w32menu.c (set_frame_menubar): Pixelize x_set_window_size call. * w32term.c (w32_draw_window_divider): New function. (x_update_window_end): Handle right divider. (w32_draw_fringe_bitmap, x_scroll_run) (w32_set_vertical_scroll_bar): Pixelize scrollbar widths. (w32_read_socket): Handle SIZE_MAXIMIZED separately. Calculate new frame sizes pixelwise. (x_new_font): Pixelize call to x_set_window_size. (x_check_fullscreen): Pixelize call to change_frame_size. (x_set_window_size_1, x_set_window_size): New argument pixelwise. Calculate pixelwise. (x_wm_set_size_hint): Use scroll bar area width. (w32_redisplay_interface): Add w32_draw_window_divider. * w32term.h (struct w32_output): Add vertical drag cursor. * widget.c (set_frame_size, update_wm_hints) (EmacsFrameResize, EmacsFrameSetValues): Pixelize calls of change_frame_size. (EmacsFrameSetCharSize): Pixelize call of x_set_window_size. * window.c (sequence_number): Restore. (Fwindow_pixel_width, Fwindow_pixel_height) (Fwindow_mode_line_height, Fwindow_header_line_height) (window_pixel_to_total, Frun_window_scroll_functions) (Fset_window_new_pixel, window_resize_apply_total) (Fwindow_resize_apply_total): New functions. (window_body_height, window_body_width): Rename from window_body_lines. New argument PIXELWISE. Calculate pixelwise. (Fwindow_body_height, Fwindow_body_width): New argument PIXELWISE. (coordinates_in_window, window_relative_x_coord): Use window's pixel width instead of total width. (replace_window, recombine_windows): Initialize pixel values. (resize_root_window, resize_frame_windows, grow_mini_window) (shrink_mini_window): New argument PIXELWISE. Calculate pixelwise. (Fdelete_other_windows_internal, adjust_window_margins) (window_resize_check, window_resize_apply) (Fdelete_window_internal, Fresize_mini_window_internal) (Fwindow_text_width, Fwindow_text_height): Calculate pixelwise. (check_frame_size): Rename arguments. New argument PIXELWISE. Calculate pixelwise. (set_window_buffer): Make samebuf bool. Run configuration change hook only if buffer changed. (Fset_window_buffer): Rewrite doc-string. (make_window): Initialize new_pixel slot. (Fwindow_resize_apply): Check pixel size of root window. (Fsplit_window_internal): Call 2nd argument pixel_size. Calculate pixelwise. (Fscroll_left, Fscroll_right): Call window_body_width instead of window_body_cols. (save_window_data): New slots frame_text_width, frame_text_height, frame_menu_bar_height, frame_tool_bar_height. (saved_window): New slots pixel_left, pixel_top, pixel_height, pixel_width. (Fcurrent_window_configuration, Fset_window_configuration) (save_window_save, compare_window_configurations): Handle new slots in save_window_data and saved_window. (Fset_window_scroll_bars): Fix doc-string. (window_resize_pixelwise): New variable. (coordinates_in_window, Fcoordinates_in_window_p): Handle dividers. (make_parent_window): Adjust sequence_number. (Fwindow_right_divider_width, Fwindow_bottom_divider_width): New functions. * window.h (struct window): New members new_pixel, pixel_left, pixel_top, pixel_width, pixel_height. Restore sequence_number. (wset_new_pixel): New function. (WINDOW_PIXEL_WIDTH, WINDOW_PIXEL_HEIGHT) (MIN_SAFE_WINDOW_PIXEL_WIDTH, MIN_SAFE_WINDOW_PIXEL_HEIGHT) (WINDOW_LEFT_PIXEL_EDGE, WINDOW_RIGHT_PIXEL_EDGE) (WINDOW_TOP_PIXEL_EDGE, WINDOW_BOTTOM_PIXEL_EDGE) (WINDOW_BOTTOMMOST_P, WINDOW_BOX_LEFT_PIXEL_EDGE) (WINDOW_BOX_RIGHT_PIXEL_EDGE, WINDOW_MARGINS_COLS) (WINDOW_MARGINS_WIDTH, WINDOW_RIGHT_DIVIDER_WIDTH) (WINDOW_BOTTOM_DIVIDER_WIDTH): New macros. (WINDOW_TOTAL_FRINGE_WIDTH): Rename to WINDOW_FRINGES_WIDTH. (WINDOW_TOTAL_WIDTH, WINDOW_TOTAL_HEIGHT): Remove macros. (WINDOW_RIGHT_EDGE_X, WINDOW_LEFT_EDGE_X, WINDOW_TOP_EDGE_Y) (WINDOW_BOTTOM_EDGE_Y, WINDOW_FULL_WIDTH_P, WINDOW_LEFTMOST_P) (WINDOW_RIGHTMOST_P, WINDOW_BOX_LEFT_EDGE_X) (WINDOW_BOX_RIGHT_EDGE_X, WINDOW_FRINGE_COLS) (WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT): Rewrite. (resize_frame_windows, grow_mini_window, shrink_mini_window) (window_body_width, check_frame_size): Adapt external declarations. * xdisp.c (last_max_ascent): New integer. (window_text_bottom_y): Handle bottom divider. (window_box_width, window_box_height): Calculate pixelwise. (get_glyph_string_clip_rects): Handle right divider. (remember_mouse_glyph): When windows are resized pixelwise proceed with width and height set to 1. (init_iterator): Use WINDOW_PIXEL_WIDTH instead of WINDOW_TOTAL_WIDTH. (move_it_to): Calculate and return maximum x position encountered. (Fwindow_text_pixel_size): New function. (resize_mini_window, update_tool_bar): Calculate pixelwise. (tool_bar_lines_needed): Rename to tool_bar_height. Calculate pixelwise. (Ftool_bar_lines_needed): Rename to Ftool_bar_height. Calculate pixelwise. (redisplay_tool_bar): Calculate pixelwise. (redisplay_window): Calculate pixelwise. Handle dividers. (draw_glyphs, x_clear_end_of_line, note_mouse_highlight) (x_draw_vertical_border): Handle dividers. (define_frame_cursor1): Handle vertical drag cursor. (x_draw_right_divider, x_draw_bottom_divider): New functions. (expose_window): Calculate pixelwise. Handle dividers. (init_xdisp): Initialize pixel values. * xfaces.c (Qwindow_divider): New face. (realize_basic_faces): Realize it. * xfns.c (x_set_mouse_color): Handle vertical_drag_cursor. (x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise. (x_set_scroll_bar_default_width): Default actual width to 16. (Fx_create_frame): Set sizes pixelwise. (x_create_tip_frame): Default divider widths to zero. Pixelize call of change_frame_size. (Fx_show_tip): Handle divider widths. Initial pixel position and sizes. (frame_parm_handler x_frame_parm_handlers): Add divider widths. (Vx_window_vertical_drag_shape): New option. * xmenu.c (free_frame_menubar): Pixelize call of x_set_window_size. * xterm.c (x_draw_window_divider): New function. (x_update_window_end): Optionally draw right divider. (x_draw_fringe_bitmap, x_scroll_run, x_scroll_bar_create) (XTset_vertical_scroll_bar): Use scroll bar pixel width. (handle_one_xevent, x_new_font): Calculate pixelwise. (x_set_window_size_1, x_set_window_size): New argument pixelwise. Calculate pixelwise. (x_wm_set_size_hint): Pixelize call of check_frame_size. (struct x_redisplay_interface): Add x_draw_window_divider. * xterm.h (struct x_output): Add vertical_drag_cursor. * cus-start.el (frame-resize-pixelwise) (window-resize-pixelwise): New entries. * emacs-lisp/debug.el (debug): Use window-total-height instead of window-total-size. * frame.el (tool-bar-lines-needed): Defalias to tool-bar-height. * help.el (describe-bindings-internal): Call help-buffer (temp-buffer-max-width): New option. (resize-temp-buffer-window, help-window-setup) (with-help-window): Rewrite. * mouse.el (mouse-drag-line): Rewrite. Add key bindings for dragging dividers. * window.el (frame-char-size, window-min-pixel-height) (window-safe-min-pixel-height, window-safe-min-pixel-width) (window-min-pixel-width, window-safe-min-pixel-size) (window-combination-p, window-safe-min-size) (window-resizable-p, window--size-to-pixel) (window--pixel-to-size, window--resize-apply-p): New functions. (window-safe-min-height): Fix doc-string. (window-size, window-min-size, window--min-size-1) (window-sizable, window-sizable-p, window--min-delta-1) (window-min-delta, window--max-delta-1, window-max-delta) (window--resizable, window--resizable-p, window-resizable) (window-full-height-p, window-full-width-p, window-at-side-p) (window--in-direction-2, window-in-direction) (window--resize-reset-1, window--resize-mini-window) (window-resize, window-resize-no-error) (window--resize-child-windows-normal) (window--resize-child-windows, window--resize-siblings) (window--resize-this-window, window--resize-root-window) (window--resize-root-window-vertically) (adjust-window-trailing-edge, enlarge-window, shrink-window) (maximize-window, minimize-window, delete-window) (quit-restore-window, window-split-min-size, split-window) (balance-windows-2, balance-windows) (balance-windows-area-adjust, balance-windows-area) (window--state-get-1, window-state-get, window--state-put-1) (window--state-put-2, window-state-put) (display-buffer-record-window, window--display-buffer): Make functions handle pixelwise sizing of windows. (display-buffer--action-function-custom-type) (display-buffer-fallback-action): Add display-buffer-in-previous-window. (display-buffer-use-some-window): Resize window to height it had before. (fit-window-to-buffer-horizontally): New option. (fit-frame-to-buffer): Describe new values. (fit-frame-to-buffer-bottom-margin): Replace with fit-frame-to-buffer-margins. (window--sanitize-margin): New function. (fit-frame-to-buffer, fit-window-to-buffer): Rewrite completely using window-text-pixel-size.
* * configure.ac (HAVE_MENUS): Remove.Stefan Monnier2013-11-281-5/+5
| | | | | | | | | | | | * src/xmenu.c (Fmenu_or_popup_active_p): * src/window.c (Fset_window_configuration): * src/menu.c (Fx_popup_menu, Fx_popup_dialog): * src/keyboard.c (record_menu_key, read_char_x_menu_prompt): * src/fns.c (Fyes_or_no_p): * src/editfns.c (Fmessage_box, Fmessage_or_box): * src/alloc.c (make_save_ptr_ptr): * src/xdisp.c, src/w32menu.c, src/term.c, src/xterm.h, src/xterm.c: Remove HAVE_MENUS.
* Integer-related fixes for term.c etc.Paul Eggert2013-11-051-68/+34
| | | | | | | | | | | | | | | * dispextern.h (face_tty_specified_color): New function. * term.c (turn_on_face): Don't rely on undefined behavior when assigning an out-of-range value to 'long'. Simplify test for toggling highlight. (tty_capable_p): Omit last two (unused) args. All callers changed. * term.c (tty_capable_p, tty_menu_display, tty_menu_add_selection) (read_menu_input, tty_menu_activate, tty_menu_show): * xfaces.c (x_supports_face_attributes_p) (tty_supports_face_attributes_p): Use bool for boolean. All callers changed. (tty_supports_face_attributes_p): Omit defaults for color indices; no longer needed. Simplify tail call.
* Port to stricter C99 platforms.Paul Eggert2013-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Make some functions static in non-Microsoft builds.Paul Eggert2013-10-161-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On my platform (Fedora 19 x86-64), this shrinks the Emacs executable (text+data) by 0.25%. * dispextern.h (erase_phys_cursor) [!WINDOWSNT]: (load_color) [!MSDOS]: * gnutls.h (emacs_gnutls_transport_set_errno) [!WINDOWSNT]: * keyboard.h (make_ctrl_char) [!WINDOWSNT]: * lisp.h (check_existing): * process.h (conv_sockaddr_to_lisp, network_interface_list) (network_interface_info) [!WINDOWSNT]: * termhooks.h (encode_terminal_code) [!WINDOWSNT]: Remove extern decls. * fileio.c (check_existing): * keyboard.c (make_ctrl_char) [!WINDOWSNT]: * process.c (conv_sockaddr_to_lisp, network_interface_list) (network_interface_info) [!WINDOWSNT]: * term.c (encode_terminal_code) [!WINDOWSNT]: * xdisp.c (erase_phys_cursor) [!WINDOWSNT]: * xfaces.c (load_color) [!MSDOS]: Now static. * fileio.c (check_existing, check_executable, check_writable): * process.c (network_interface_list, network_interface_info): Move earlier, so that we don't need forward decls. * gnutls.c (fn_gnutls_transport_set_errno) (emacs_gnutls_transport_set_errno) [!WINDOWNT]: Remove; unused. * w32.c (init_environment): Use faccessat rather than check_existing, partly for consistency with the rest of the code in this file, partly so that check_existing can be static.
* Implement scrolling of TTY menus when the screen is too short.Eli Zaretskii2013-10-141-41/+73
| | | | | | | | | | | | | | | | | src/term.c (tty_menu_display): Accept an additional argument, the menu item from which to start displaying the menu. Account for the value of Y when limiting the menu to the number of available screen lines. (mi_result): New enumeration. (read_menu_input): Return enumerated value. When the y coordinate hits min_y or max_y, return scroll indication instead of wrapping around the menu. (tty_menu_activate): Handle the scrolling indications from read_menu_input. Compute the first menu item to display and pass it to tty_menu_display. lisp/menu-bar.el (tty-menu-navigation-map): Bind shifted mouse clicks to commands that scroll the menu.
* * termhooks.h (FRAME_MUST_WRITE_SPACES, FRAME_LINE_INS_DEL_OK)Dmitry Antipov2013-10-141-10/+10
| | | | | | | | | | | | | | | | | | (FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK) (FRAME_SCROLL_REGION_COST, FRAME_MEMORY_BELOW_FRAME): Adjust to match the change described below. (struct terminal): Move must_write_spaces, line_ins_del_ok, char_ins_del_ok, scroll_region_ok, scroll_region_cost and memory_below_frame members to... * termchar.h (struct tty_display_info): ...here because they're relevant only on TTYs. Prefer unsigned bitfield where appropriate. * term.c (init_tty): * nsterm.m (ns_create_terminal): * w32term.c (w32_create_terminal): * xterm.c (x_create_terminal): Adjust users. * dispnew.c (line_hash_code, line_draw_cost): Pass frame arg to filter out non-TTY frames. Adjust comment. (scrolling): Adjust user. Prefer eassert for debugging check.
* * xfaces.c (PT_PER_INCH): Remove unused macro.Dmitry Antipov2013-10-141-2/+0
| | | | | | | | | | * termhooks.h (struct terminal): Remove set-but-unused member fast_clear_end_of_line. (FRAME_FAST_CLEAR_END_OF_LINE): Remove. * nsterm.m (ns_create_terminal): * term.c (init_tty): * w32term.c (w32_create_terminal): * xterm.c (x_create_terminal): Adjust users.
* * term.c (tty_menu_show): Never return with unbalancedDmitry Antipov2013-10-111-9/+11
| | | | specpdl. Use eassert for debugging check. Adjust style.
* Menu item selection on TTYs is now cyclical.Eli Zaretskii2013-10-111-1/+5
| | | | | | src/term.c (read_menu_input): Make selection of menu items cyclical. Suggested by Dmitry Antipov <dmantipov@yandex.ru>. (tty_menu_activate): Fix off-by-one error when computing max_y.
* * dispnew.c (redraw_frame): Remove useless #ifdef becauseDmitry Antipov2013-10-111-0/+1
| | | | | | FRAME_MSDOS_P is a compile-time zero everywhere except MS-DOS. Also, move TTY fflush to... * term.c (tty_update_end): ...this function.
* Fix bug #15575 with crashes in TTY menus.Eli Zaretskii2013-10-111-3/+7
| | | | | | | | | | | src/xdisp.c (display_tty_menu_item): Make sure we never write beyond the end of the frame's glyph matrix. src/term.c (tty_menu_display): Don't move cursor while overwriting frame's glyphs with menu items. Limit the number of items displayed to what can be shown on the available screen lines, excluding the echo area. (tty_menu_activate): Limit the Y coordinate allowed by read_menu_input to the last screen line used for menu display.
* Attempt to fix crashes per bug #15575.Eli Zaretskii2013-10-101-40/+0
| | | | | | | | | src/xdisp.c (deep_copy_glyph_row): Assert that the 'used' counts of FROM and TO are identical. Copy only the glyphs of TEXT_AREA. src/term.c (save_and_enable_current_matrix): Don't allocate and don't save margin areas. (restore_desired_matrix): Don't restore margin areas. (free_saved_screen): Don't free margin areas.
* * keyboard.c (init_kboard): Now static. Add argDmitry Antipov2013-10-101-5/+1
| | | | | | | | | | | | | to denote window system. Adjust comment. (init_keyboard): Adjust user. (allocate_kboard): New function. (syms_of_keyboard): * nsterm.m (ns_term_init): * term.c (init_tty): * w32term.c (w32_create_terminal): * xterm.c (x_term_init): Use it. * keyboard.h (init_kboard): Remove prototype. (allocate_kboard): Add prototype.
* Fix minor problems in text-mode menu display.Eli Zaretskii2013-10-091-1/+1
| | | | | | | src/term.c (tty_menu_activate): Flush the output stream after showing the cursor, and don't mark the frame garbaged at exit from the function. Fixes redisplay glitches when moving from one menu to another.
* Fix minor problems found by static checking.Paul Eggert2013-10-081-52/+28
| | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Attempt to fix broken compilation on several systems due to menu.h.Eli Zaretskii2013-10-081-0/+4
| | | | src/term.c: Include "../lwlib/lwlib.h" before including menu.h.
* Support menus on text-mode terminals.Eli Zaretskii2013-10-081-0/+1121
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Cleanups and commentary changes.Eli Zaretskii2013-10-081-18/+1
| |
| * Horizontal keys in TTY menus work.Eli Zaretskii2013-10-081-10/+122
| |
| * Fix hiding cursor when displaying menu on a TTY.Eli Zaretskii2013-10-031-4/+7
| |
| * Some cleanups: remove unused code.Eli Zaretskii2013-09-261-112/+5
| |
| * Fix compilation problem due to merge from trunk.Eli Zaretskii2013-09-261-8/+1
| |
| * Merge from trunk.Eli Zaretskii2013-09-261-28/+1
| |\ | |/ |/|
| * Menu movement by mouse and keyboard live in peace now.Eli Zaretskii2013-09-251-29/+5
| |
| * Read mouse movement via read_menu_command.Eli Zaretskii2013-09-251-9/+39
| |
| * Fix crash in GUI mode and enable TTY mouse on Windows.Eli Zaretskii2013-09-241-2/+2
| |
| * Fix submenus and screen restoration.Eli Zaretskii2013-09-241-10/+55
| |
| * Use overriding-terminal-local-map for menu navigation.Eli Zaretskii2013-09-231-28/+39
| |