aboutsummaryrefslogtreecommitdiffstats
path: root/src/nsterm.m
Commit message (Collapse)AuthorAgeFilesLines
* * nsterm.m (sendEvent:): Skip mouse moved if no dialog and no EmacsJan Djärv2013-07-211-0/+18
| | | | | | frame have focus. Fixes: debbugs:14895
* Fix obscure porting bug with varargs functions.Paul Eggert2013-07-181-1/+1
| | | | | | | | | | | | | | | | The code assumed that int is treated like ptrdiff_t in a vararg function, which is not a portable assumption. There was a similar -- though these days less likely -- porting problem with various assumptions that pointers of different types all smell the same as far as vararg functions is conserved. To make this problem less likely in the future, redo the API to use varargs functions. * alloc.c (make_save_value): Remove this vararg function. All uses changed to ... (make_save_int_int_int, make_save_obj_obj_obj_obj) (make_save_ptr_int, make_save_funcptr_ptr_obj, make_save_memory): New functions. (make_save_ptr): Rename from make_save_pointer, for consistency with the above. Define only on platforms that need it. All uses changed.
* Stop cursor blink after blink-cursor-blinks (10), stop timers when not blinking.Jan Djärv2013-07-161-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * etc/NEWS: Document blink-cursor-blinks and blink timers stopped. * lisp/frame.el (blink-cursor-blinks): New defcustom. (blink-cursor-blinks-done): New defvar. (blink-cursor-start): Set blink-cursor-blinks-done to 1. (blink-cursor-timer-function): Check if number of blinks has been done on X and NS. (blink-cursor-suspend, blink-cursor-check): New defuns. * src/frame.c (Fhandle_focus_in, Fhandle_focus_out): New functions. (Fhandle_switch_frame): Call Fhandle_focus_in. (syms_of_frame): defsubr handle-focus-in/out. * src/keyboard.c (Qfocus_in, Qfocus_out): New static objects. (make_lispy_focus_in, make_lispy_focus_out): Declare and define. (kbd_buffer_get_event): For FOCUS_IN, make a focus_in event if no switch frame event is made. Check ! NILP (event->arg) if X11 (moved from xterm.c). Make focus_out event for FOCUS_OUT_EVENT if NS or X11 and there is a focused frame. (head_table): Add focus-in and focus-out. (keys_of_keyboard): Add focus-in and focus-out to Vspecial_event_map, bind to handle-focus-in/out. * src/nsterm.m (windowDidResignKey): If this is the focused frame, generate FOCUS_OUT_EVENT. * src/termhooks.h (enum event_kind): Add FOCUS_OUT_EVENT. * src/xterm.c (x_focus_changed): Always generate FOCUS_IN_EVENT. Set event->arg to Qt if switch-event shall be generated. Generate FOCUS_OUT_EVENT for FocusOut if this is the focused frame.
* Fix porting bug to older POSIXish platforms.Paul Eggert2013-07-161-1/+1
| | | | | | | | | * sysdep.c (emacs_pipe): New function, that implements pipe2 (fd, O_CLOEXEC) even on hosts that lack O_CLOEXEC. This should port better to CentOS 5 and to Mac OS X 10.6. All calls to pipe2 changed. Fixes: debbugs:14862
* Prefer list1 (X) to Fcons (X, Qnil) when building lists.Paul Eggert2013-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the code easier to read and the executable a bit smaller. Do not replace all calls to Fcons that happen to create lists, just calls that are intended to create lists. For example, when creating an alist that maps FOO to nil, use list1 (Fcons (FOO, Qnil)) rather than list1 (list1 (FOO)) or Fcons (Fcons (FOO, Qnil), Qnil). Similarly for list2 through list5. * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): * bytecode.c (exec_byte_code): * callint.c (quotify_arg, Fcall_interactively): * callproc.c (Fcall_process, create_temp_file): * charset.c (load_charset_map_from_file) (Fdefine_charset_internal, init_charset): * coding.c (get_translation_table, detect_coding_system) (Fcheck_coding_systems_region) (Fset_terminal_coding_system_internal) (Fdefine_coding_system_internal, Fdefine_coding_system_alias): * composite.c (update_compositions, Ffind_composition_internal): * dired.c (directory_files_internal, file_name_completion) (Fsystem_users): * dispnew.c (Fopen_termscript, bitch_at_user, init_display): * doc.c (Fsnarf_documentation): * editfns.c (Fmessage_box): * emacs.c (main): * eval.c (do_debug_on_call, signal_error, maybe_call_debugger) (Feval, eval_sub, Ffuncall, apply_lambda): * fileio.c (make_temp_name, Fcopy_file, Faccess_file) (Fset_file_selinux_context, Fset_file_acl, Fset_file_modes) (Fset_file_times, Finsert_file_contents) (Fchoose_write_coding_system, Fwrite_region): * fns.c (Flax_plist_put, Fyes_or_no_p, syms_of_fns): * font.c (font_registry_charsets, font_parse_fcname) (font_prepare_cache, font_update_drivers, Flist_fonts): * fontset.c (Fset_fontset_font, Ffontset_info, syms_of_fontset): * frame.c (make_frame, Fmake_terminal_frame) (x_set_frame_parameters, x_report_frame_params) (x_default_parameter, Fx_parse_geometry): * ftfont.c (syms_of_ftfont): * image.c (gif_load): * keyboard.c (command_loop_1): * keymap.c (Fmake_keymap, Fmake_sparse_keymap, access_keymap_1) (Fcopy_keymap, append_key, Fcurrent_active_maps) (Fminor_mode_key_binding, accessible_keymaps_1) (Faccessible_keymaps, Fwhere_is_internal): * lread.c (read_emacs_mule_char): * menu.c (find_and_return_menu_selection): * minibuf.c (get_minibuffer): * nsfns.m (Fns_perform_service): * nsfont.m (ns_script_to_charset): * nsmenu.m (ns_popup_dialog): * nsselect.m (ns_get_local_selection, ns_string_from_pasteboard) (Fx_own_selection_internal): * nsterm.m (append2): * print.c (Fredirect_debugging_output) (print_prune_string_charset): * process.c (Fdelete_process, Fprocess_contact) (Fformat_network_address, set_socket_option) (read_and_dispose_of_process_output, write_queue_push) (send_process, exec_sentinel): * sound.c (Fplay_sound_internal): * textprop.c (validate_plist, add_properties) (Fput_text_property, Fadd_face_text_property) (copy_text_properties, text_property_list, syms_of_textprop): * unexaix.c (report_error): * unexcoff.c (report_error): * unexsol.c (unexec): * xdisp.c (redisplay_tool_bar, store_mode_line_string) (Fformat_mode_line, syms_of_xdisp): * xfaces.c (set_font_frame_param) (Finternal_lisp_face_attribute_values) (Finternal_merge_in_global_face, syms_of_xfaces): * xfns.c (x_default_scroll_bar_color_parameter) (x_default_font_parameter, x_create_tip_frame): * xfont.c (xfont_supported_scripts): * xmenu.c (Fx_popup_dialog, xmenu_show, xdialog_show) (menu_help_callback, xmenu_show): * xml.c (make_dom): * xterm.c (set_wm_state): Prefer list1 (FOO) to Fcons (FOO, Qnil) when creating a list, and similarly for list2 through list5.
* Handle errno and exit status a bit more carefully.Paul Eggert2013-07-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/ignore-value.h: Remove this gnulib-imported file. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * admin/merge-gnulib (GNULIB_MODULES): Remove ignore-value. * src/callproc.c (child_setup) [!DOS_NT]: Don't try to stuff an error number into an exit status. Instead, use EXIT_CANCELED. (child_setup) [!MSDOS]: Avoid possible deadlock with vfork. * src/callproc.c (relocate_fd): * src/emacs.c (close_output_streams, main): * src/process.c (create_process): * src/sysdep.c (sys_subshell) [!DOS_NT || !WINDOWSNT]: Use emacs_perror for simplicity. * src/callproc.c (relocate_fd, main): * src/sysdep.c (sys_subshell): Exit with EXIT_CANCELED etc., not 1, when exec setup fails. (shut_down_emacs): Use emacs_write, not write. * src/emacs.c, src/sysdep.c: Don't include <ignore-value.h>. * src/fileio.c (Fcopy_file, e_write): * src/nsterm.m (ns_select): * src/process.c (send_process): * src/sound.c (vox_write): Use emacs_write_sig, not emacs_write. * src/lisp.h (emacs_write_sig, emacs_perror): New decls. * src/process.h (EXIT_CANCELED), EXIT_CANNOT_INVOKE, EXIT_ENOENT): New constants. * src/sysdep.c (emacs_backtrace): Use emacs_write, not ignore_value of write. (emacs_full_write): New function. (emacs_write): Rewrite to use it. (emacswrite_sig, emacs_perror): New functions. * src/xrdb.c (fatal): Don't invoke perror, since errno might be garbage.
* Make file descriptors close-on-exec when possible.Paul Eggert2013-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies Emacs a bit, since it no longer needs to worry about closing file descriptors by hand in some cases. It also fixes some unlikely races. Not all such races, as libraries often open files internally without setting close-on-exec, but it's an improvement. * admin/merge-gnulib (GNULIB_MODULES): Add fcntl, pipe2. (GNULIB_TOOL_FLAGS): Avoid binary-io, close. Do not avoid fcntl. * configure.ac (mkostemp): New function to check for. (PTY_OPEN): Pass O_CLOEXEC to posix_openpt. * lib/fcntl.c, lib/getdtablesize.c, lib/pipe2.c, m4/fcntl.m4: * m4/getdtablesize.m4, m4/pipe2.m4: New files, taken from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * nt/gnulib.mk: Remove empty gl_GNULIB_ENABLED_verify section; otherwise, gnulib-tool complains given close-on-exec changes. * nt/inc/ms-w32.h (pipe): Remove. * nt/mingw-cfg.site (ac_cv_func_fcntl, gl_cv_func_fcntl_f_dupfd_cloexec) (gl_cv_func_fcntl_f_dupfd_works, ac_cv_func_pipe2): New vars. * src/alloc.c (valid_pointer_p) [!WINDOWSNT]: * src/callproc.c (Fcall_process) [!MSDOS]: * src/emacs.c (main) [!DOS_NT]: * src/nsterm.m (ns_term_init): * src/process.c (create_process): Use 'pipe2' with O_CLOEXEC instead of 'pipe'. * src/emacs.c (Fcall_process_region) [HAVE_MKOSTEMP]: * src/filelock.c (create_lock_file) [HAVE_MKOSTEMP]: Prefer mkostemp with O_CLOEXEC to mkstemp. * src/callproc.c (relocate_fd) [!WINDOWSNT]: * src/emacs.c (main): Use F_DUPFD_CLOEXEC, not plain F_DUPFD. No need to use fcntl (..., F_SETFD, FD_CLOEXEC), since we're now using pipe2. * src/filelock.c (create_lock_file) [! HAVE_MKOSTEMP]: Make the resulting file descriptor close-on-exec. * src/lisp.h, src/lread.c, src/process.c (close_load_descs, close_process_descs): * src/lread.c (load_descriptor_list, load_descriptor_unwind): Remove; no longer needed. All uses removed. * src/process.c (SOCK_CLOEXEC): Define to 0 if not supplied by system. (close_on_exec, accept4, process_socket) [!SOCK_CLOEXEC]: New functions. (socket) [!SOCK_CLOEXEC]: Supply a substitute. (Fmake_network_process, Fnetwork_interface_list): (Fnetwork_interface_info, server_accept_connection): Make newly-created socket close-on-exec. * src/sysdep.c (emacs_open, emacs_fopen): Make new-created descriptor close-on-exec. * src/w32.c (fcntl): Support F_DUPFD_CLOEXEC well enough for Emacs. * src/w32.c, src/w32.h (pipe2): Rename from 'pipe', with new flags arg. Fixes: debbugs:14803
* *** empty log message ***Jan Djärv2013-07-071-0/+10
|
* * lisp/files.el (write-file): Do not display confirm dialog for NS,Jan Djärv2013-07-061-7/+14
| | | | | | | | | | | | | | | | | | it does its own dialog, which can't be cancelled. * src/nsfns.m: Remove panelOK. (ns_fd_data): New. (ns_run_file_dialog): New function. (Fns_read_file_name): Fill in ns_fd_data, post an event and start the event loop, so file dialog is popped up by ns_run_file_dialog, called by sendEvent (Bug#14578). (EmacsSavePanel, EmacsOpenPanel): Remove ok and cancel methods. * src/nsterm.h (NSSavePanel): Update comment. (NSAPP_DATA2_RUNFILEDIALOG): Define. (ns_run_file_dialog): Declare. * src/nsterm.m (sendEvent:): Handle NSAPP_DATA2_RUNFILEDIALOG.
* Fix minor problems found by static checking.Paul Eggert2013-06-031-4/+4
| | | | | | | | | | | | | | | | | | | | | * data.c (pure_write_error): Use xsignal2, not Fsignal, as Fsignal might return. * eval.c (set_backtrace_debug_on_exit): Now static. (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace): No longer inline. EXTERN_INLINE is needed only for functions defined in .h files. Reindent function header as per GNU style. (backtrace_p, backtrace_top, backtrace_next): Mark EXTERNALLY_VISIBLE so they don't get optimized away by the compiler or linker. Add extern decls to pacify gcc -Wall. * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Now static. * frame.c (free_monitors): Define only on platforms that need it. * nsterm.m (ns_term_init): * process.c (catch_child_signal): Don't worry about whether SIGCHLD is defined, as SIGCHLD is defined on all porting targets these days. * process.c, process.h (catch_child_signal): Make it extern only if NS_IMPL_GNUSTEP is defined.
* Update the GNUStep port so it works OK. Redraw and sizing bugs remain.Jan Djärv2013-06-021-99/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nextstep/templates/Info-gnustep.plist.in: Add NSDocumentClass EmacsDocument. * src/nsfns.m (x_set_foreground_color, x_set_background_color): Use EmacsCGFloat. (ns_implicitly_set_icon_type, Fx_create_frame): Make static, remove unused variables. (Fns_read_file_name): Keep track if panel is for save. Use ns_filename_from_panel/ns_directory_from_panel. (Fns_list_services): delegate only used for COCOA. (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep. Just return the input if GNUStep. (x_screen_planes): Remove. (Fxw_color_values): Use EmacsCGFloat (Fns_display_monitor_attributes_list): Only get screen number for Cocoa. (getDirectory, getFilename): Removed from EmacsOpenPanel and EmacsSavePanel. (EmacsOpenPanel:ok:): Use ns_filename_from_panel and ns_directory_from_panel. * src/nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor) (ns_charset_covers, ns_get_covering_families, nsfont_open): Use F suffix on floats. (ns_char_width): Returns CGFloat. (ns_ascii_average_width): w is CGFloat instead of float. (nsfont_draw): cbuf and c are unsigned. Cast to char* in call to DPSxshow. (ns_glyph_metrics): CGFloat instead of float. * src/nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat. * src/nsmenu.m (ns_update_menubar): Make static. (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA (fillWithWidgetValue:): Add cast to SEL for setAction. (addSubmenuWithTitle:forFrame:): Add cast to SEL for action. (update_frame_tool_bar): Update code for GNUStep. (clearAll): New method. (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP. Move identifierToItem setObject and activeIdentifiers addObject before call to insertItemWithItemIdentifier. (validateVisibleItems): Fix indentation. (toolbarAllowedItemIdentifiers:): Return activeIdentifiers. (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and UtilityWindow to aStyle, remove call to setStyleMask. * src/nsselect.m (ns_get_local_selection): Remove unused variable type. * src/nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size of CGFloat differs. (EmacsApp): New variable nextappdefined. Declare sendFromMainThread when NS_IMPL_GNUSTEP. (EmacsDocument): Declare when NS_IMPL_GNUSTEP. (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove. (EmacsToolbar): Add clearAll. Add tag argument to addDisplayItemWithImage. (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory. * src/nsterm.m: Include src/process.h if NS_IMPL_GNUSTEP. (ns_menu_bar_is_hidden, menu_will_open_state): Define only if NS_IMPL_COCOA. (x_set_cursor_type): Remove declaration. (ns_update_begin): Only use r and bp if NS_IMPL_COCOA. (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code. (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP. (ns_get_color): Use F suffix on float. (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat. (ns_get_rgb_color): Remove. (x_set_frame_alpha): Move view inside NS_IMPL_COCOA. (note_mouse_movement): x and y are CGFloat. (ns_draw_fringe_bitmap): Remove unused rowY. Change #if to COCOA && >= 10_6. (ns_draw_window_cursor): Remove unused overspill. (ns_draw_underwave): width and x are EamcsCGFloat. (ns_draw_box): thickness is CGFloat. (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6. (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread if not in main thread. (ns_get_pending_menu_title, ns_check_menu_open) (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5. (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD. (sendFromMainThread:): New method. (changeFont:): size is CGFloat. (keyDown:): Check for Delete when NS_IMPL_GNUSTEP. Disable warning about permanent text. (characterIndexForPoint:): Adjust return type depending on GNUStep version. (mouseDown:): delta is CGFloat. (updateFrameSize): Remove unised variable f. (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA. Cast float to EmacsCGFloat. (windowWillUseStandardFrame:defaultFrame:): Set maximized_height also to -1 when restoring. (windowDidExitFullScreen:): Put call to updateCollectionBehaviour inside NS_IMPL_COCOA. (toggleFullScreen:): Put call to toggleFullScreen inside NS_IMPL_COCOA. Cast float to EmacsCGFloat. (setPosition:portion:whole:): por is CGFloat. (getMouseMotionPart:window:x:y:): Add F suffix to float. (mouseDown:): Use CGFloat. (mouseDragged:): Remove unised variable edge. (EmacsDocument): Implement for NS_IMPL_GNUSTEP. * src/process.c (catch_child_signal): New function. (init_process_emacs): Call it. * src/process.h (catch_child_signal): Declare.
* Sync x-server-* and x-display-* functions on NS with those on X11.YAMAMOTO Mitsuharu2013-05-201-4/+20
|
* * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checkingJan Djärv2013-04-071-1/+1
| | | | f->output_data.ns.
* Get rid of some platform-specific functions examining windowDmitry Antipov2013-04-071-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | system and its capabilities. This is a partial rework of the 2013-04-05 change. * lisp.h (have_menus_p): Remove prototype. This function is replaced with platform-independent window_system_available. (check_window_system): Move to... * frame.h (decode_window_system_frame, window_system_available): ...here, add new prototypes. * frame.c (window_system_available, decode_window_system_frame): New functions. (check_window_system): Platform-independent now. * xterm.h (x_in_use): Remove declaration. (check_x_frame): * w32term.h (check_x_frame): * nsterm.h (check_x_frame): Remove prototypes. This function is replaced with platform-independent decode_window_system_frame. * msdos.c (have_menus_p): Remove. * nsfns.m (check_window_system, have_menus_p, check_ns_frame): Remove platform-specific functions. Use check_window_system, decode_window_system_frame and check_ns_display_info where appropriate. Minor style and comment tweaks. * w32fns.c (w32_in_use, check_window_system, have_menus_p) (check_x_frame): Likewise. * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame): Likewise. * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m: * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c: * xmenu.c, xselect.c: All related users changed.
* Consistently use platform-specific function to detect window system.Dmitry Antipov2013-04-051-6/+6
| | | | | | | | | | | | | | | | | | * lisp.h (check_window_system): New prototype. This function is going to replace check_x, check_w32 and check_ns. (have_menus_p): Mention msdos.c in comment. * fontset.c (check_window_system_func): Remove. Adjust all users. * fontset.h (check_window_system_func): Remove prototype. * nsterm.h (check_ns): * xterm.h (check_x): * w32term.h (check_w32): Likewise. * menu.c (Fx_popup_menu): Use check_window_system. * msdos.c (check_window_system): Define for MS-DOS. * nsfns.m (check_window_system): Define for NS. Adjust all users. * w32fns.c (check_window_system): Likewise for MS-Windows. * xfns.c (check_window_system): Likewise for X. * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c: * xfaces.c, xmenu.c: Use check_window_system where appropriate.
* * nsmenu.m (ns_update_menubar): Correct NSTRACE.Jan Djärv2013-03-301-0/+90
| | | | | | | | | | | | | | | | (x_activate_menubar): Update the menu with title that matches ns_get_pending_menu_title, and call ns_check_pending_openmenu. (menuWillOpen:): New method. (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698). * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open) (ns_check_pending_open_menu): Declare. * nsterm.m (menu_will_open_state, menu_mouse_point) (menu_pending_title): New varaibles. (ns_get_pending_menu_title, ns_check_menu_open) (ns_check_pending_open_menu): New functions.
* * window.h (struct window): Replace hchild, vchild and buffer slotsDmitry Antipov2013-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the only contents slot. This is possible because each valid window may have either the child window (in vertical or horizontal combination) or buffer to display (for the leaf window). Using that, a lof of operations to traverse and/or change window hierarchies may be simplified. New member horizontal is used to distinguish between horizontal and vertical combinations of internal windows. (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P) (WINDOW_VERTICAL_COMBINATION_P): New macros. (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes. * window.c (wset_hchild, wset_vchild): Remove. Adjust all users. Use contents slot, not buffer, where appropriate. (wset_combination): New function. (wset_buffer): Add eassert. (Fframe_first_window): Simplify the loop reaching first window. (Fwindow_buffer): Use WINDOW_LEAF_P. (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P. (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P. (unshow_buffer): Convert initial debugging check to eassert. (replace_window, recombine_windows, Fdelete_other_windows_internal) (make_parent_window, window_resize_check, window_resize_apply) (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal) (Fset_window_configuration, delete_all_child_windows, save_window_save): Adjust to match struct window changes. (window_loop): Check for broken markers in CHECK_ALL_WINDOWS. (mark_window_cursors_off, count_windows, get_leaf_windows) (foreach_window_1): Simplify the loop. * alloc.c (mark_object): Do not check for the leaf window because internal windows has no glyph matrices anyway. * dispnew.c (clear_window_matrices, showing_window_margins_p) (allocate_matrices_for_window_redisplay, fake_current_matrices) (allocate_matrices_for_frame_redisplay, free_window_matrices) (build_frame_matrix_from_window_tree, mirror_make_current) (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers) (update_window_tree, set_window_update_flags): Simplify the loop. (sync_window_with_frame_matrix_rows): Enforce live window. Use contents slot, not buffer, where appropriate. * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P and WINDOW_HORIZONTAL_COMBINATION_P. (make_frame_visible_1): Simplify the loop. Use contents slot, not buffer, where appropriate. * xdisp.c (hscroll_window_tree, mark_window_display_accurate) (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree) (expose_window_tree): Likewise. Use contents slot, not buffer, where appropriate. * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW to avoid deleted windows. Use contents slot instead of buffer. * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c: * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c: * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c: * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
* * nsterm.m (ns_select): Don't return with result uninitialized.Jan Djärv2013-03-161-0/+5
|
* * nsterm.m (updateFrameSize:): Change resize increments if needed.Jan Djärv2013-03-161-0/+14
|
* * lisp/cus-start.el (all): Add ns-use-native-fullscreen.Jan Djärv2013-02-051-73/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/nsmenu.m (update_frame_tool_bar): Check for negative tool bar height. * src/nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7. (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and updateCollectionBehaviour. * src/nsterm.m (NEW_STYLE_FS): Remove. (ns_last_use_native_fullscreen): New variable. (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen. (x_set_window_size): Do not take title bar and tool bar into account if isFullscreen returns YES. (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen. (check_native_fs): New function. (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS. (ns_term_init): Remove NEW_STYLE_FS. (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar and tool bar if isFullscreen returns NO. (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative. (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS with HAVE_NATIVE_FS. (window:willUseFullScreenPresentationOptions:): New method. (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative. Hide toolbar if not enabled. (windowDidExitFullScreen:): Call updateCollectionBehaviour. Restore tool bar if enabled, hide it otherwise (Bug#13444). (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods. (toggleFullScreen:): If fs_is_native, call toggleFullScreen on window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0. Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs. (syms_of_nsterm): Add ns-use-native-fullscreen.
* Drop async_visible and async_iconified fields of struct frame.Dmitry Antipov2013-01-241-14/+16
| | | | | | | | | | | | | | | | | | | | This is possible because async input is gone; for details, see http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html. * frame.h (struct frame): Remove async_visible and async_iconified members, convert garbaged to unsigned bitfield. Adjust comments. (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users. (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros. * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c: Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED, FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate. * w32term.c: Ditto. (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT properly. Likewise for obscured. * xterm.c: Ditto. (handle_one_xevent): Save visible state go generate ICONIFY_EVENT properly. * nsterm.m: Ditto. (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
* * lisp.h (toplevel): Add comment about using Lisp_Save_ValueDmitry Antipov2013-01-171-1/+1
| | | | | | | | | | | | | | | objects, related functions and macros. (make_save_value): Adjust prototype. (make_save_pointer): New prototype. (SAFE_NALLOCA): Fix indentation. Use make_save_pointer. (SAFE_ALLOCA_LISP): Adjust make_save_value usage. * alloc.c (format_save_value): Rename to make_save_value. (make_save_pointer): New function. (record_xmalloc): Use make_save_pointer. * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c: * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c: Change users of make_save_value to make_save_pointer. Likewise for format_save_value and make_save_value.
* * nsterm.m (keyDown:): Set processingCompose to NO if an emacs keyJan Djärv2013-01-131-0/+2
| | | | | event is generated. (doCommandBySelector:): Set processingCompose to NO.
* Merge from emacs-24; up to 2012-12-06T20:16:[email protected]Glenn Morris2013-01-041-6/+7
|\
| * Don't use previous underline thickness or position if previous underline ↵YAMAMOTO Mitsuharu2013-01-041-0/+1
| | | | | | | | type is underwave.
| * Make underwave look more triangular and also degrade gracefully for small ↵YAMAMOTO Mitsuharu2013-01-041-6/+6
| | | | | | | | fonts. (Bug#13000)
* | Merge from emacs-24; up to 2012-12-06T01:39:[email protected]Paul Eggert2013-01-021-2/+2
|\|
| * Update copyright notices for 2013.Paul Eggert2013-01-011-2/+2
| |
* | Merge from emacs-24; up to 2012-11-26T19:56:[email protected]Glenn Morris2012-12-091-1/+1
|\|
| * * nsterm.m (fd_handler:): FD_ZERO fds.Jan Djärv2012-12-081-1/+1
| | | | | | | | Fixes: debbugs:13103
* | * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_stateDmitry Antipov2012-12-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | member. Adjust users. Convert mouse_face_past_end, mouse_face_defer and mouse_face_hidden members to a bitfields. * frame.h (struct frame): Remove set-but-not-used space_width member. (FRAME_SPACE_WIDTH): Remove. * nsterm.m, w32term.c, xterm.c: Adjust users. * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so member. Adjust users. Convert term_initted, delete_in_insert_mode, costs_set, insert_mode, standout_mode, cursor_hidden and flow_control members to a bitfields.
* | * alloc.c (Fgarbage_collect): Unblock input after clearingDmitry Antipov2012-11-221-15/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | gc_in_progress to avoid note_mouse_highlight glitch with GC. * frame.h (FRAME_MOUSE_UPDATE): New macro. * msdos.c (IT_frame_up_to_date): Use it here... * w32term.c (w32_frame_up_to_date): ...here... * xterm.c (XTframe_up_to_date): ...and here... * nsterm.m (ns_frame_up_to_date): ...but not here. * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member. Adjust users. * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight): Do not check whether GC is in progress.
* | * nsterm.m (ns_select): Send SIGIO only to self, not to process group.Paul Eggert2012-11-171-2/+2
| |
* | Merge from emacs-24; up to 2012-11-15T23:31:[email protected]Glenn Morris2012-11-171-0/+9
|\|
| * * nsterm.m (hold_event): Set send_appdefined to YES.Jan Djärv2012-11-171-0/+9
| | | | | | | | (ns_select): Return at once if events are held (Bug#12834).
* | Assume POSIX 1003.1-1988 or later for fcntl.h.Paul Eggert2012-11-171-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/CPP-DEFINES (O_RDONLY, O_RDWR, HAVE_FCNTL_H): Remove. * admin/merge-gnulib (GNULIB_MODULES): Add fcntl-h. * configure.ac: Do not check for fcntl.h. * lib/gnulib.mk: Regenerate. * lib-src/movemail.c, lib-src/update-game-score.c: Assume <fcntl.h> exists. * nt/inc/sys/socket.h (O_NONBLOCK): Rename from O_NDELAY, since the POSIX name for this flag is O_NONBLOCK. All uses changed. * nt/inc/unistd.h (O_RDWR, O_NOCTTY): New macros. Like AT_FDCWD etc. these really should be moved to a replacement <fcntl.h> if and when that gets implemented. In the meantime, include <fcntl.h> to make sure we don't override its definitions. * src/callproc.c (relocate_fd): Assume F_DUPFD. * src/emacs.c, src/term.c (O_RDWR): Remove. * src/keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than O_NDELAY, since O_NONBLOCK is the standard name for this flag. * src/nsterm.m: Assume <fcntl.h> exists. * src/process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process) (create_pty, Fmake_network_process, server_accept_connection) (wait_reading_process_output, init_process_emacs): Assume O_NONBLOCK. (wait_reading_process_output): Put in a special case for WINDOWSNT to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK. It's not clear this is needed, but it's a more-conservative change. (create_process): Assume FD_CLOEXEC. (create_process, create_pty): Assume O_NOCTTY. * src/sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL. (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY. Omit if not DOS_NT, since F_GETFL is not defined there. (serial_open): Assume O_NONBLOCK and O_NOCTTY. * src/term.c: Include <fcntl.h>, for flags like O_NOCTTY. (O_NOCTTY): Remove. (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that lack it, since gnulib guarantees this. * src/w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY. Fixes: debbugs:12881
* | Fix problems in ns port found by static checking.Paul Eggert2012-11-171-12/+10
| | | | | | | | | | | | | | | | | | * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc. (hold_event, setPosition:portion:whole:): Send SIGIO only to self, not to process group. (ns_select): Use emacs_write, not write, as that's more robust in the presence of signals. (fd_handler:): Check for read errors.
* | Merge from emacs-24; up to 2012-11-13T18:57:[email protected]Glenn Morris2012-11-161-0/+2
|\|
| * * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket isJan Djärv2012-11-131-0/+2
| | | | | | | | | | | | called. Fixes: debbugs:12834
* | Use faccessat, not access, when checking file permissions.Paul Eggert2012-11-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug that has been present in Emacs since its creation. It was reported by Chris Torek in 1983 even before GNU Emacs existed, which must set some sort of record. (Torek's bug report was against a predecessor of GNU Emacs, but GNU Emacs happened to have the same common flaw.) See Torek's Usenet posting "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858 Posted: Fri Apr 8 14:18:56 1983. * .bzrignore: Add lib/fcntl.h. * configure.ac (euidaccess): Remove check; gnulib does this for us now. (gl_FCNTL_O_FLAGS): Define a dummy version. * lib/at-func.c, lib/euidaccess.c, lib/faccessat.c, lib/fcntl.in.h: * lib/getgroups.c, lib/group-member.c, lib/root-uid.h: * lib/xalloc-oversized.h, m4/euidaccess.m4, m4/faccessat.m4: * m4/fcntl_h.m4, m4/getgroups.m4, m4/group-member.m4: New files, from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * admin/merge-gnulib (GNULIB_MODULES): Add faccessat. (GNULIB_TOOL_FLAGS): Avoid at-internal, fchdir, malloc-posix, openat-die, openat-h, save-cwd. Do not avoid fcntl-h. Omit gnulib's m4/fcntl-o.m4. * nt/inc/ms-w32.h (AT_FDCWD, AT_EACCESS): New symbols. (access): Remove. (faccessat): New macro. * src/Makefile.in (LIB_EACCESS): New macro. (LIBES): Use it. * src/callproc.c (init_callproc): * src/charset.c (init_charset): * src/fileio.c (check_existing, check_executable, check_writable) (Ffile_readable_p): * src/lread.c (openp, load_path_check): * src/process.c (allocate_pty): * src/xrdb.c (file_p): Use effective UID when checking permissions, not real UID. * src/callproc.c (init_callproc): * src/charset.c (init_charset): * src/lread.c (load_path_check, init_lread): Test whether directories are accessible, not merely whether they exist. * src/conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro. * src/fileio.c (check_existing, check_executable, check_writable) (Ffile_readable_p): Use symbolic names instead of integers for the flags, as they're portable now. (check_writable): New arg AMODE. All uses changed. Set errno on failure. (Ffile_readable_p): Use faccessat, not stat + open + close. (Ffile_writable_p): No need to call check_existing + check_writable. Just call check_writable and then look at errno. This saves a syscall. dir should never be nil; replace an unnecessary runtime check with an eassert. When checking the parent directory of a nonexistent file, check that the directory is searchable as well as writable, as we can't create files in unsearchable directories. (file_directory_p): New function, which uses 'stat' on most platforms but faccessat with D_OK (for efficiency) if WINDOWSNT. (Ffile_directory_p, Fset_file_times): Use it. (file_accessible_directory_p): New function, which uses a single syscall for efficiency. (Ffile_accessible_directory_p): Use it. * src/xrdb.c (file_p): Use file_directory_p. * src/lisp.h (file_directory_p, file_accessible_directory_p): New decls. * src/lread.c (openp): When opening a file, use fstat rather than stat, as that avoids a permissions race. When not opening a file, use file_directory_p rather than stat. (dir_warning): First arg is now a usage string, not a format. Use errno. All uses changed. * src/nsterm.m (ns_term_init): Remove unnecessary call to file-readable that merely introduced a race. * src/process.c, src/sysdep.c, src/term.c: All uses of '#ifdef O_NONBLOCK' changed to '#if O_NONBLOCK', to accommodate gnulib O_* style, and similarly for the other O_* flags. * src/w32.c (sys_faccessat): Rename from sys_access and switch to faccessat's API. All uses changed. * src/xrdb.c: Do not include <sys/stat.h>; no longer needed. (magic_db): Rename from magic_file_p. (magic_db, search_magic_path): Return an XrmDatabase rather than a char *, so that we don't have to test for file existence separately from opening the file for reading. This removes a race fixes a permission-checking problem, and simplifies the code. All uses changed. (file_p): Remove; no longer needed. Fixes: debbugs:12632
* | * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMaskJan Djärv2012-11-061-17/+17
| | | | | | | | | | | | to keypad keys. Fixes: debbugs:12816
* | * nsterm.m: Add NSClearLineFunctionKey and keypad keys.Michael Marchionna2012-11-041-3/+23
|/ | | | | | (keyDown): Remap keypad keys to X11 virtual key codes. Fixes: debbugs:8680
* * nsterm.m (NO_APPDEFINED_DATA): New define.Jan Djärv2012-10-281-12/+7
| | | | | | | | | | | (last_appdefined_event_data): New variable (last_appdefined_event): Remove. (ns_select): Initialize t from last_appdefined_event_data instead of [last_appdefined_event data1]. (sendEvent:): Save [theEvent data1] to last_appdefined_event_data, remove last_appdefined_event. Fixes: debbugs:12698
* * nsterm.m (ns_select): Check writefds before call toJan Djärv2012-10-181-3/+3
| | | | | | FD_ISSET. Fixes: debbugs:12668
* * nsterm.m (ns_select): Count fd:s in writefs also.Jan Djärv2012-10-141-1/+4
| | | | Fixes: debbugs:12422
* * nsterm.m (hold_event_q): New static variable.Jan Djärv2012-10-121-2/+37
| | | | | | | | | | (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if ! q_event_ptr. (hold_event): New function. (ns_read_socket): If hold_event_q have events, store them and return. (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr is zero (Bug#12384).
* Clean out old termopts cruft.Paul Eggert2012-10-101-4/+3
| | | | | | * termopts.h (flow_control, meta_key): Remove unused decls. * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c: Don't include termopts.h.
* * nsterm.m (ns_dumpglyphs_image): Only draw slize of image (Bug#12506).Jan Djärv2012-10-071-1/+3
|
* Check for OSX >= 10.4 to match what the maunal says and what we actually ↵Jan Djärv2012-10-071-4/+1
| | | | | | | | | | | | | | | | | | | | | | support. * configure.ac: Check that OSX is 10.4 or newer. * etc/NEWS (NextStep/OSX port changes): OSX 10.4 or newer is required. * src/nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4. (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4. * src/nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger. * src/nsmenu.m (fillWithWidgetValue:): Remove code for < MAC_OS_X_VERSION_10_2. * src/nsselect.m (ns_string_from_pasteboard): Remove check for >= MAC_OS_X_VERSION_10_4. * src/nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove. (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4. (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
* * nsfns.m (ns_in_resize): Remove.Jan Djärv2012-10-071-134/+2
| | | | | | | | | | | | | (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove ns_in_resize check. * nsterm.m (ns_in_resize): Remove. (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove. (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove ns_in_resize check. (ns_clear_frame_area): Remove resize handle code. Fixes: debbugs:12479