1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-08 12:40:49 -08:00
Commit graph

42824 commits

Author SHA1 Message Date
Stefan Monnier
b2f8c9f96f * src/xdisp.c (syms_of_xdisp): New var redisplay-skip-fontification-on-input
(handle_fontified_prop): Use it.

* src/keyboard.h (input_was_pending): Declare.
* src/keyboard.c (input_was_pending): Make non-static.
2021-01-04 00:59:56 -05:00
Stefan Monnier
c2e0f1982f * src/buffer.c (Fset_buffer_multibyte): Remove dead code 2021-01-03 17:20:28 -05:00
Paul Eggert
632917461a Fix broken build on AIX 7.2
Without this fix, the build on AIX 7.2 with xlc fails in the ‘CCLD
temacs’ step with the diagnostic ‘ld: 0711-317 ERROR: Undefined
symbol: BC’.  This is because -lcurses does not define BC etc.
* configure.ac: When building terminfo.o, define
TERMINFO_DEFINES_BC if the library defines BC etc.
* src/terminfo.c (UP, BC, PC): Define depending on
TERMINFO_DEFINES_BC, not on TERMINFO.
2021-01-03 11:59:50 -08:00
Alan Third
ad2567fb1e Fix child frame restacking on NS (bug#41422)
* src/nsfns.m (Fns_frame_restack): Use new restackWindow method.
* src/nsterm.m ([EmacsWindow orderFront:]):
([EmacsWindow makeKeyAndOrderFront:]):
(nswindow_orderedIndex_sort):
([EmacsWindow orderBack:]):
([EmacsWindow restackWindow:above:]): Override superclass methods to
handle child windows the way we want.
2021-01-03 16:23:06 +00:00
Alan Third
f14869cd70 Fix crash when using menus and tramp on NS
; Fixes bug#24472, bug#37557 and bug#37922.

* src/nsterm.m (ns_select): Don't drain outerpool in this function.
2021-01-02 22:29:55 +00:00
Alan Third
d84cf78df8 Fix NS toolbar image release crash (bug#43973)
The toolbar fails to make a proper copy of EmacsImage objects, so
releasing the copy incorrectly released instance variables from the
original objects.

* src/nsimage.m ([EmacsImage copyWithZone:]): New function to enable
correct copying of EmacsImage.
2021-01-02 22:29:54 +00:00
Mattias Engdegård
d10c96c426 Fix backslash mistakes in doc strings in C code
These were found by an instrumented version of make-docfile.

* src/gnutls.c (Fgnutls_available_p):
* src/keymap.c (Fkey_description):
* src/xdisp.c (syms_of_xdisp):
2021-01-02 18:12:13 +01:00
Philipp Stephani
4ac6148ef9 Avoid printing stacktraces when it probably wouldn't work anyway.
* src/eval.c (signal_or_quit): Don't try to call the debugger if it's
inhibited or we are about to dump or bootstrap.  In those cases the
debugger probably wouldn't work anyway.
2021-01-02 15:04:50 +01:00
Alan Third
1c5208ba71 Fix GNUstep warnings
* 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.
2021-01-01 22:41:26 +00:00
Alan Third
107978365e Improve drawing performance on macOS
* configure.ac: Require IOSurface framework.
* src/nsterm.h: New EmacsSurface class and update EmacsView
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]):
([EmacsView viewDidResize:]): Handle new EmacsSurface class.
([EmacsView initFrameFromEmacs:]): Remove reference to old method.
([EmacsView createDrawingBuffer]): Remove method.
([EmacsView focusOnDrawingBuffer]):
([EmacsView windowDidChangeBackingProperties:]): Use new EmacsSurface
class.
([EmacsView unfocusDrawingBuffer]): New method.
([EmacsView copyRect:to:]): Get information from the context instead
of direct from the IOSurface.
([EmacsView updateLayer]): Use new EmacsSurface class.
([EmacsView copyRect:to:]): Use memcpy to copy bits around instead of
using NS image functions.
([EmacsSurface initWithSize:ColorSpace:]):
([EmacsSurface dealloc]):
([EmacsSurface getSize]):
([EmacsSurface getContext]):
([EmacsSurface releaseContext]):
([EmacsSurface getSurface]):
([EmacsSurface copyContentsTo:]): New class and methods.
2021-01-01 22:41:26 +00:00
Paul Eggert
aa2739bf1b Fix CCL_MOD typo
* src/ccl.c (ccl_driver): Fix typo that disabled the
checks for undefined behavior with integer remainder.
Problem caught by Oracle Studio 12.6.
2021-01-01 12:58:18 -08:00
Paul Eggert
a1f603f0a3 Add overflow check for INPUT_EVENT_POS_MIN
* src/keyboard.c (INPUT_EVENT_POS_MIN): Don’t assume (-1 -
INPUT_EVENT_POS_MAX) fits into ptrdiff_t.  This fixes a
purely-theoretical problem that cannot occur on two’s-complement
arithmetic.  The Solaris 10 compiler still complains incorrectly,
but oh well.
2021-01-01 12:58:17 -08:00
Paul Eggert
9076a631fe Port to Solaris 10
* configure.ac: Instead of AC_CHECK_HEADER, use AC_COMPILE_IFELSE
with X11/Intrinsic.h when checking for X11/extensions/Xrender.h.
This suppresses a bogus "report a bug to bug-gnu-emacs" diagnostic
from 'configure' in Solaris 10.
(SETUP_SLAVE_PTY): Adjust to recent renaming of forkin to
std_in in callproc.c.  Needed on Solaris and Unixware.
* lib-src/Makefile.in (LIB_GETRANDOM, LIBS_ETAGS): New vars,
needed because on Solaris 10 the Gnulib tempname module now needs
the -lrt library for clock_gettime.  Throw in the LIB_GETRANDOM
stuff too while we’re at it; from getrandom.m4 it seems to be
needed for MingW.
(LIBS_MOVE, etags_libs): Use them.
* src/callproc.c [SETUP_SLAVE_PTY]: Include sys/stream.h
and sys/stropts.h, for SETUP_SLAVE_PTY’s definiens.
* src/process.c [NEED_BSDTTY]: Don’t include bsdtty.h; hasn’t been
needed in years.
[USG5_4]: Don’t include sys/stream.h or sys/stropts.h; these
directives havbe been moved to callproc.c because the only use of
SETUP_SLAVE_PTY is there now.
2021-01-01 12:58:17 -08:00
Paul Eggert
8bc552ffa5 Merge from origin/emacs-27
74a77ef299 Improve documentation of 'network-lookup-address-info'
c6d5555646 Display messages sent using ERC's /say
c156723769 Fix Rmail summary display when From: header is malformed
2021-01-01 01:14:58 -08:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Eli Zaretskii
74a77ef299 Improve documentation of 'network-lookup-address-info'
* src/process.c (Fnetwork_lookup_address_info):
* doc/lispref/processes.texi (Misc Network): Document the error
message emitted by 'network-lookup-address-info' when it fails.
2020-12-31 22:27:30 +02:00
Stefan Kangas
46c4bcd392 Minor cleanup in doc.c
* src/doc.c (get_doc_string, Fdocumentation)
(Fdocumentation_property, store_function_docstring):
Minor cleanup.
2020-12-31 10:27:20 +01:00
Philipp Stephani
0eef70aea8 Minor improvements to FD_SETSIZE overflow checks.
* src/process.c (Fmake_serial_process): Add port to error data.
(connect_network_socket): Add an explanatory comment.
2020-12-31 00:31:21 +01:00
Philipp Stephani
8bc85d46cc Manually limit file descriptors that we select on to FD_SETSIZE.
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.
2020-12-31 00:18:02 +01:00
Philipp Stephani
0ea7bb3578 Consistently check for FD_SETSIZE overflow.
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.
2020-12-30 23:04:34 +01:00
Philipp Stephani
72dc46584c * src/nsterm.m (ns_select): Fix off-by-one error, and add assertion 2020-12-30 22:36:42 +01:00
Alan Third
c4c8da67e8 Fix Help menu on macOS
* src/nsmenu.m (ns_update_menubar): Make sure to reset the help menu
when we move it to another submenu.
2020-12-30 15:39:26 +00:00
Mattias Engdegård
26bfaa1f78 Use standard key symbols in NS menu entries
* src/nsmenu.m (skipspc): Remove.
(key_symbols, prettify_key): New.
([EmacsMenu fillWithWidgetValue:]): Call prettify_key.
2020-12-30 13:50:49 +01:00
Mattias Engdegård
f232715aac ; * src/nsmenu.m: Undo unintentional change 2020-12-30 13:14:16 +01:00
Mattias Engdegård
d0a2543986 Plug NS memory leaks (bug#45502)
* src/nsmenu.m ([EmacsMenu addItemWithWidgetValue:attributes:]):
Mark allocated and owned objects for autorelease.
2020-12-30 11:33:42 +01:00
Michael Albinus
baeb82df8b * src/dbusbind.c (XD_BASIC_DBUS_TYPE): Fix error in declaration. 2020-12-30 10:49:48 +01:00
Stefan Kangas
d22fa9eb67 Minor cleanup in keymap.c
* 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.
2020-12-30 09:43:38 +01:00
Lars Ingebrigtsen
dc308c80ee Improve the long' computation of mode-line-compact'
* src/xdisp.c (display_mode_line): Compute `long' based on total
window width, and use the passed-in window instead of the selected
window.
2020-12-30 03:34:17 +01:00
Alan Third
90bd3b3d69 Don't calculate macOS menu data for GNUstep (bug#45502)
* src/nsmenu.m ([EmacsMenu fillWithWidgetValue:]): #ifdef out code
that has no effect on GNUstep and autorelease alloc'd objects.
2020-12-29 21:13:29 +00:00
Artem Loenko
a88f63500e * src/Makefile.in (DO_CODESIGN): Fix architecture for Apple Silicon 2020-12-29 20:42:01 +01:00
Eli Zaretskii
baac3562a6 A better fix for process-tests on MS-Windows
* 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.
2020-12-29 21:30:59 +02:00
Mattias Engdegård
b5ada7f9af More readable keys in NS menu entries (bug#45502)
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.
2020-12-29 17:34:53 +01:00
Alan Third
177863b1ce Fix crash in NS menu code
* 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.
2020-12-29 13:45:30 +00:00
Glenn Morris
1fc011c075 * src/xdisp.c (display_mode_line): I guess FALSE should be false. 2020-12-28 21:36:47 -08:00
Lars Ingebrigtsen
6481da6b90 Revert the previous display_string change
* src/xdisp.c (display_string): Revert adding the additional
ignore_text_properties parameter -- it was already covered by the
other mix of parameters.
2020-12-29 06:07:44 +01:00
Lars Ingebrigtsen
88c96962cf Fix compact mode line text properties
* src/xdisp.c (display_mode_line): Display the compact mode
correctly (with text properties) (bug#45520).
2020-12-29 05:59:42 +01:00
Lars Ingebrigtsen
03bab768be Add a parameter to display_string to allow not ignoring text props
* src/xdisp.c (display_string): Add a parameter to allow not
ignoring text properties (bug#45520).  Adjust callers throughout
xdisp.c.
2020-12-29 05:16:25 +01:00
Lars Ingebrigtsen
a66f0d3bd3 Introduce new variable mode-line-compact
* 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.
2020-12-29 04:53:03 +01:00
Alan Third
16458631d4 Fix crash in NS menu code
* 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.
2020-12-28 18:03:48 +00:00
Yichao Yu
2a64de5e98 Make XIM to work with non-CJK locales
* 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.
2020-12-28 04:17:43 +01:00
Alan Third
c9b37634b1 Remove NS menu synthesized events (bug#44333)
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.
2020-12-27 16:51:47 +00:00
Basil L. Contovounesios
df882c9701 ; Fix recent shortdoc.el and fns.c additions
* lisp/emacs-lisp/shortdoc.el (list): Fix typos.
* src/fns.c (Flength_equal): Fix docstring.
2020-12-27 13:14:30 +00:00
Štěpán Němec
8bc727d0b4 ; Fix the recent `length' doc string addition 2020-12-27 11:43:19 +01:00
Lars Ingebrigtsen
eb98afaf35 Fix up length_internal with degenerate length inputs
* src/fns.c (length_internal): Protect against edge conditions.
2020-12-27 09:22:02 +01:00
Lars Ingebrigtsen
0f790464d5 Add new predicates for sequence lengths
* 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.
2020-12-27 09:00:23 +01:00
Eli Zaretskii
25fb44fad1 Fix test/src/process-tests on MS-Windows
* src/process.c (network_lookup_address_info_1) [WINDOWSNT]:
Initialize winsock.
2020-12-26 15:01:52 +02:00
Zajcev Evgeny
b3c9af9061 Improvements for `:base-uri' svg image property
* src/image.c (svg_load): Use ENCODE_FILE for `:base-uri'

* doc/lispref/display.texi (SVG Images): Add more documentation for
  `:base-uri'
2020-12-26 11:18:49 +02:00
Glenn Morris
90ec81f5b2 Merge from origin/emacs-27
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...
2020-12-25 10:36:48 -08:00
Eli Zaretskii
e387371497 Revert "Use posix_spawn if possible."
This reverts commit 2c79a8f921.
It breaks the MinGW build in too many ways, and should be
first tested on a branch.
2020-12-25 14:50:25 +02:00
Philipp Stephani
2c79a8f921 Use posix_spawn if possible.
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.
2020-12-25 12:17:32 +01:00