1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-03 06:00:50 -08:00
Commit graph

42119 commits

Author SHA1 Message Date
Stefan Monnier
82c228a017 Don't let maybe_quit prevent resetting consing_until_gc (bug#43389)
* src/alloc.c (garbage_collect): Postpone `unblock_input` a bit.
* src/window.c (window_parameter): Avoid `maybe_quit`.

cherry picked from commit 420661af07
2021-01-20 10:36:46 -05:00
Paul Eggert
2e09efdb68 Revert previous patch which was installed into wrong branch. 2021-01-03 11:58:34 -08:00
Paul Eggert
585997d05a 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:51:57 -08:00
Alan Third
3711339f92 Fix crash in ns_mouse_position (bug#45541)
* src/nsterm.m (ns_mouse_position): Explicitly initialize f to NULL.

; Do not merge to master
2021-01-01 10:36:39 +00:00
Paul Eggert
8c1fe1e5ef Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2021-01-01 00:32:32 -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
Philipp Stephani
fda9b3e83a * src/Makefile.in (DO_CODESIGN): Fix expected architecture name. 2020-12-23 19:15:56 +01:00
Itai Seggev
6bf22c933d Codesign the executable on recene MacOS systems
* src/Makefile.in (temacs$(EXEEXT)): Codesign the executable on
recent (ARM) MacOS systems (bug#43878).  Without this, building
Emacs fails.

Copyright-paperwork-exempt: yes
2020-12-23 17:32:19 +01:00
Alan Third
ee6c702e18 Fix error with fn key in NS port (bug#44533)
* src/nsterm.m ([EmacsView keyDown:]): Move the correction for fn key
handling to before the modifiers are calculated.

(cherry picked from commit 7970610d48)
2020-12-14 20:32:06 +00:00
Alan Third
6aa9fe3e1b Fix crash in ns_mouse_position (bug#44313)
* 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 18a7267c32)
2020-12-12 10:31:56 +00:00
Alan Third
62a6934af9 Fix crash when using XRender and restoring image from X (bug#44930)
* src/dispextern.h (struct image): Add original dimension elements.
* src/image.c (image_set_transform): Store the original dimensions.
(image_get_x_image): If we're using transforms use the original
dimensions with XGetImage.
2020-12-12 10:30:39 +00:00
Eli Zaretskii
a4dd03ebe9 ; * src/charset.c (Fmap_charset_chars): Doc fix. 2020-12-02 18:25:10 +02:00
Eli Zaretskii
d86cc3ffcb ; * src/chartab.c, src/lisp.h: Fix typos in comments. 2020-12-02 18:07:54 +02:00
Eli Zaretskii
9fbff9c35c ; * src/buffer.c: Fix comment describing 'buffer_defaults'. 2020-11-30 20:42:06 +02:00
Eli Zaretskii
f31cacd1ff Revert "Fix incorrect handling of module runtime and environment pointers."
This reverts commit cdc632fbe6.
Those changes are too significant and non-trivial to be
suitable for a release branch at this time.
2020-11-28 09:21:33 +02:00
Philipp Stephani
cdc632fbe6 Fix incorrect handling of module runtime and environment pointers.
We used to store module runtime and environment pointers in the static
lists Vmodule_runtimes and Vmodule_environments.  However, this is
incorrect because these objects have to be kept per-thread.  With this
naive approach, interleaving module function calls in separate threads
leads to environments being removed in the wrong order, which in turn
can cause local module values to be incorrectly garbage-collected.

Instead, turn Vmodule_runtimes and Vmodule_environments into
hashtables keyed by the thread objects.  The fix is relatively
localized and should therefore be safe enough for the release branch.

Module assertions now have to walk the pointer list for the current
thread, which is more correct since they now only find environments
for the current thread.

Also add a unit test that exemplifies the problem.  It interleaves two
module calls in two threads so that the first call ends while the
second one is still active.  Without this change, this test triggers
an assertion failure.

* src/emacs-module.c (Fmodule_load, initialize_environment)
(finalize_environment, finalize_runtime_unwind): Store runtime and
environment pointers in per-thread lists.
(syms_of_module): Initialize runtimes and environments hashtables.
(module_assert_runtime, module_assert_env, value_to_lisp): Consider
only objects for the current thread.
(module_gc_hash_table_size, module_hash_push, module_hash_pop): New
generic hashtable helper functions.
(module_objects, module_push_pointer, module_pop_pointer): New helper
functions to main thread-specific lists of runtime and environment
pointers.
(mark_modules): Mark all environments in all threads.

* test/data/emacs-module/mod-test.c (Fmod_test_funcall): New test
function.
(emacs_module_init): Bind it.

* test/src/emacs-module-tests.el (emacs-module-tests--variable): New
helper type to guard access to state in a thread-safe way.
(emacs-module-tests--wait-for-variable)
(emacs-module-tests--change-variable): New helper functions.
(emacs-module-tests/interleaved-threads): New unit test.
2020-11-27 21:44:05 +01:00
Martin Rudalics
6442cdc0e4 Revert extra focus redirection in do_switch_frame (Bug#24803)
* src/frame.c (do_switch_frame): Do not also redirect frame
focus when FRAME has its minibuffer window on the selected
frame which was intended to fix Bug#24500.  It may cause
Bug#24803 and lead to a nasty state where no active cursor is
shown on any frame, see
https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg01137.html.
2020-11-25 09:58:21 +01:00
Eli Zaretskii
f425a774c2 Fix display artifacts when 'display' properties cover newlines
* src/xdisp.c (pos_visible_p): Set glyph_row of scratch iterators
to NULL, to avoid producing glyphs while we figure out the layout.
(Bug#44826)
2020-11-24 17:04:37 +02:00
Eli Zaretskii
86cbc9d216 Make ignoring modifiers on IME input optional
By default, ignore modifier keys on IME input, but add
a variable to get back old behavior.
* src/w32fns.c (syms_of_w32fns): New variable
w32-ignore-modifiers-on-IME-input.
(w32_wnd_proc): Use it to ignore modifier keys when IME input is
used.  (Bug#44641)

* etc/NEWS: Announce the change and the new variable.
2020-11-21 10:14:55 +02:00
Masahiro Nakamura
32b97bb9e0 Ignore modifiers when processing WM_IME_CHAR messages
* src/w32fns.c (w32_wnd_proc): Ignore modifiers when processing
WM_IME_CHAR messages.
2020-11-21 09:50:22 +02:00
Eli Zaretskii
f641ef1a07 Improve documentation of 'font-spec'
* doc/lispref/display.texi (Low-Level Font):
* src/font.c (Ffont_spec): Document 'font-spec' keys that are
supported, but were undocumented.
2020-11-19 22:06:23 +02:00
Eli Zaretskii
e2c7b6372d Don't leave lock files after 'replace-buffer-contents'
* src/editfns.c (Freplace_buffer_contents): Unlock the buffer's
file if no changes have been made.  (Bug#44303)

(cherry picked from commit a5867ddfbd)
2020-11-14 15:24:15 +02:00
Eli Zaretskii
5aabf2cc7f Fix display of truncated R2L lines on TTY frames
* src/xdisp.c (extend_face_to_end_of_line): Use a while-loop, not
a do-while loop, to avoid appending an extra glyph at the end of a
line that is one character shorter than the window-width.  This is
needed to fix display of reversed glyph rows that are almost as
wide as the window, because append_space_for_newline already added
one space glyph.
2020-11-14 13:56:12 +02:00
Eli Zaretskii
daff3bda10 Avoid crashes when a reversed glyph row starts with a composition
* src/dispnew.c (build_frame_matrix_from_leaf_window): Add an
assertion to prevent us from overwriting non-char glyphs with the
vertical border glyph.
* src/xdisp.c (extend_face_to_end_of_line): Account for one glyph
possibly inserted by append_space_for_newline.  (Bug#44506)
Remove a kludgey correction for an off-by-one error in column
counting, which is no longer needed.
2020-11-14 13:43:16 +02:00
Eli Zaretskii
f43e9ad524 Avoid crashes in the daemon due to user interaction
* src/minibuf.c (read_minibuf): Avoid crashes in the daemon if the
init file invokes some kind of minibuffer interaction, by not
updating the selected frame if it's the initial frame.
(Bug#44583)
2020-11-11 21:46:43 +02:00
Philipp Stephani
109eb1e7e2 Fix undefined behavior when fetching glyphs from the display vector.
You can trigger this rather obscure bug by enabling selective display
if the second glyph in its display vector has an invalid face.  For
example, evaluate

(set-display-table-slot standard-display-table
                        'selective-display [?A (?B . invalid)])

and then enable selective display.

* src/xdisp.c (next_element_from_display_vector): Check whether next
glyph code is valid before accessing it.
2020-11-09 22:14:39 +01:00
Eli Zaretskii
13ab70c80e Avoid breaking Arabic shaping in 'window-text-pixel-size'
* src/xdisp.c (CHAR_COMPOSED_P): If the bidi_p flag is not set,
pass -1 to composition_reseat_it, so that the shaping engine will
figure out the directionality of the text.  This is important,
e.g., when using move_it_* functions in some context that is not
redisplay, such as 'window-text-pixel-size'.  (Bug#44521)
2020-11-09 17:22:25 +02:00
Eli Zaretskii
d4242177da Fix 'send-string-to-terminal' writing very long strings
* src/dispnew.c (Fsend_string_to_terminal): Prevent partial writes
by blocking SIGIO while 'fwrite' runs.  (Bug#44320)
2020-11-07 11:19:44 +02:00
Pip Cet
0cdd6c9218 Handle Cairo errors in ftcrfont_open
* src/ftcrfont.c (ftcrfont_open): Handle Cairo errors (bug#41627).

(cherry picked from commit 954a4decfc)
2020-11-07 10:13:07 +02:00
Eli Zaretskii
e90ffcf759 * src/w32fns.c (Fw32_register_hot_key): Doc fix. (Bug#44456) 2020-11-05 19:46:50 +02:00
Eli Zaretskii
89740e9cb5 Prevent redisplay from moving point behind user's back
* src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start):
Bind inhibit-quit to a non-nil value around calls to
fast_looking_at, to prevent breaking out of redisplay_window,
which temporarily moves point in buffers shown in non-selected
windows.  (Bug#44448)
2020-11-04 22:10:06 +02:00
Eli Zaretskii
4e6104ea0b ; * src/xdisp.c (display_string): Fix a typo in a comment. 2020-11-01 21:49:35 +02:00
Noah Friedman
da6234e2df Make sure pixel sizes are zero when setting window size for ptys.
* sysdep.c (set_window_size): Initialize data to zero to avoid
passing any garbage from the stack to ioctl.
2020-10-29 14:55:37 -07:00
Ken Brown
2d15296db1 Fix failure of 'emacs --daemon' on Cygwin
* src/emacs.c (DAEMON_MUST_EXEC): Define unconditionally on
Cygwin, not just if HAVE_NTGUI is defined.  This fixes the failure
of 'emacs --daemon' to start on the non-w32 Cygwin builds.
(Bug#44285)
2020-10-29 08:45:29 -04:00
Eli Zaretskii
2443b15a91 * src/buffer.c (syms_of_buffer) <fill-column>: Improve doc string. 2020-10-27 17:43:29 +02:00
Clemens Radermacher
e0de9f3295 Don't skip empty lines when fitting mini frame to buffer (Bug#44080)
* lisp/window.el (fit-mini-frame-to-buffer,
window--resize-mini-frame, fit-frame-to-buffer,
fit-frame-to-buffer-1): By default, fit a mini frame without skipping its
buffer's leading or trailing empty lines.
* src/frame.c (resize-mini-frames): Update doc-string.
* lisp/cus-start.el (resize-mini-frames): Update for customize.
* doc/lispref/minibuf.texi (resize-mini-frames): Update description.
2020-10-27 09:45:25 +01:00
Eli Zaretskii
20c02e628c Improve documentation of display-fill-column-indicator
* lisp/display-fill-column-indicator.el
(display-fill-column-indicator-mode): Mention the globalized
version in the doc string.

* doc/emacs/display.texi (Displaying Boundaries): Improve and
clarify the documentation of display-fill-column-indicator.
Suggest using the minor mode as the primary means for turning the
feature on.

* src/xdisp.c (syms_of_xdisp) <display-fill-column-indicator>
<display-fill-column-indicator-character>: Doc fix.  (Bug#44226)
2020-10-26 18:01:13 +02:00
Paul Eggert
71661b2872 Use WebKit sandboxing
* src/xwidget.c (Fmake_xwidget): Enable sandboxing if WebKit 2.26
or later.  Do this early, as required for sandboxing (Bug#43071).
Co-authored-by: Qiantan Hong <qhong@mit.edu>
Copyright-paperwork-exempt: yes
2020-10-24 16:52:49 -07:00
Eli Zaretskii
e29cace60a Avoid rare crashes while producing line numbers
* src/xdisp.c (maybe_produce_line_number): Prevent freeing of
realized faces for as long as we are using lnum_face_id and
current_lnum_face_id for producing glyphs.  (Bug#44111)
2020-10-21 18:32:51 +03:00
Eli Zaretskii
72dd911981 Fix posn-at-x-y in builds --without-x
* src/keyboard.c (make_lispy_position): Don't exclude the
window_or_frame = frame case from TTY-only builds.  Reported by
Jared Finder <jared@finder.org>.

* doc/lispref/commands.texi (Click Events): Document the format of
POSITION in click events on the frame's internal border.
2020-10-16 10:02:50 +03:00
Eli Zaretskii
c00606171f A better fix for bug#43886
* src/xfaces.c (load_color2, Fcolor_distance): Revert last change.
* src/term.c (clear_tty_hooks): Don't clear defined_color_hook.
2020-10-10 11:11:34 +03:00
Eli Zaretskii
3196fd44c3 Avoid crashes when a theme is loaded with one frame suspended
* src/xfaces.c (load_color2, Fcolor_distance): Don't try to call
the frame's defined_color_hook if the frame is suspended.
(Bug#43886)
2020-10-09 22:21:18 +03:00
Eli Zaretskii
040dcbe53e Fix current-line hscrolling when overlays change
* src/xdisp.c (redisplay_internal): Disable "optimization 1" when
auto-hscrolling current line and we're redisplaying the selected
window.  (Bug#43835)
2020-10-08 14:45:16 +03:00
Eli Zaretskii
b6704d58e8 ; * src/xdisp.c (Fwindow_text_pixel_size): Doc fix. 2020-10-06 19:32:20 +03:00
Eli Zaretskii
acc9b46153 Fix merging of region face for non-ASCII characters
* src/xdisp.c (extend_face_to_end_of_line): Restore the correct
original face used by the iterator on this line, not the ASCII
face.  (Bug#43363)
2020-10-05 12:34:22 +03:00
Eli Zaretskii
90e5549f02 Don't signal an error when saving files on WdebDAV volumes
* src/w32.c (acl_get_file): If get_file_security raises the
ERROR_ACCESS_DENIED error, treat that like unsupported ACLs.
2020-09-29 18:21:23 +03:00
Eli Zaretskii
cc8fef2bdd Avoid infinite recursion with 'relative' line numbers display
* src/xdisp.c (display_count_lines_visually): Bind
'display-line-numbers' to 'relative' around 'start_display' as
well, since that can invoke 'move_it_to' internally, thus
causing infinite recursion.  (Bug#43589)
2020-09-25 11:55:51 +03:00
Eli Zaretskii
5b23393bcc ; * src/frame.c (syms_of_frame) <make-pointer-invisible>: Doc fix. 2020-09-19 21:57:20 +03:00
Eli Zaretskii
df04f3e755 Fix a rare segfault in syntax.c
* src/syntax.c (Fforward_comment): Prevent the loop for COUNT < 0
from going outside the valid range of character/byte positions.
(Bug#43499)

* doc/lispref/syntax.texi (Syntax Class Table): Mention the
"comment-fence" and "string-fence" as alternative names of 2
syntax classes.
2020-09-19 19:54:01 +03:00
Eli Zaretskii
759399cdb1 Improve documentation of 'max-mini-window-height'
* src/xdisp.c (syms_of_xdisp):
* doc/lispref/minibuf.texi (Minibuffer Windows): More accurate
wording in the documentation of 'max-mini-window-height', to
clarify the meaning of an integer value.
2020-09-18 22:50:36 +03:00