aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Change pixel formatscratch/ns/performanceAlan Third2020-12-311-2/+3
| | | | | | * src/nsterm.m ([EmacsSurface getContext]): Use BGRA for the IOSurface and specify the CGContext explicitly for compatibility with a wider range of Macs.
* Fix EmacsSurface definitionsAlan Third2020-12-312-3/+5
| | | | | | * src/nsterm.h: * src/nsterm.m ([EmacsSurface initWithSize:ColorSpace:]): Objective C init methods should init the superclass, and return id.
* Fix GNUstep warningsAlan Third2020-12-313-7/+3
| | | | | | | | * src/nsterm.h: EmacsSurface is only required if NS_DRAW_TO_BUFFER is defined. * src/nsterm.m (ns_judge_scroll_bars): Remove unused variable. * src/nsmenu.m (update_frame_tool_bar): (ns_update_menubar): Remove unused variables.
* Fix problems with reusing IOSurfacesAlan Third2020-12-312-100/+266
| | | | | | | | | | | | | | | | | | | | | | | * src/nsterm.h: New EmacsSurface class and update EmacsView definitions. * src/nsterm.m ([EmacsView dealloc]): ([EmacsView viewDidResize:]): Handle new EmacsSurface class. ([EmacsView initFrameFromEmacs:]): Remove reference to old method. ([EmacsView createDrawingBuffer]): Remove method. ([EmacsView focusOnDrawingBuffer]): ([EmacsView unfocusDrawingBuffer]): ([EmacsView windowDidChangeBackingProperties:]): Use new EmacsSurface class. ([EmacsView copyRect:to:]): Get information from the context instead of direct from the IOSurface. ([EmacsView updateLayer]): Use new EmacsSurface class. ([EmacsSurface initWithSize:ColorSpace:]): ([EmacsSurface dealloc]): ([EmacsSurface getSize]): ([EmacsSurface getContext]): ([EmacsSurface releaseContext]): ([EmacsSurface getSurface]): ([EmacsSurface copyContentsTo:]): New class and methods.
* Improve performance of scrolling on NSAlan Third2020-12-311-25/+19
| | | | | * src/nsterm.m ([EmacsView copyRect:to:]): Use memcpy to copy bits around instead of using NS image functions.
* Improve drawing performance on macOSAlan Third2020-12-312-12/+69
| | | | | | | | | | | | | | * configure.ac: Require IOSurface framework. * src/nsterm.h: Add new definitions. * src/nsterm.m (ns_update_end): (ns_unfocus): Use new unfocusDrawingBuffer method. (ns_draw_window_cursor): Move ns_focus to before we set colors. ([EmacsView dealloc]): Release the new IOSurface. ([EmacsView createDrawingBuffer]): Use a new IOSurface to draw to and point a CGBitmapContext to it. ([EmacsView focusOnDrawingBuffer]): Lock the IOSurface for drawing. ([EmacsView unfocusDrawingBuffer]): New function. ([EmacsView updateLayer]): Use the IOSurface.
* Minor cleanup in doc.cStefan Kangas2020-12-311-24/+14
| | | | | | * src/doc.c (get_doc_string, Fdocumentation) (Fdocumentation_property, store_function_docstring): Minor cleanup.
* Minor improvements to FD_SETSIZE overflow checks.Philipp Stephani2020-12-311-1/+2
| | | | | * src/process.c (Fmake_serial_process): Add port to error data. (connect_network_socket): Add an explanatory comment.
* Manually limit file descriptors that we select on to FD_SETSIZE.Philipp Stephani2020-12-311-0/+25
| | | | | | | | | | | | | | | | | | This works even if another thread or process resets the resource limit for open file descriptors, e.g., using 'prlimit' on GNU/Linux. * src/process.c (create_process, create_pty, Fmake_pipe_process) (Fmake_serial_process, connect_network_socket) (server_accept_connection): Limit file descriptors to FD_SETSIZE. * test/src/process-tests.el (process-tests--with-raised-rlimit): New helper macro. (process-tests--fd-setsize-test): Rename from 'process-tests--with-many-pipes'. Increase resource limit during test if possible. (process-tests/fd-setsize-no-crash/make-process) (process-tests/fd-setsize-no-crash/make-pipe-process) (process-tests/fd-setsize-no-crash/make-network-process) (process-tests--new-pty): Rename callers.
* Consistently check for FD_SETSIZE overflow.Philipp Stephani2020-12-301-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | Previously this was only checked in a few places. Now assert that file descriptors are within the expected range whenever we'd otherwise introduce undefined behavior. * src/process.c (add_read_fd, add_process_read_fd, delete_read_fd) (recompute_max_desc, delete_write_fd, compute_input_wait_mask) (compute_non_process_wait_mask, compute_non_keyboard_wait_mask) (compute_write_mask, clear_waiting_thread_info) (update_processes_for_thread_death, Fset_process_thread) (create_process, create_pty, Fmake_pipe_process) (Fprocess_datagram_address, Fset_process_datagram_address) (Fmake_serial_process, finish_after_tls_connection) (connect_network_socket, deactivate_process) (server_accept_connection, wait_reading_process_output) (read_process_output, read_and_dispose_of_process_output) (send_process, Fcontinue_process, Fprocess_send_eof) (Fprocess_filter_multibyte_p, keyboard_bit_set) (add_timer_wait_descriptor, setup_process_coding_systems): Add assertions to document and check that file descriptors are within the expected range when used as file descriptor set elements or array subscripts.
* * src/nsterm.m (ns_select): Fix off-by-one error, and add assertionPhilipp Stephani2020-12-301-1/+2
|
* Fix Help menu on macOSAlan Third2020-12-301-0/+3
| | | | | * src/nsmenu.m (ns_update_menubar): Make sure to reset the help menu when we move it to another submenu.
* Use standard key symbols in NS menu entriesMattias Engdegård2020-12-301-10/+60
| | | | | | * src/nsmenu.m (skipspc): Remove. (key_symbols, prettify_key): New. ([EmacsMenu fillWithWidgetValue:]): Call prettify_key.
* ; * src/nsmenu.m: Undo unintentional changeMattias Engdegård2020-12-301-2/+2
|
* Plug NS memory leaks (bug#45502)Mattias Engdegård2020-12-301-6/+7
| | | | | * src/nsmenu.m ([EmacsMenu addItemWithWidgetValue:attributes:]): Mark allocated and owned objects for autorelease.
* * src/dbusbind.c (XD_BASIC_DBUS_TYPE): Fix error in declaration.Michael Albinus2020-12-301-15/+28
|
* Minor cleanup in keymap.cStefan Kangas2020-12-301-136/+72
| | | | | | | | | | * src/keymap.c (get_keymap, keymap_parent, Fset_keymap_parent) (store_in_keymap, Fdefine_key, Flookup_key, define_as_prefix) (silly_event_symbol_error, current_minor_maps) (Fcurrent_active_maps, Fkey_binding, Flocal_key_binding) (Fminor_mode_key_binding, Fdefine_prefix_command) (Faccessible_keymaps, Fdescribe_buffer_bindings) (describe_vector, Fwhere_is_internal): Minor cleanup.
* Improve the `long' computation of `mode-line-compact'Lars Ingebrigtsen2020-12-301-2/+1
| | | | | | * src/xdisp.c (display_mode_line): Compute `long' based on total window width, and use the passed-in window instead of the selected window.
* Don't calculate macOS menu data for GNUstep (bug#45502)Alan Third2020-12-291-5/+13
| | | | | * src/nsmenu.m ([EmacsMenu fillWithWidgetValue:]): #ifdef out code that has no effect on GNUstep and autorelease alloc'd objects.
* * src/Makefile.in (DO_CODESIGN): Fix architecture for Apple SiliconArtem Loenko2020-12-291-1/+1
|
* A better fix for process-tests on MS-WindowsEli Zaretskii2020-12-291-0/+5
| | | | | | | | | * src/w32.c (pipe2): When forcibly closing pipe handles due to overflow of FD_SETSIZE, set the handles to -1, to avoid assertion violations in emacs_close. * test/src/process-tests.el (process-tests/fd-setsize-no-crash): No need to skip this test anymore.
* More readable keys in NS menu entries (bug#45502)Mattias Engdegård2020-12-292-49/+61
| | | | | | | | | | | | | Each menu entry now has the key binding in a right-aligned column, as an attempt to improve readability. Previously the keys were given in brackets immediately following the menu string. * src/nsmenu.m ([EmacsMenu parseKeyEquiv:]): Remove. (skipspc): New helper function. ([EmacsMenu addItemWithWidgetValue:]): Add attributes argument. Use attributed title string. Don't special-case Super bindings. ([EmacsMenu fillWithWidgetValue:]): Compute maximum width. Prepare attributes for title.
* Fix crash in NS menu codeAlan Third2020-12-291-0/+9
| | | | | | * src/nsmenu.m (ns_update_menubar): When the menu generation code was copied from xmenu.c the fix for waiting_for_input was lost. Reinstate it.
* * src/xdisp.c (display_mode_line): I guess FALSE should be false.Glenn Morris2020-12-281-1/+1
|
* Revert the previous display_string changeLars Ingebrigtsen2020-12-291-24/+20
| | | | | | * src/xdisp.c (display_string): Revert adding the additional ignore_text_properties parameter -- it was already covered by the other mix of parameters.
* Fix compact mode line text propertiesLars Ingebrigtsen2020-12-291-14/+27
| | | | | * src/xdisp.c (display_mode_line): Display the compact mode correctly (with text properties) (bug#45520).
* Add a parameter to display_string to allow not ignoring text propsLars Ingebrigtsen2020-12-291-19/+26
| | | | | | * src/xdisp.c (display_string): Add a parameter to allow not ignoring text properties (bug#45520). Adjust callers throughout xdisp.c.
* Introduce new variable mode-line-compactLars Ingebrigtsen2020-12-291-3/+46
| | | | | | | * doc/lispref/modes.texi (Mode Line Basics): Document it (bug#34476). * src/xdisp.c (display_mode_line): Use it. (syms_of_xdisp): New variable mode-line-compact.
* Fix crash in NS menu codeAlan Third2020-12-281-55/+46
| | | | | | | * src/nsmenu.m (ns_update_menubar): Don't assume that the top level menus are correct when populating the submenus. (free_frame_menubar): Clear the menu. ([EmacsMenu removeAllItems]): Actually remove all menu items.
* Make XIM to work with non-CJK localesYichao Yu2020-12-282-33/+5
| | | | | | | | * src/xfns.c (best_xim_style): Don't rely on supported_xim_styles (bug#10867). * src/xterm.c (x_draw_window_cursor): Adjust to modern input styles. (xim_instantiate_callback): Ditto.
* Remove NS menu synthesized events (bug#44333)Alan Third2020-12-273-415/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the frame tracking stuff as it's not used for anything, and move the update tracking into the EmacsMenu class. * src/nsmenu.m (ns_update_menubar): Copy the parsing code from xmenu.c and rework the NS specific code around to update the existing menus instead of rebuilding them completely. (ns_activate_menubar): ([EmacsMenu trackingNotification:]): ([EmacsMenu menuWillOpen:]): ([EmacsMenu menuDidClose:]): Remove unused functions. ([EmacsMenu menuNeedsUpdate:]): Remove menu tracking code and add code to check whether an update is required. ([EmacsMenu fillWithWidgetValue:]): ([EmacsMenu addSubmenuWithTitle:]): ([EmacsMenu initWithTitle:]): Remove references to frame. ([EmacsMenu setFrame:]): Remove method. ([EmacsMenu clear]): Rename to removeAllItems. ([EmacsMenu removeAllItems]): Use built-in removeAllItems, if available. (syms_of_nsmenu): Remove tracking code. * src/nsterm.m (ns_check_menu_open): (ns_check_pending_open_menu): (ns_create_terminal): Remove unused functions. (ns_term_init): Get rid of menu tracking. * src/nsterm.h (EmacsMenu): Remove frame, add needsUpdate and update method definitions.
* ; Fix recent shortdoc.el and fns.c additionsBasil L. Contovounesios2020-12-271-1/+1
| | | | | * lisp/emacs-lisp/shortdoc.el (list): Fix typos. * src/fns.c (Flength_equal): Fix docstring.
* ; Fix the recent `length' doc string additionŠtěpán Němec2020-12-271-1/+1
|
* Fix up length_internal with degenerate length inputsLars Ingebrigtsen2020-12-271-2/+5
| | | | * src/fns.c (length_internal): Protect against edge conditions.
* Add new predicates for sequence lengthsLars Ingebrigtsen2020-12-271-1/+75
| | | | | | | | | | | | | * doc/lispref/sequences.texi (Sequence Functions): Document them. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Mark them as side-effect-free. * lisp/emacs-lisp/shortdoc.el (list): Mention them. * src/fns.c (Flength): Mention them in the doc string. (length_internal): New function. (Flength_less, Flength_greater, Flength_equal): New defuns. (syms_of_fns): Sym them.
* Fix test/src/process-tests on MS-WindowsEli Zaretskii2020-12-261-0/+6
| | | | | * src/process.c (network_lookup_address_info_1) [WINDOWSNT]: Initialize winsock.
* Improvements for `:base-uri' svg image propertyZajcev Evgeny2020-12-261-3/+5
| | | | | | | * src/image.c (svg_load): Use ENCODE_FILE for `:base-uri' * doc/lispref/display.texi (SVG Images): Add more documentation for `:base-uri'
* Merge from origin/emacs-27Glenn Morris2020-12-251-1/+1
|\ | | | | | | | | | | b242bbb073 (origin/emacs-27) ; lisp/org/org.el: Fix Version header. e0fc939c5f Add more details to the "word processor" section fda9b3e83a * src/Makefile.in (DO_CODESIGN): Fix expected architecture...
| * * src/Makefile.in (DO_CODESIGN): Fix expected architecture name.Philipp Stephani2020-12-231-1/+1
| |
| * Codesign the executable on recene MacOS systemsItai Seggev2020-12-231-0/+7
| | | | | | | | | | | | | | | | * src/Makefile.in (temacs$(EXEEXT)): Codesign the executable on recent (ARM) MacOS systems (bug#43878). Without this, building Emacs fails. Copyright-paperwork-exempt: yes
| * Fix error with fn key in NS port (bug#44533)Alan Third2020-12-141-11/+8
| | | | | | | | | | | | | | * src/nsterm.m ([EmacsView keyDown:]): Move the correction for fn key handling to before the modifiers are calculated. (cherry picked from commit 7970610d48701a949ce443c94c71eac47d044197)
| * Fix crash in ns_mouse_position (bug#44313)Alan Third2020-12-121-1/+3
| | | | | | | | | | | | | | | | * src/nsterm.m (ns_destroy_window): Close the window before freeing the frame resources so we don't end up accessing the frame struct after it's been freed. (cherry picked from commit 18a7267c32a909bb26bd93d24543155aeb10e042)
* | Revert "Use posix_spawn if possible."Eli Zaretskii2020-12-252-150/+2
| | | | | | | | | | | | This reverts commit 2c79a8f9210db01c86b0e5f236adeb0509519d30. It breaks the MinGW build in too many ways, and should be first tested on a branch.
* | Use posix_spawn if possible.Philipp Stephani2020-12-252-2/+150
| | | | | | | | | | | | | | | | | | | | | | | | posix_spawn is less error-prone than vfork + execve, and can make better use of system-specific enhancements like 'clone' on Linux. Use it if we don't need to configure a pseudoterminal. * src/Makefile.in (LIB_POSIX_SPAWN): New variable. (LIBES): Use it. * src/callproc.c (emacs_spawn): Use posix_spawn on Unix-like system if we don't need to set up a pseudoterminal.
* | Adjust to recent Gnulib changesPaul Eggert2020-12-253-23/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The latest Gnulib merge brought in free-posix, which causes 'free' to preserve errno. This lets us simplify some Emacs code that calls 'free'. * admin/merge-gnulib (GNULIB_MODULES): Add free-posix. This module is pulled in by canonicalize-lgpl anyway, so we might as well rely on it. * lib-src/emacsclient.c (get_current_dir_name): Sync better with src/sysdep.c. * lib-src/etags.c (process_file_name, etags_mktmp): * lib-src/update-game-score.c (unlock_file): * src/fileio.c (file_accessible_directory_p): * src/sysdep.c (get_current_dir_name_or_unreachable): Simplify by assuming that 'free' preserves errno. * src/alloc.c (malloc_unblock_input): Preserve errno, so that xfree preserves errno. * src/sysdep.c (get_current_dir_name_or_unreachable): Simplify by using strdup instead of malloc+memcpy. No need for realloc (and the old code leaked memory anyway on failure); just use free+malloc.
* | Pacify gcc 10.2 -Wanalyzer-null-argument in gtkutil.cPaul Eggert2020-12-251-5/+2
| | | | | | | | | | | | | | * src/gtkutil.c (xg_item_label_same_p): Simplify. Without this simplification, GCC (Ubuntu 10.2.0-13ubuntu1) -Wanalyzer-null-argument complains about use of NULL where non-null expected as argument of strcmp.
* | ; * src/callproc.c (emacs_spawn) [!WINDOWSNT]: Fix last change.Eli Zaretskii2020-12-241-2/+2
| |
* | Unbreak the MinGW build broken by recent changes in callproc.cEli Zaretskii2020-12-245-48/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32.h (set_process_dir): * src/w32proc.c (set_process_dir): Change the argument to 'const char *'. * src/lisp.h (make_environment_block): * src/callproc.c (make_environment_block): Now returns 'char **'. (exec_failed) [DOS_NT]: Remove unused function. * src/callproc.c (child_setup): NEW_ARGV and ENV are now 'char **'. Making them 'const' breaks the MinGW build and is not needed for other platforms. * src/callproc.c (emacs_spawn): ARGV and ENVP arguments are now 'char *', for the same reason. * src/process.c (create_process): Adapt to above changes.
* | Centralize subprocess creation in a single function.Philipp Stephani2020-12-243-223/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Getting the vfork + execve combination right isn't easy, and the code was partially duplicated between callproc.c and process.c. Centralize the spawn operation in a single function that deals with the nasty details. Going forward, we should be able to use posix_spawn from either libc or Gnulib (or CreateProcessW on Windows) in the non-pty case. * src/callproc.c (emacs_spawn): New function to start an asynchronous subprocess. Merge code from 'call_process' and 'create_process' into this function. (call_process): Use new 'emacs_spawn' function. (child_setup): Make static, since there are no users outside this compilation unit left. (CHILD_SETUP_TYPE): Move from header file, since there are no users outside this compilation unit left. * src/process.c (create_process): Use new 'emacs_spawn' function.
* | * src/dispnew.c (sit_for): Fix bug#45292Stefan Monnier2020-12-231-0/+9
| | | | | | | | | | When reading, prefer staying in the selected-window over preserving the current-buffer.