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

42069 commits

Author SHA1 Message Date
Daniel Martín
3223302aa2 Use modern constant names for the NS pasteboard
Use the same pasteboard constant names defined in
ns_drag_types. (Bug#43470).

* src/nsterm.m: Rename NSURLPboardType to NSPasteboardTypeURL,
NSStringPboardType to NSPasteboardTypeString, and
NSTabularTextPboardType to NSPasteboardTypeTabularText
2020-09-18 20:06:36 +01:00
Eli Zaretskii
694acda5f2 Fix compilation on TERMINFO platforms with GCC 10
* src/terminfo.c [TERMINFO]: Don't redefine UP, BC, and CP, as
that could cause linking errors due to multiple definitions.
(Bug#43195)
2020-09-12 10:11:26 +03:00
Eli Zaretskii
366a97c980 Avoid crashes when trying to load bad GIF files
* src/image.c (gif_load): Handle the case when GifErrorString
returns NULL.  (Bug#43281)
2020-09-08 19:17:23 +03:00
Paul Eggert
eb77572257 Fix replace-region-contents performance bug
Backport from master.
* src/editfns.c (rbc_quitcounter): Remove; the quitcounter
is now part of the context.
(EXTRA_CONTEXT_FIELDS): Remove unused member early_abort_tests.
Add jmp, quitcounter.
(Freplace_buffer_contents): Use setjmp/longjmp to recover from
a compareseq that runs too long.  Omit unnecessary rarely_quit
call.
(buffer_chars_equal): Occasionally check for early abort and
longjmp out if so (Bug#43016).
2020-08-25 11:25:21 -07:00
Eli Zaretskii
4e2caef384 ; * src/character.c (str_as_multibyte): Fix the commentary. 2020-08-21 18:15:05 +03:00
Robert Pluim
4542b750cc Fix bug with ~/Emacs file not being read at init
* src/xrdb.c (get_user_app): Put "/" between homedir
and %L or %N (Bug#42827).
2020-08-16 21:41:03 -07:00
Tino Calancha
3c4edfd85e Prevent from frozen frame after `C-z' in Lucid builds
Some WMs (e.g. mutter in Gnome Shell) don't unmap iconized windows,
thus we won't get a MapNotify when deconifying them.
Check if we are deconifying a window elsewhere (Bug#42655).

- src/xterm.c (handle_one_xevent):
Check for window deconify when receiving a FocusIn signal.
2020-08-15 16:18:03 +02:00
Paul Eggert
cf0ee6f49b ; spelling fixes 2020-08-13 16:48:16 -07:00
Paul Eggert
16f4f26632 Fix startup working dir bug on NeXTSTEP
* src/emacs.c (main) [NS_IMPL_COCOA]: Update emacs_wd
after a NS GUI chdirs successfully (Bug#42836).
2020-08-13 15:44:00 -07:00
Eli Zaretskii
c9a739408d Fix face merging at EOL when inherited face specifies :extend
* src/xfaces.c (merge_face_ref): Handle correctly faces that
inherit from another, and in addition specify :extend.
(Bug#42552)

(cherry picked from commit 39c90f8dfa)
2020-08-13 16:39:12 +03:00
Eli Zaretskii
f946e48bf5 Fix face extension past EOL in overlay strings
* src/xdisp.c (face_at_pos): Pass ATTR_FILTER to
face_for_overlay_string.
* src/xfaces.c (face_for_overlay_string): Accept an additional
argument ATTR_INDEX and pass it to merge_face_ref for merging the
face at POS.  This ensures a face from buffer text will not be
merged unless it specifies the :extend attribute.  (Bug#42552)
* src/dispextern.h (face_for_overlay_string): Adjust prototype.

(cherry picked from commit 35564bea4d)
2020-08-13 16:38:44 +03:00
Grégory Mounié
72c5f71cd4 Avoid segfaults if XIM is set but not xim_styles
Emacs segfaults at the X11 initialization if XIM is set
and xim_styles is NULL.  This patch avoids the crash.
* src/xfns.c: Check also if FRAME_X_XIM_STYLES(f) is NULL.
(Bug#42676)  (Bug#42673)  (Bug#42677)

Copyright-paperwork-exempt: yes
2020-08-02 20:19:16 +03:00
Philipp Stephani
d767418b76 Backport: Make checking for liveness of global values more precise.
We can't just use a hash lookup because a global and a local reference
might refer to the same Lisp object.

* src/emacs-module.c (module_free_global_ref): More precise check for
global liveness.

(cherry picked from commit 9f01ce6327)
2020-07-31 18:18:43 +02:00
Philipp Stephani
8c94ca94dc Backport: Fix subtle bug when checking liveness of module values.
We can't simply look up the Lisp object in the global reference table
because an invalid local and a valid global reference might refer to
the same object.  Instead, we have to test the address of the global
reference against the stored references.

* src/emacs-module.c (module_global_reference_p): New helper function.
(value_to_lisp): Use it.

(cherry picked from commit 6355a3ec62)
2020-07-31 18:18:27 +02:00
Philipp Stephani
8ecca2f09f Backport: Fix memory leak for global module objects (Bug#42482).
Instead of storing the global values in a global 'emacs_value_storage'
object, store them as hash values alongside the reference counts.
That way the garbage collector takes care of cleaning them up.

* src/emacs-module.c (global_storage): Remove.
(struct module_global_reference): New pseudovector type.
(XMODULE_GLOBAL_REFERENCE): New helper function.
(module_make_global_ref, module_free_global_ref): Use
'module_global_reference' struct for global reference values.
(value_to_lisp, module_handle_nonlocal_exit): Adapt to deletion of
'global_storage'.

(cherry picked from commit 5c5eb97908)
2020-07-31 18:05:18 +02:00
Eli Zaretskii
4b3085a7fe Fix last change
* src/composite.c (composition_reseat_it): Fix of the commentary,
and a minor change of the last fix.
2020-07-25 19:25:02 +03:00
Pip Cet
efdd4632c9 Fix Arabic shaping when column-number-mode is in effect
* src/indent.c (scan_for_column, compute_motion): Pass -1,
instead of NEUTRAL_DIR, to 'composition_reseat_it'.
* src/composite.c (composition_reseat_it): Interpret negative
value of BIDI_LEVEL to mean the caller doesn't know what is the
bidi direction of the text.  (Bug#41005)
2020-07-25 19:19:27 +03:00
Eli Zaretskii
0d4ba1c2b2 Improve documentation of 'kill-emacs'
* doc/lispref/os.texi (Killing Emacs):
* src/emacs.c (Fkill_emacs): Document what non-integer, non-string
argument to 'kill-emacs' means.  (Bug#42400)
2020-07-17 17:54:00 +03:00
Eli Zaretskii
e325d2638c Fix interrupt-process on MS-Windows
* src/w32proc.c (sys_kill): Test the status of the left Ctrl key
for the purpose of restoring it after simulating Ctrl-C.  This
avoids leaving the left Ctrl key status in depressed state when
the user actually pressed the right Ctrl key.  (Bug#42350)
2020-07-16 19:51:19 +03:00
Eli Zaretskii
c04b92104c Add commentary in gtkutil.c
* src/gtkutil.c: Add a comment regarding the incompatibilities
vis-a-vis GTK.  Suggested by Richard Stallman <rms@gnu.org>.
2020-07-11 12:47:26 +03:00
Eli Zaretskii
3a446a02fb ; * src/xdisp.c (decode_mode_spec): Fix commentary. 2020-07-08 19:45:30 +03:00
Eli Zaretskii
71fc003860 Avoid infloop in 'format-mode-line'
* src/xdisp.c (decode_mode_spec): Don't use W->start if it is
outside of the buffer's accessible region.  (Bug#42220)
2020-07-07 17:08:19 +03:00
Philipp Stephani
59e768d64a Fix undefined behavior in json.c (Bug#42113)
* src/json.c (lisp_to_json_toplevel_1, Fjson_parse_string): Check
whether input strings are actually strings.

* test/src/json-tests.el (json-parse-string/wrong-type)
(json-serialize/wrong-hash-key-type): New regression tests.
2020-06-29 12:32:56 +02:00
Eli Zaretskii
0121db2702 * src/keyboard.c (Fclear_this_command_keys): Doc fix. 2020-06-27 11:35:34 +03:00
Eli Zaretskii
b87fc938a0 ; * src/xdisp.c (pos_visible_p): Yet another minor fix for bug#42039. 2020-06-26 22:33:44 +03:00
Eli Zaretskii
5280e118c0 ; * src/xdisp.c (pos_visible_p): Fix last change. (Bug#42039) 2020-06-26 16:34:50 +03:00
Eli Zaretskii
bb1a9481c9 Fix posn-at-point at beginning of a display string
* src/xdisp.c (pos_visible_p): Account for the line-number width
when the display string at CHARPOS ends in a newline.  (Bug#42039)
2020-06-26 15:01:44 +03:00
Stephen Berman
368e140660 Avoid crashes in 'defconst'
* src/eval.c (Fdefconst): Verify that SYMBOL is a known symbol.
(Bug#41817)
2020-06-20 11:05:28 +03:00
Eli Zaretskii
fbd49f969e * src/xdisp.c (Fwindow_text_pixel_size): Doc fix. (Bug#41737) 2020-06-06 19:53:08 +03:00
Eli Zaretskii
30a7ee505a Fix Arabic shaping when eww/shr fill the text to be rendered
* src/hbfont.c (hbfont_shape): Don't use DIRECTION if the current
buffer has bidi reordering disabled.  (Bug#41005)
2020-06-05 10:56:01 +03:00
Eli Zaretskii
0260d2d2db Don't call 'mbrtowc' on WINDOWSNT
* src/emacs.c (using_utf8): Don't call 'mbrtowc' on WINDOWSNT
systems, as it's not available on Windows 9X.
2020-06-01 18:57:39 +03:00
Paul Eggert
68b6dad1d8 Be more aggressive in marking objects during GC
Simplified version of a patch from Pip Cet (Bug#41321#299).
* src/alloc.c (maybe_lisp_pointer): Remove.  All uses removed.
(mark_memory): Also look at the pointer offset by ‘lispsym’,
for symbols.
2020-05-31 16:30:54 -07:00
Eli Zaretskii
36f508f589 ; * src/xdisp.c (find_last_unchanged_at_beg_row): Fix a typo. 2020-05-31 20:34:00 +03:00
Eli Zaretskii
41232e6797 Avoid crashes due to bidi cache being reset during redisplay
If automatic character composition triggers GC, and
'garbage-collection-messages' are turned on, we could have the
bidi cache reset while processing RTL text, which would then
consistently crash.
* src/xdisp.c (display_echo_area_1): Protect the bidi cache
against changes inside 'try_window'.
2020-05-31 17:23:11 +03:00
Eli Zaretskii
df91c94ca8 Fix access to single-byte characters in buffer text
* src/xdisp.c (get_visually_first_element)
(Fbidi_find_overridden_directionality):
* src/cmds.c (Fend_of_line): Use FETCH_BYTE instead of FETCH_CHAR,
and byte position instead of character position, to access
individual bytes of buffer text.  This avoids producing invalid
characters and accessing wrong buffer positions.  (Bug#41520)
2020-05-25 17:07:22 +03:00
Eli Zaretskii
a10254dd46 Fix accessing files on networked drives on MS-Windows
* src/w32.c (acl_get_file): Set errno to ENOTSUP if
get_file_security returns ERROR_NOT_SUPPORTED.  (Bug#41463)
2020-05-23 08:50:22 +03:00
Paul Eggert
62a5e890d7 Redo RCS Id for pdumper
* lisp/version.el: Don’t put an RCS Id style string into the
executable via purecopy, as this does not work with the pdumper.
* src/emacs.c (RCS_Id): New constant, for 'ident'.

(cherry picked from commit 3d1bcfba5e)
2020-05-21 19:17:36 +03:00
Clément Pit-Claudel
48830c73e7 Fix a crash in handle_display_spec
* src/xdisp.c (handle_display_spec): Check that the cdr of the
disable-eval spec is a cons before taking its car.  (Bug#41232)
2020-05-13 18:53:25 +03:00
Martin Rudalics
a37290a6f9 In x_hide_tip reset tip_last_frame for GTK+ tooltips only (Bug#41200)
* src/xfns.c (x_hide_tip): Reset tip_last_frame only when
using GTK+ system tooltips (Bug#41200).
2020-05-13 10:31:50 +02:00
Philipp Stephani
d5c184aa3e Refer to fill column indicator Info node in some places.
* src/xdisp.c (syms_of_xdisp): Add reference to manual in
documentation strings for variables related to fill column indicators.

* lisp/display-fill-column-indicator.el (display-fill-column-indicator)
(display-fill-column-indicator-mode): Add reference to manual.
2020-05-09 10:22:01 +02:00
Eli Zaretskii
a76cafea0d Fix handling of FROM = t and TO = t by 'window-text-pixel-size'
* src/xdisp.c (Fwindow_text_pixel_size): Use byte position for
accessing buffer text, not character positions.  (Bug#41125)
2020-05-08 13:35:34 +03:00
Philipp Stephani
95fde1a851 * src/editfns.c (Fformat): Small documentation fix. 2020-05-05 14:59:27 +02:00
Stefan Kangas
f9fa726ced Improve doc strings of makunbound and fmakunbound
* src/data.c (Fmakunbound, Ffmakunbound): Improve doc
strings.  (Bug#41026)
2020-05-03 22:01:23 +02:00
Eli Zaretskii
274ec97e3c Make sure alist-related functions say so in their doc
* src/fns.c (Fassq, assq_no_quit, Fassoc, assoc_no_quit, Frassq)
(Frassoc): Rename argument LIST to ALIST.  Doc strings updated.
2020-04-29 17:52:53 +03:00
Eli Zaretskii
16fed05ba8 Avoid crashes on TTY frames with over-long compositions
* src/term.c (encode_terminal_code): Each character from an
automatic composition is a multibyte character, so its multibyte
representation can take up to MAX_MULTIBYTE_LENGTH bytes.
Account for that when allocating storage for characters to be
encoded.  (Bug#40913)
2020-04-28 11:57:16 +03:00
Eli Zaretskii
369761b36d ; * src/xdisp.c: Improve the introductory commentary. 2020-04-24 18:09:20 +03:00
Stefan Monnier
d5ec18c66b * src/regex-emacs.c (re_match_2_internal): Rework comment in last change
Explain why we don't need to worry about Lisp modifying the buffer.

* src/syntax.c (parse_sexp_propertize): Fix name in error message.
2020-04-18 23:01:43 -04:00
Štěpán Němec
067b070598 ; Fix some typos and doc issues (bug#40695) 2020-04-18 17:10:02 +02:00
Eli Zaretskii
f3b62b6c62 Avoid crashes in regex-emacs.c due to GC
* src/regex-emacs.c (re_match_2_internal): Prevent GC from
invalidating C pointers to buffer text.  (Bug#40661)
2020-04-18 14:53:13 +03:00
YAMAMOTO Mitsuharu
d87a4d1f4e Limit RLIMIT_NOFILE to FD_SETSIZE on macOS
* src/nsterm.m ([EmacsApp applicationDidFinishLaunching:]): Call
CoreFoundation functions that increase RLIMIT_NOFILE behind our back
during startup, and then set RLIMIT_NOFILE back to FD_SETSIZE to avoid
crashes in setup_process_coding_system  (Bug#39164).
2020-04-15 11:55:16 +02:00