From 5c7dd8a783fa2503f042f6671279e5fca38c35cb Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 1 Jan 2018 00:21:42 -0800 Subject: Update copyright year to 2018 Run admin/update-copyright. --- src/intervals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index e711212d744..4c624ea79c1 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1,5 +1,5 @@ /* Code for doing intervals. - Copyright (C) 1993-1995, 1997-1998, 2001-2017 Free Software + Copyright (C) 1993-1995, 1997-1998, 2001-2018 Free Software Foundation, Inc. This file is part of GNU Emacs. -- cgit v1.2.1 From 42fe787b0f26c2df682b2797407a669ef8522ccb Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 6 Jul 2018 21:56:17 -0600 Subject: Rename integerp->fixnum, etc, in preparation for bignums * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c, src/sound.c, src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c, src/textprop.c, src/undo.c, src/w16select.c, src/w32.c, src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c, src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c, src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM, make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP, NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT. --- src/intervals.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 4c624ea79c1..90ec4bd0537 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1557,8 +1557,8 @@ graft_intervals_into_buffer (INTERVAL source, ptrdiff_t position, if (!inherit && tree && length > 0) { XSETBUFFER (buf, buffer); - set_text_properties_1 (make_number (position), - make_number (position + length), + set_text_properties_1 (make_fixnum (position), + make_fixnum (position + length), Qnil, buf, find_interval (tree, position)); } @@ -1793,7 +1793,7 @@ adjust_for_invis_intang (ptrdiff_t pos, ptrdiff_t test_offs, ptrdiff_t adj, /* POS + ADJ would be beyond the buffer bounds, so do no adjustment. */ return pos; - test_pos = make_number (pos + test_offs); + test_pos = make_fixnum (pos + test_offs); invis_propval = get_char_property_and_overlay (test_pos, Qinvisible, Qnil, @@ -1806,7 +1806,7 @@ adjust_for_invis_intang (ptrdiff_t pos, ptrdiff_t test_offs, ptrdiff_t adj, such that an insertion at POS would inherit it. */ && (NILP (invis_overlay) /* Invisible property is from a text-property. */ - ? (text_property_stickiness (Qinvisible, make_number (pos), Qnil) + ? (text_property_stickiness (Qinvisible, make_fixnum (pos), Qnil) == (test_offs == 0 ? 1 : -1)) /* Invisible property is from an overlay. */ : (test_offs == 0 @@ -1927,7 +1927,7 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos) if (! NILP (intangible_propval)) { while (XINT (pos) > BEGV - && EQ (Fget_char_property (make_number (XINT (pos) - 1), + && EQ (Fget_char_property (make_fixnum (XINT (pos) - 1), Qintangible, Qnil), intangible_propval)) pos = Fprevious_char_property_change (pos, Qnil); @@ -1954,7 +1954,7 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos) /* If preceding char is intangible, skip forward over all chars with matching intangible property. */ - intangible_propval = Fget_char_property (make_number (charpos - 1), + intangible_propval = Fget_char_property (make_fixnum (charpos - 1), Qintangible, Qnil); if (! NILP (intangible_propval)) @@ -2026,18 +2026,18 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos) enter_after = Qnil; if (! EQ (leave_before, enter_before) && !NILP (leave_before)) - call2 (leave_before, make_number (old_position), - make_number (charpos)); + call2 (leave_before, make_fixnum (old_position), + make_fixnum (charpos)); if (! EQ (leave_after, enter_after) && !NILP (leave_after)) - call2 (leave_after, make_number (old_position), - make_number (charpos)); + call2 (leave_after, make_fixnum (old_position), + make_fixnum (charpos)); if (! EQ (enter_before, leave_before) && !NILP (enter_before)) - call2 (enter_before, make_number (old_position), - make_number (charpos)); + call2 (enter_before, make_fixnum (old_position), + make_fixnum (charpos)); if (! EQ (enter_after, leave_after) && !NILP (enter_after)) - call2 (enter_after, make_number (old_position), - make_number (charpos)); + call2 (enter_after, make_fixnum (old_position), + make_fixnum (charpos)); } } @@ -2066,7 +2066,7 @@ move_if_not_intangible (ptrdiff_t position) skip back over all chars with matching intangible property. */ if (! NILP (intangible_propval)) while (XINT (pos) > BEGV - && EQ (Fget_char_property (make_number (XINT (pos) - 1), + && EQ (Fget_char_property (make_fixnum (XINT (pos) - 1), Qintangible, Qnil), intangible_propval)) pos = Fprevious_char_property_change (pos, Qnil); @@ -2075,7 +2075,7 @@ move_if_not_intangible (ptrdiff_t position) { /* We want to move backward, so check the text after POSITION. */ - intangible_propval = Fget_char_property (make_number (XINT (pos) - 1), + intangible_propval = Fget_char_property (make_fixnum (XINT (pos) - 1), Qintangible, Qnil); /* If following char is intangible, -- cgit v1.2.1 From fb24ce37d1bc258cfc3884d9828aa0602fa06e1d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 19 Jul 2018 22:03:34 -0700 Subject: Prefer NILP (x) to EQ (x, Qnil) This simplifies the code a bit, and also simplifies some potential future changes slightly (e.g., altering eq vs eql). * src/alloc.c (mark_object): * src/callint.c (fix_command): * src/chartab.c (Fchar_table_range, Fset_char_table_range): * src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE, xd_signature): * src/dired.c (Fsystem_users): * src/fileio.c (Fdo_auto_save): * src/fns.c (concat): * src/frame.c (get_frame_param, frame_inhibit_resize) (store_in_alist, store_frame_param, x_set_autoraise) (x_set_autolower, x_get_arg): * src/image.c (Fclear_image_cache): * src/intervals.c (intervals_equal): * src/intervals.h (DEFAULT_INTERVAL_P): * src/lread.c (substitute_object_recurse): * src/menu.c (digest_single_submenu) (find_and_call_menu_selection) (find_and_return_menu_selection): * src/nsfns.m (x_set_icon_name, Fx_create_frame): * src/nsmenu.m (ns_menu_show): * src/nsselect.m (ns_string_to_pasteboard_internal) (Fns_selection_exists_p, Fns_selection_owner_p): * src/process.c (Faccept_process_output) (wait_reading_process_output): * src/terminal.c (store_terminal_param): * src/textprop.c (verify_interval_modification): * src/xdisp.c (next_element_from_buffer): * src/xfaces.c (Finternal_set_lisp_face_attribute): * src/xfns.c (x_set_icon_type, Fx_synchronize): * src/xmenu.c (x_menu_show): * src/xselect.c (Fx_selection_owner_p) (Fx_selection_exists_p): * src/xwidget.c (xwidget_view_lookup): Prefer NILP (x) to EQ (x, Qnil). --- src/intervals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 4c624ea79c1..c3e137cc38c 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -197,7 +197,7 @@ intervals_equal (INTERVAL i0, INTERVAL i1) } /* i0 has something i1 doesn't. */ - if (EQ (i1_val, Qnil)) + if (NILP (i1_val)) return false; /* i0 and i1 both have sym, but it has different values in each. */ -- cgit v1.2.1 From d1ec3a0a8e4d7d56ebc1e4fa743130b9974ac6a8 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 7 Aug 2018 18:08:53 -0600 Subject: More macro renamings for bignum * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c, src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c, src/category.c, src/ccl.c, src/character.c, src/character.h, src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c, src/composite.c, src/composite.h, src/data.c, src/dbusbind.c, src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c, src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c, src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c, src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c, src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c, src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c, src/indent.c, src/insdel.c, src/intervals.c, src/json.c, src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c, src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c, src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c, src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h, src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c, src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM. --- src/intervals.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 90ec4bd0537..af27afea0dc 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1926,8 +1926,8 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos) if (! NILP (intangible_propval)) { - while (XINT (pos) > BEGV - && EQ (Fget_char_property (make_fixnum (XINT (pos) - 1), + while (XFIXNUM (pos) > BEGV + && EQ (Fget_char_property (make_fixnum (XFIXNUM (pos) - 1), Qintangible, Qnil), intangible_propval)) pos = Fprevious_char_property_change (pos, Qnil); @@ -1937,7 +1937,7 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos) property is `front-sticky', perturb it to be one character earlier -- this ensures that point can never move to the beginning of an invisible/intangible/front-sticky region. */ - charpos = adjust_for_invis_intang (XINT (pos), 0, -1, 0); + charpos = adjust_for_invis_intang (XFIXNUM (pos), 0, -1, 0); } } else @@ -1959,7 +1959,7 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos) if (! NILP (intangible_propval)) { - while (XINT (pos) < ZV + while (XFIXNUM (pos) < ZV && EQ (Fget_char_property (pos, Qintangible, Qnil), intangible_propval)) pos = Fnext_char_property_change (pos, Qnil); @@ -1969,7 +1969,7 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos) property is `rear-sticky', perturb it to be one character later -- this ensures that point can never move to the end of an invisible/intangible/rear-sticky region. */ - charpos = adjust_for_invis_intang (XINT (pos), -1, 1, 0); + charpos = adjust_for_invis_intang (XFIXNUM (pos), -1, 1, 0); } } @@ -2055,7 +2055,7 @@ move_if_not_intangible (ptrdiff_t position) if (! NILP (Vinhibit_point_motion_hooks)) /* If intangible is inhibited, always move point to POSITION. */ ; - else if (PT < position && XINT (pos) < ZV) + else if (PT < position && XFIXNUM (pos) < ZV) { /* We want to move forward, so check the text before POSITION. */ @@ -2065,23 +2065,23 @@ move_if_not_intangible (ptrdiff_t position) /* If following char is intangible, skip back over all chars with matching intangible property. */ if (! NILP (intangible_propval)) - while (XINT (pos) > BEGV - && EQ (Fget_char_property (make_fixnum (XINT (pos) - 1), + while (XFIXNUM (pos) > BEGV + && EQ (Fget_char_property (make_fixnum (XFIXNUM (pos) - 1), Qintangible, Qnil), intangible_propval)) pos = Fprevious_char_property_change (pos, Qnil); } - else if (XINT (pos) > BEGV) + else if (XFIXNUM (pos) > BEGV) { /* We want to move backward, so check the text after POSITION. */ - intangible_propval = Fget_char_property (make_fixnum (XINT (pos) - 1), + intangible_propval = Fget_char_property (make_fixnum (XFIXNUM (pos) - 1), Qintangible, Qnil); /* If following char is intangible, skip forward over all chars with matching intangible property. */ if (! NILP (intangible_propval)) - while (XINT (pos) < ZV + while (XFIXNUM (pos) < ZV && EQ (Fget_char_property (pos, Qintangible, Qnil), intangible_propval)) pos = Fnext_char_property_change (pos, Qnil); @@ -2096,7 +2096,7 @@ move_if_not_intangible (ptrdiff_t position) try moving to POSITION (which means we actually move farther if POSITION is inside of intangible text). */ - if (XINT (pos) != PT) + if (XFIXNUM (pos) != PT) SET_PT (position); } -- cgit v1.2.1 From 26bed8ba10eeaf0a340a8d0d760c5578dddec867 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 1 Jan 2019 00:59:58 +0000 Subject: Update copyright year to 2019 Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'. --- src/intervals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 4c624ea79c1..e7595b23b3a 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1,5 +1,5 @@ /* Code for doing intervals. - Copyright (C) 1993-1995, 1997-1998, 2001-2018 Free Software + Copyright (C) 1993-1995, 1997-1998, 2001-2019 Free Software Foundation, Inc. This file is part of GNU Emacs. -- cgit v1.2.1 From 31182c1d17f6f7bc946d5e4576e025c9b975e0b5 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Fri, 1 Mar 2019 17:35:12 +0000 Subject: Maintain interval ->position fields correctly in update_interval Also fix some anomalies in the handling of byte positions in regexp-emacs.c This fixes bug #34525. * src/intervals.c (SET_PARENT_POSITION): New macro. (update_interval): When moving to an interval's parent, set that parent's ->position field, to maintain the consistency of the tree. * src/intervals.h (struct interval): Amend the comment describing when ->position is valid. * src/pdumper.c: Update the hash associated with struct interval. * src/regex-emacs.c: (re_match_2_internal): Only invoke POINTER_TO_OFFSET on a known character boundary. Only perform arithmetic on character positions, not on byte positions. Correct the argument to an invocation of UPDATE_SYNTAX_TABLE_FORWARD by adding 1 to it (in case wordend:). * src/syntax.c: (update_syntax_table): Remove the now redundant code that set the ->position field of all parents of the interval found by update_interval. --- src/intervals.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 524bb944e51..8f39c45762f 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -713,11 +713,21 @@ previous_interval (register INTERVAL interval) return NULL; } -/* Find the interval containing POS given some non-NULL INTERVAL - in the same tree. Note that we need to update interval->position - if we go down the tree. - To speed up the process, we assume that the ->position of - I and all its parents is already uptodate. */ +/* Set the ->position field of I's parent, based on I->position. */ +#define SET_PARENT_POSITION(i) \ + if (AM_LEFT_CHILD (i)) \ + INTERVAL_PARENT (i)->position = \ + i->position + TOTAL_LENGTH (i) - LEFT_TOTAL_LENGTH (i); \ + else \ + INTERVAL_PARENT (i)->position = \ + i->position - LEFT_TOTAL_LENGTH (i) \ + - LENGTH (INTERVAL_PARENT (i)) + +/* Find the interval containing POS, given some non-NULL INTERVAL in + the same tree. Note that we update interval->position in each + interval we traverse, assuming it is already correctly set for the + argument I. We don't assume that any other interval already has a + correctly set ->position. */ INTERVAL update_interval (register INTERVAL i, ptrdiff_t pos) { @@ -738,7 +748,10 @@ update_interval (register INTERVAL i, ptrdiff_t pos) else if (NULL_PARENT (i)) error ("Point before start of properties"); else - i = INTERVAL_PARENT (i); + { + SET_PARENT_POSITION (i); + i = INTERVAL_PARENT (i); + } continue; } else if (pos >= INTERVAL_LAST_POS (i)) @@ -753,7 +766,10 @@ update_interval (register INTERVAL i, ptrdiff_t pos) else if (NULL_PARENT (i)) error ("Point %"pD"d after end of properties", pos); else - i = INTERVAL_PARENT (i); + { + SET_PARENT_POSITION (i); + i = INTERVAL_PARENT (i); + } continue; } else -- cgit v1.2.1 From 32cf07819ae8cfdbf14e00f351c7f520fff325c3 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 7 May 2019 13:41:54 -0400 Subject: * src/marker.c (buf_bytepos_to_charpos): Re-add the CHAR_HEAD_P assertion This assertion was removed in 1c349c62305d432abf0fa2b6e3f5d754fe4cab79 because the assumption was invalid during set_intervals_multibyte_1. So we change set_intervals_multibyte_1 to solve the problem in the same way as in the rest of Fset_buffer_multibyte, which actually simplifies the code. * src/buffer.c (advance_to_char_boundary): Not static any more. * src/buffer.h (advance_to_char_boundary): Add prototype. * src/intervals.c (set_intervals_multibyte_1): Use it. --- src/intervals.c | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 8f39c45762f..34829ab050d 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -2335,22 +2335,10 @@ set_intervals_multibyte_1 (INTERVAL i, bool multi_flag, if (multi_flag) { ptrdiff_t temp; - left_end_byte = start_byte + LEFT_TOTAL_LENGTH (i); + left_end_byte + = advance_to_char_boundary (start_byte + LEFT_TOTAL_LENGTH (i)); left_end = BYTE_TO_CHAR (left_end_byte); - - temp = CHAR_TO_BYTE (left_end); - - /* If LEFT_END_BYTE is in the middle of a character, - adjust it and LEFT_END to a char boundary. */ - if (left_end_byte > temp) - { - left_end_byte = temp; - } - if (left_end_byte < temp) - { - left_end--; - left_end_byte = CHAR_TO_BYTE (left_end); - } + eassert (CHAR_TO_BYTE (left_end) == left_end_byte); } else { @@ -2369,22 +2357,10 @@ set_intervals_multibyte_1 (INTERVAL i, bool multi_flag, { ptrdiff_t temp; - right_start_byte = end_byte - RIGHT_TOTAL_LENGTH (i); + right_start_byte + = advance_to_char_boundary (end_byte - RIGHT_TOTAL_LENGTH (i)); right_start = BYTE_TO_CHAR (right_start_byte); - - /* If RIGHT_START_BYTE is in the middle of a character, - adjust it and RIGHT_START to a char boundary. */ - temp = CHAR_TO_BYTE (right_start); - - if (right_start_byte < temp) - { - right_start_byte = temp; - } - if (right_start_byte > temp) - { - right_start++; - right_start_byte = CHAR_TO_BYTE (right_start); - } + eassert (CHAR_TO_BYTE (right_start) == right_start_byte); } else { -- cgit v1.2.1 From 504f8e551f88b5d58cf3d2dc3c12df273b6d972c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 7 May 2019 12:26:40 -0700 Subject: Pacify GCC 9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * src/intervals.c (set_intervals_multibyte_1): Omit unused temps. * src/xdisp.c (display_mode_element): Use !NILP instead of STRINGP. This convinces GCC we’re not dereferencing a possibly-null pointer, and should be a bit faster anyway. --- src/intervals.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 34829ab050d..38367460a52 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -2334,7 +2334,6 @@ set_intervals_multibyte_1 (INTERVAL i, bool multi_flag, if (multi_flag) { - ptrdiff_t temp; left_end_byte = advance_to_char_boundary (start_byte + LEFT_TOTAL_LENGTH (i)); left_end = BYTE_TO_CHAR (left_end_byte); @@ -2355,8 +2354,6 @@ set_intervals_multibyte_1 (INTERVAL i, bool multi_flag, if (multi_flag) { - ptrdiff_t temp; - right_start_byte = advance_to_char_boundary (end_byte - RIGHT_TOTAL_LENGTH (i)); right_start = BYTE_TO_CHAR (right_start_byte); -- cgit v1.2.1 From 365e01cc9f64ce6ca947ccfd8612d60763280a37 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 1 Jan 2020 00:19:43 +0000 Subject: Update copyright year to 2020 Run "TZ=UTC0 admin/update-copyright $(git ls-files)". --- src/intervals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 38367460a52..a66594ceea2 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1,5 +1,5 @@ /* Code for doing intervals. - Copyright (C) 1993-1995, 1997-1998, 2001-2019 Free Software + Copyright (C) 1993-1995, 1997-1998, 2001-2020 Free Software Foundation, Inc. This file is part of GNU Emacs. -- cgit v1.2.1 From dc3006cf1419e5b22c35fa36d79ba029d0482df1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 4 Mar 2020 13:48:26 -0800 Subject: Pacify GCC 9.2.1 20190927 -O3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original problem report by N. Jackson in: https://lists.gnu.org/r/emacs-devel/2020-03/msg00047.html I found some other warnings when I used gcc, and fixed them with this patch. * lib-src/etags.c: Include verify.h. (xnmalloc, xnrealloc): Tell the compiler that NITEMS is nononnegative and ITEM_SIZE is positive. * src/conf_post.h (__has_attribute_returns_nonnull) (ATTRIBUTE_RETURNS_NONNULL): New macros. * src/editfns.c (Fuser_full_name): Don’t assume Fuser_login_name returns non-nil. * src/intervals.c (rotate_right, rotate_left, update_interval): * src/intervals.h (LENGTH, LEFT_TOTAL_LENGTH, RIGHT_TOTAL_LENGTH): Use TOTAL_LENGTH0 or equivalent on intervals that might be null. * src/intervals.h (TOTAL_LENGTH): Assume arg is nonnull. (TOTAL_LENGTH0): New macro, with the old TOTAL_LENGTH meaning. (make_interval, split_interval_right): Add ATTRIBUTE_RETURNS_NONNULL. * src/pdumper.c (dump_check_dump_off): Now returns void, since no caller uses the return value. Redo assert to pacify GCC. (decode_emacs_reloc): Add a seemingly-random eassume to pacify GCC. Ugly, and I suspect due to a bug in GCC. --- src/intervals.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index a66594ceea2..594d8924ebc 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -298,7 +298,7 @@ rotate_right (INTERVAL A) set_interval_parent (c, A); /* A's total length is decreased by the length of B and its left child. */ - A->total_length -= B->total_length - TOTAL_LENGTH (c); + A->total_length -= TOTAL_LENGTH (B) - TOTAL_LENGTH0 (c); eassert (TOTAL_LENGTH (A) > 0); eassert (LENGTH (A) > 0); @@ -349,7 +349,7 @@ rotate_left (INTERVAL A) set_interval_parent (c, A); /* A's total length is decreased by the length of B and its right child. */ - A->total_length -= B->total_length - TOTAL_LENGTH (c); + A->total_length -= TOTAL_LENGTH (B) - TOTAL_LENGTH0 (c); eassert (TOTAL_LENGTH (A) > 0); eassert (LENGTH (A) > 0); @@ -723,13 +723,13 @@ previous_interval (register INTERVAL interval) i->position - LEFT_TOTAL_LENGTH (i) \ - LENGTH (INTERVAL_PARENT (i)) -/* Find the interval containing POS, given some non-NULL INTERVAL in +/* Find the interval containing POS, given some interval I in the same tree. Note that we update interval->position in each interval we traverse, assuming it is already correctly set for the argument I. We don't assume that any other interval already has a correctly set ->position. */ INTERVAL -update_interval (register INTERVAL i, ptrdiff_t pos) +update_interval (INTERVAL i, ptrdiff_t pos) { if (!i) return NULL; @@ -739,7 +739,7 @@ update_interval (register INTERVAL i, ptrdiff_t pos) if (pos < i->position) { /* Move left. */ - if (pos >= i->position - TOTAL_LENGTH (i->left)) + if (pos >= i->position - LEFT_TOTAL_LENGTH (i)) { i->left->position = i->position - TOTAL_LENGTH (i->left) + LEFT_TOTAL_LENGTH (i->left); @@ -757,7 +757,7 @@ update_interval (register INTERVAL i, ptrdiff_t pos) else if (pos >= INTERVAL_LAST_POS (i)) { /* Move right. */ - if (pos < INTERVAL_LAST_POS (i) + TOTAL_LENGTH (i->right)) + if (pos < INTERVAL_LAST_POS (i) + RIGHT_TOTAL_LENGTH (i)) { i->right->position = INTERVAL_LAST_POS (i) + LEFT_TOTAL_LENGTH (i->right); -- cgit v1.2.1 From d5750af151853f13bf3481876d487741eebe36b7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 9 Apr 2020 11:21:18 +0300 Subject: Avoid assertion violation in intervals.c * src/intervals.c (delete_interval): Allow negative values of LENGTH (i). This happens when delete_interval is called from set_intervals_multibyte_1, because the caller zeroes out the total_length field of the interval to be deleted. See https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg00131.html for more details. See also a related old discussion at https://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00399.html. --- src/intervals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index a66594ceea2..585ef18bd2e 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1187,7 +1187,7 @@ delete_interval (register INTERVAL i) register INTERVAL parent; ptrdiff_t amt = LENGTH (i); - eassert (amt == 0); /* Only used on zero-length intervals now. */ + eassert (amt <= 0); /* Only used on zero total-length intervals now. */ if (ROOT_INTERVAL_P (i)) { -- cgit v1.2.1 From 4645430b9287c3f5ae9863d465a5dd4158e313a9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 11 May 2020 17:41:16 -0700 Subject: Pacify GCC 10.1.0 Pacify GCC 10.1.0 so that it does not issue false alarms when Emacs is configured with --enable-gcc-warnings. * src/dispnew.c (clear_glyph_row): * src/fns.c (hash_clear): * src/keyboard.c (append_tab_bar_item): * src/lisp.h (vcopy): * src/xfaces.c (get_lface_attributes_no_remap) (Finternal_copy_lisp_face, realize_default_face): * src/xmenu.c (set_frame_menubar): Work around -Warray-bounds false alarm in GCC 10.1.0. * src/intervals.c (copy_properties): Avoid -Wnull-dereference false alarm in GCC 10.1.0. * src/lisp.h (xvector_contents_addr, xvector_contents): New functions, useful for working around GCC bug 95072. --- src/intervals.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index d4a734c923c..0257591a142 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -117,10 +117,11 @@ create_root_interval (Lisp_Object parent) /* Make the interval TARGET have exactly the properties of SOURCE. */ void -copy_properties (register INTERVAL source, register INTERVAL target) +copy_properties (INTERVAL source, INTERVAL target) { if (DEFAULT_INTERVAL_P (source) && DEFAULT_INTERVAL_P (target)) return; + eassume (source && target); COPY_INTERVAL_CACHE (source, target); set_interval_plist (target, Fcopy_sequence (source->plist)); -- cgit v1.2.1 From ba05d005e5a81bc123ad8da928b1bccb6b160e7a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 1 Jan 2021 01:13:56 -0800 Subject: Update copyright year to 2021 Run "TZ=UTC0 admin/update-copyright". --- src/intervals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 0257591a142..f88a41f2549 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1,5 +1,5 @@ /* Code for doing intervals. - Copyright (C) 1993-1995, 1997-1998, 2001-2020 Free Software + Copyright (C) 1993-1995, 1997-1998, 2001-2021 Free Software Foundation, Inc. This file is part of GNU Emacs. -- cgit v1.2.1 From 8227d1273e2b82dbed14c0cba06959083d377745 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 20 Oct 2021 14:16:07 +0200 Subject: Fix bug with string values in equal-including-properties * src/intervals.c (intervals_equal_1): Factor out from intervals_equal. Optionally use Fequal for comparison of string values in property lists. (intervals_equal): Update for the above. (compare_string_intervals): Use the above optional Fequal comparison to fix a bug where 'equal-including-properties' compared strings with eq, instead of equal. (Bug#6581) * test/src/fns-tests.el (fns-tests-equal-including-properties) (fns-tests-equal-including-properties/string-prop-vals): New tests. * test/lisp/emacs-lisp/ert-tests.el (ert-test-equal-including-properties): Remove parts testing 'equal-including-properties'. * lisp/emacs-lisp/ert.el (ert-equal-including-properties): Add FIXME that this should be removed. --- src/intervals.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index f88a41f2549..11d5b6bbb6f 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -166,10 +166,11 @@ merge_properties (register INTERVAL source, register INTERVAL target) } } -/* Return true if the two intervals have the same properties. */ +/* Return true if the two intervals have the same properties. + If use_equal is true, use Fequal for comparisons instead of EQ. */ -bool -intervals_equal (INTERVAL i0, INTERVAL i1) +static bool +intervals_equal_1 (INTERVAL i0, INTERVAL i1, bool use_equal) { Lisp_Object i0_cdr, i0_sym; Lisp_Object i1_cdr, i1_val; @@ -204,7 +205,8 @@ intervals_equal (INTERVAL i0, INTERVAL i1) /* i0 and i1 both have sym, but it has different values in each. */ if (!CONSP (i1_val) || (i1_val = XCDR (i1_val), !CONSP (i1_val)) - || !EQ (XCAR (i1_val), XCAR (i0_cdr))) + || use_equal ? NILP (Fequal (XCAR (i1_val), XCAR (i0_cdr))) + : !EQ (XCAR (i1_val), XCAR (i0_cdr))) return false; i0_cdr = XCDR (i0_cdr); @@ -218,6 +220,14 @@ intervals_equal (INTERVAL i0, INTERVAL i1) /* Lengths of the two plists were equal. */ return (NILP (i0_cdr) && NILP (i1_cdr)); } + +/* Return true if the two intervals have the same properties. */ + +bool +intervals_equal (INTERVAL i0, INTERVAL i1) +{ + return intervals_equal_1 (i0, i1, false); +} /* Traverse an interval tree TREE, performing FUNCTION on each node. @@ -2291,7 +2301,7 @@ compare_string_intervals (Lisp_Object s1, Lisp_Object s2) /* If we ever find a mismatch between the strings, they differ. */ - if (! intervals_equal (i1, i2)) + if (! intervals_equal_1 (i1, i2, true)) return 0; /* Advance POS till the end of the shorter interval, -- cgit v1.2.1 From 19dcb237b5b02b36580294ab309124f346a66024 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 1 Jan 2022 02:45:51 -0500 Subject: ; Add 2022 to copyright years. --- src/intervals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index f88a41f2549..189308e8e30 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1,5 +1,5 @@ /* Code for doing intervals. - Copyright (C) 1993-1995, 1997-1998, 2001-2021 Free Software + Copyright (C) 1993-1995, 1997-1998, 2001-2022 Free Software Foundation, Inc. This file is part of GNU Emacs. -- cgit v1.2.1 From a8245e122075175df2f124b20e9e5b1b583eff89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sat, 12 Feb 2022 16:05:17 +0100 Subject: Replace ptrdiff_t with new specpdl_ref type for specpdl references The specpdl_ref type is just an alias for ptrdiff_t; the compiled code remains the same. All operations on specpdl_ref (arithmetic, comparison etc) now go through inline functions. The bulk of the change is almost completely mechanical. It is done to prepare for a type-safe representation and subsequent performance improvement. * src/lisp.h (specpdl_ref, specpdl_count_to_ref, specpdl_ref_to_count) (specpdl_ref_eq, specpdl_ref_lt, specpdl_ref_valid_p) (make_invalid_specpdl_ref, specpdl_ref_add, specpdl_ref_to_ptr): New. (SPECPDL_INDEX, struct handler, USE_SAFE_ALLOCA, safe_free) (safe_free_unbind_to): * src/alloc.c (run_finalizer_function, inhibit_garbage_collection) (garbage_collect, Fgarbage_collect, which_symbols): * src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): * src/buffer.c (Fkill_buffer, Fset_buffer_major_mode, Fmove_overlay) (Fdelete_overlay): * src/bytecode.c (exec_byte_code): * src/callint.c (Ffuncall_interactively, Fcall_interactively): * src/callproc.c (Fcall_process, call_process, create_temp_file) (Fcall_process_region): * src/charset.c (load_charset_map_from_file): * src/coding.c (decode_coding_gap, decode_coding_object) (encode_coding_object, Fread_coding_system): * src/comp.c (emit_static_object, helper_unbind_n, load_comp_unit): * src/composite.c (update_compositions, autocmp_chars): * src/cygw32.c (conv_filename_to_w32_unicode) (conv_filename_from_w32_unicode): * src/data.c (notify_variable_watchers): * src/decompress.c (Fzlib_decompress_region): * src/dired.c (directory_files_internal, file_name_completion) (file_attributes): * src/dispnew.c (Fredisplay): * src/doc.c (get_doc_string, Fsnarf_documentation): * src/editfns.c (Fsave_excursion, Fsave_current_buffer) (Freplace_buffer_contents, Fsubst_char_in_region, Fsave_restriction) (styled_format): * src/emacs-module.c (Fmodule_load, funcall_module): * src/emacs.c (init_cmdargs, Fdump_emacs): * src/eval.c (call_debugger, do_debug_on_call, FletX, Flet) (Ffuncall_with_delayed_message, Funwind_protect) (internal_lisp_condition_case, signal_or_quit) (load_with_autoload_queue, Feval, grow_specpdl_allocation) (record_in_backtrace, eval_sub, Ffuncall, apply_lambda) (funcall_lambda, clear_unwind_protect, set_unwind_protect) (set_unwind_protect_ptr, unbind_to, Fbacktrace_eval): * src/fileio.c (Fmake_temp_file_internal, Fcopy_file, Frename_file) (Finsert_file_contents, write_region, Fdo_auto_save): * src/fns.c (Fyes_or_no_p, Frequire, hash_table_user_defined_call): * src/fringe.c (update_window_fringes): * src/gtkutil.c (xg_dialog_run): * src/haiku_io.c (c_specpdl_idx_from_cxx): * src/haiku_support.cc (be_popup_file_dialog): * src/haiku_support.h (c_specpdl_idx_from_cxx): * src/haikufns.c (haiku_create_frame, haiku_create_tip_frame) (haiku_hide_tip, Fx_show_tip, Fhaiku_read_file_name): * src/haikumenu.c (haiku_popup_dialog, set_frame_menubar): * src/image.c (slurp_file): * src/indent.c (line_number_display_width, Fvertical_motion): * src/insdel.c (signal_before_change, signal_after_change) (Fcombine_after_change_execute): * src/intervals.c (get_local_map): * src/json.c (lisp_to_json_nonscalar_1, Fjson_serialize, Fjson_insert) (Fjson_parse_string, Fjson_parse_buffer): * src/keyboard.c (recursive_edit_1, Frecursive_edit, cmd_error) (Finternal_track_mouse, command_loop_1, read_menu_command) (safe_run_hooks, read_event_from_main_queue, read_char, timer_check_2) (menu_item_eval_property, read_key_sequence, read_key_sequence_vs) (Fsuspend_emacs): * src/keymap.c (Fcurrent_active_maps, Fdescribe_vector) (Fhelp__describe_vector): * src/lread.c (Fload, save_match_data_load, readevalloop) (Feval_buffer, Feval_region, grow_read_buffer, read_integer, read1): * src/macros.c (Fexecute_kbd_macro): * src/menu.c (x_popup_menu_1): * src/minibuf.c (read_minibuf, set_minibuffer_mode) (read_minibuf_unwind, Fread_string, Fread_buffer): * src/nsfns.m (Fx_create_frame, Fx_show_tip): * src/nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog): * src/pdumper.c (Fdump_emacs_portable): * src/pgtkfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fpgtk_print_frames_dialog, Fx_file_dialog, Fx_select_font): * src/pgtkmenu.c (set_frame_menubar, create_and_show_popup_menu) (pgtk_menu_show, create_and_show_dialog, pgtk_dialog_show) (pgtk_popup_dialog): * src/pgtkterm.c (pgtk_cr_export_frames): * src/print.c (PRINTPREPARE, temp_output_buffer_setup) (Fprin1_to_string, print_vectorlike): * src/process.c (Fmake_process, create_process, Fmake_pipe_process) (Fmake_serial_process, connect_network_socket, Fmake_network_process) (network_interface_info, server_accept_connection) (wait_reading_process_output, read_process_output, exec_sentinel): * src/regex-emacs.c (re_match_2_internal): * src/search.c (looking_at_1, fast_looking_at, search_buffer_re): * src/sound.c (Fplay_sound_internal): * src/sysdep.c (system_process_attributes): * src/term.c (tty_menu_show): * src/textprop.c (Fnext_single_char_property_change) (Fprevious_single_char_property_change, add_text_properties_1) (set_text_properties, set_text_properties_1, Fremove_text_properties) (Fremove_list_of_text_properties): * src/thread.c (Fmutex_lock, invoke_thread_function): * src/undo.c (truncate_undo_list): * src/w32fns.c (Fx_create_frame, w32_create_tip_frame, w32_hide_tip) (Fx_show_tip, Fx_file_dialog): * src/w32font.c (Fx_select_font): * src/w32menu.c (set_frame_menubar): * src/window.c (window_list, next_window, window_list_1) (run_window_configuration_change_hook, Frun_window_scroll_functions) (run_window_change_functions, set_window_buffer) (temp_output_buffer_show, window_scroll, scroll_command) (Fscroll_other_window, Fscroll_other_window_down): * src/xdisp.c (safe__call, handle_fontified_prop, handle_face_prop) (handle_single_display_spec, Fbuffer_text_pixel_size) (message_dolog, with_echo_area_buffer, setup_echo_area_for_printing) (display_echo_area, set_message, clear_message, echo_area_display) (gui_consider_frame_title, prepare_menu_bars, update_menu_bar) (update_tab_bar, update_tool_bar, redisplay_internal) (redisplay_preserve_echo_area, run_window_scroll_functions) (redisplay_window, extend_face_to_end_of_line) (display_count_lines_logically, display_count_lines_visually) (display_mode_lines, display_mode_line, Fformat_mode_line) (decode_mode_spec): * src/xfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fx_file_dialog, Fx_select_font, Fx_print_frames_dialog): * src/xmenu.c (set_frame_menubar, create_and_show_popup_menu) (x_menu_show, create_and_show_dialog, x_dialog_show) (xw_popup_dialog): * src/xselect.c (x_get_local_selection, x_reply_selection_request) (x_handle_selection_request, wait_for_property_change): * src/xterm.c (x_cr_export_frames, x_connection_closed): Replace ptrdiff_t with specpdl_ref for referencing specpdl and use the corresponding functions instead of direct arithmetic. --- src/intervals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index ed374f16b53..687b237b9ea 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -2180,7 +2180,7 @@ get_local_map (ptrdiff_t position, struct buffer *buffer, Lisp_Object type) { Lisp_Object prop, lispy_position, lispy_buffer; ptrdiff_t old_begv, old_zv, old_begv_byte, old_zv_byte; - ptrdiff_t count = SPECPDL_INDEX (); + specpdl_ref count = SPECPDL_INDEX (); position = clip_to_bounds (BUF_BEGV (buffer), position, BUF_ZV (buffer)); -- cgit v1.2.1 From 0f731c49e6a8ccf3aa4c30c3f8ca82ed0a2cefb7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 12 May 2022 17:01:10 -0700 Subject: Pacify GCC 12 in default developer build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This lets ‘./configure; make’ work on Fedora 36 x86-64 from a Git checkout without generating false-alarm warnings. * lib-src/etags.c (main): There appeared to be false alarm with GCC 12. However, the code was wrong anyway, as it mishandled file names containing "'" so fix that bug. This pacifies GCC. (mercury_decl): Omit tests ‘s + pos != NULL’ that were apparently intended to be ‘s[pos] != '\0'’ but which were miscoded to always be true and which were mostly not needed anyway. In one place, though, a test was needed, so fix that by using strchr instead. * src/alloc.c (lisp_free) [!GC_MALLOC_CHECK]: * src/term.c (Fsuspend_tty): Don’t look at a pointer after freeing it, even just to test it for equality with some other pointer, as this has undefined behavior in C and GCC 12 diagnoses this. * src/dbusbind.c (xd_read_message_1): Rework the code a bit so that it has fewer tests. This pacifies GCC 12 which was complaining incorrectly about dereferencing a null pointer. * src/intervals.c (copy_properties): Remove an eassume that should no longer be needed even to pacify older GCCs, due to ... * src/intervals.h (split_interval_left): ... this addition of ATTRIBUTE_RETURNS_NONNULL to pacify a GCC 12 warning about dereferencing a null pointer. * src/regex-emacs.c (EXTEND_BUFFER): Use negative values rather than auxiliary booleans to indicate null pointers. This pacifies GCC 12 false alarms about using uninitialized variables. * src/xdisp.c (clear_position): New function. (append_space_for_newline, extend_face_to_end_of_line): Use it to work around false alarms from GCC 12. (display_and_set_cursor): Add an UNINIT to pacify GCC 12. * src/xterm.c (x_draw_glyphless_glyph_string_foreground): Defend against hypothetical bad code elsewhere; this also pacifies GCC 12. (x_term_init): Use fixed-size auto array rather than alloca, as the array is small; this also pacifies GCC 12. --- src/intervals.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 687b237b9ea..9e28637d6bc 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -121,7 +121,6 @@ copy_properties (INTERVAL source, INTERVAL target) { if (DEFAULT_INTERVAL_P (source) && DEFAULT_INTERVAL_P (target)) return; - eassume (source && target); COPY_INTERVAL_CACHE (source, target); set_interval_plist (target, Fcopy_sequence (source->plist)); -- cgit v1.2.1 From 513acdc9b4495c5273c55447c47d21534deffc7f Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 27 Jun 2022 12:22:05 +0200 Subject: Allow plist-get/plist-put/plist-member to take a comparison function * doc/lispref/lists.texi (Plist Access): Document it. * lisp/filesets.el (filesets-reset-fileset) (filesets-ingroup-cache-get): (filesets-ingroup-cache-put): (filesets-build-menu-now): Don't use lax-plist functions. * lisp/simple.el (lax-plist-put, lax-plist-get): Moved here from fns.c and make obsolete. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Don't mark plist functions as side-effect-free or pure. * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Adjust type. * lisp/emacs-lisp/shortdoc.el (list): Don't document deprecated functions. * src/xdisp.c (build_desired_tool_bar_string): (display_mode_element): (store_mode_line_string): (display_string): (produce_stretch_glyph): (note_mode_line_or_margin_highlight): (note_mouse_highlight): * src/w32.c (serial_configure): * src/sysdep.c (serial_configure): * src/sound.c (parse_sound): * src/process.c (Fset_process_buffer): (Fset_process_sentinel): (Fprocess_contact): (Fmake_process): (Fmake_pipe_process): (Fset_network_process_option): (Fserial_process_configure): (Fmake_serial_process): (set_network_socket_coding_system): (finish_after_tls_connection): (connect_network_socket): (Fmake_network_process): (server_accept_connection): * src/lread.c (ADDPARAM): (hash_table_from_plist): * src/keyboard.c (make_lispy_position): * src/indent.c (check_display_width): * src/image.c (postprocess_image): * src/gnutls.c (gnutls_verify_boot): (Fgnutls_boot): (gnutls_symmetric): (Fgnutls_hash_mac): (Fgnutls_hash_digest): * src/dired.c (filter): * src/data.c (add_to_function_history): * src/coding.c (Fcoding_system_put): Adjust callers from Fplist_put (etc) to plist_put. * src/fns.c (plist_get): (plist_put): (plist_member): New functions (without optional third parameter) to be used in C code. * src/fns.c (Fplist_get, Fplist_put, Fplist_member): Take an optional predicate parameter (bug#47425). * src/lisp.h: Declare new plist_put, plist_get and plist_member functions. * test/lisp/json-tests.el (test-json-add-to-plist): Use plist-get. * test/src/fns-tests.el (test-cycle-lax-plist-get): (test-cycle-lax-plist-put): (lax-plist-get/odd-number-of-elements): (test-plist): Remove lax-plist tests, since semantics have changed (they no longer error out on cycles). --- src/intervals.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 9e28637d6bc..85152c58a5d 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1737,11 +1737,11 @@ lookup_char_property (Lisp_Object plist, Lisp_Object prop, bool textprop) { tail = XCDR (tail); for (; NILP (fallback) && CONSP (tail); tail = XCDR (tail)) - fallback = Fplist_get (plist, XCAR (tail)); + fallback = plist_get (plist, XCAR (tail)); } if (textprop && NILP (fallback) && CONSP (Vdefault_text_properties)) - fallback = Fplist_get (Vdefault_text_properties, prop); + fallback = plist_get (Vdefault_text_properties, prop); return fallback; } -- cgit v1.2.1 From c200098ddeb090b7b95f482a269bbe2a7a40d09d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 18 Sep 2022 19:59:58 +0300 Subject: ; * src/intervals.c (get_local_map): Fix commentary. --- src/intervals.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/intervals.c') diff --git a/src/intervals.c b/src/intervals.c index 189308e8e30..c5b720470ba 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -2162,8 +2162,8 @@ get_property_and_range (ptrdiff_t pos, Lisp_Object prop, Lisp_Object *val, /* Return the proper local keymap TYPE for position POSITION in BUFFER; TYPE should be one of `keymap' or `local-map'. Use the map - specified by the PROP property, if any. Otherwise, if TYPE is - `local-map' use BUFFER's local map. */ + specified by the TYPE property, if any. Otherwise, if TYPE is + `local-map', use BUFFER's local map. */ Lisp_Object get_local_map (ptrdiff_t position, struct buffer *buffer, Lisp_Object type) -- cgit v1.2.1