commit 2028756fa3db8dc266c0abbf4ecb672ab5348e71 (HEAD, refs/remotes/origin/master) Author: Stefan Monnier Date: Fri Mar 1 16:04:11 2019 -0500 * src/syntax.c (update_syntax_table): Prefer 'else' to 'goto' diff --git a/src/syntax.c b/src/syntax.c index fe1e2d236b..32103c8657 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -309,7 +309,7 @@ SETUP_SYNTAX_TABLE_FOR_OBJECT (Lisp_Object object, } /* Update gl_state to an appropriate interval which contains CHARPOS. The - sign of COUNT give the relative position of CHARPOS wrt the previously + sign of COUNT gives the relative position of CHARPOS wrt the previously valid interval. If INIT, only [be]_property fields of gl_state are valid at start, the rest is filled basing on OBJECT. @@ -343,42 +343,43 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init, i = gl_state.forward_i; gl_state.b_property = i->position - gl_state.offset; gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset; - goto update; } - i = count > 0 ? gl_state.forward_i : gl_state.backward_i; - - /* We are guaranteed to be called with CHARPOS either in i, - or further off. */ - if (!i) - error ("Error in syntax_table logic for to-the-end intervals"); - else if (charpos < i->position) /* Move left. */ - { - if (count > 0) - error ("Error in syntax_table logic for intervals <-"); - /* Update the interval. */ - i = update_interval (i, charpos); - if (INTERVAL_LAST_POS (i) != gl_state.b_property) - { - invalidate = false; - gl_state.forward_i = i; - gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset; - } - } - else if (charpos >= INTERVAL_LAST_POS (i)) /* Move right. */ + else { - if (count < 0) - error ("Error in syntax_table logic for intervals ->"); - /* Update the interval. */ - i = update_interval (i, charpos); - if (i->position != gl_state.e_property) - { - invalidate = false; - gl_state.backward_i = i; - gl_state.b_property = i->position - gl_state.offset; - } + i = count > 0 ? gl_state.forward_i : gl_state.backward_i; + + /* We are guaranteed to be called with CHARPOS either in i, + or further off. */ + if (!i) + error ("Error in syntax_table logic for to-the-end intervals"); + else if (charpos < i->position) /* Move left. */ + { + if (count > 0) + error ("Error in syntax_table logic for intervals <-"); + /* Update the interval. */ + i = update_interval (i, charpos); + if (INTERVAL_LAST_POS (i) != gl_state.b_property) + { + invalidate = false; + gl_state.forward_i = i; + gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset; + } + } + else if (charpos >= INTERVAL_LAST_POS (i)) /* Move right. */ + { + if (count < 0) + error ("Error in syntax_table logic for intervals ->"); + /* Update the interval. */ + i = update_interval (i, charpos); + if (i->position != gl_state.e_property) + { + invalidate = false; + gl_state.backward_i = i; + gl_state.b_property = i->position - gl_state.offset; + } + } } - update: tmp_table = textget (i->plist, Qsyntax_table); if (invalidate) commit 0c834e9234a582933235080f6b98fe1c874d7dde Author: Stefan Monnier Date: Fri Mar 1 15:57:40 2019 -0500 * lisp/Makefile.in (leim): Fix void-function pinyin-convert diff --git a/lisp/Makefile.in b/lisp/Makefile.in index b6768791fb..1f251bdeb5 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -352,7 +352,9 @@ compile-clean: ## with ../src. See comments above for loaddefs. gen-lisp: leim semantic -leim: +# (re)compile titdic-cnv before recursing into `leim` since its used to +# generate some of the Quail source files from tables. +leim: $(lisp)/international/titdic-cnv.elc $(MAKE) -C ../leim all EMACS="$(EMACS)" semantic: commit 31182c1d17f6f7bc946d5e4576e025c9b975e0b5 Author: Alan Mackenzie Date: Fri Mar 1 17:35:12 2019 +0000 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. diff --git a/src/intervals.c b/src/intervals.c index 524bb944e5..8f39c45762 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 diff --git a/src/intervals.h b/src/intervals.h index 9c5adf33a1..e9166946d9 100644 --- a/src/intervals.h +++ b/src/intervals.h @@ -31,11 +31,15 @@ struct interval /* The first group of entries deal with the tree structure. */ ptrdiff_t total_length; /* Length of myself and both children. */ ptrdiff_t position; /* Cache of interval's character position. */ - /* This field is usually updated - simultaneously with an interval - traversal, there is no guarantee - that it is valid for a random - interval. */ + /* This field is valid in the final + target interval returned by + find_interval, next_interval, + previous_interval and + update_interval. It cannot be + depended upon in any intermediate + intervals traversed by these + functions, or any other + interval. */ struct interval *left; /* Intervals which precede me. */ struct interval *right; /* Intervals which succeed me. */ diff --git a/src/pdumper.c b/src/pdumper.c index 4d35fd1233..bba43370a1 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2064,7 +2064,7 @@ dump_interval_tree (struct dump_context *ctx, INTERVAL tree, dump_off parent_offset) { -#if CHECK_STRUCTS && !defined (HASH_interval_9110163DA0) +#if CHECK_STRUCTS && !defined (HASH_interval_1B38941C37) # error "interval changed. See CHECK_STRUCTS comment." #endif // TODO: output tree breadth-first? diff --git a/src/regex-emacs.c b/src/regex-emacs.c index b667a43a37..45b4f8107c 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -4732,8 +4732,8 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, int c1, c2; int s1, s2; int dummy; - ptrdiff_t offset = PTR_TO_OFFSET (d - 1); - ptrdiff_t charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset); + ptrdiff_t offset = PTR_TO_OFFSET (d); + ptrdiff_t charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset) - 1; UPDATE_SYNTAX_TABLE (charpos); GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); s1 = SYNTAX (c1); @@ -4811,8 +4811,8 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, int c1, c2; int s1, s2; int dummy; - ptrdiff_t offset = PTR_TO_OFFSET (d) - 1; - ptrdiff_t charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset); + ptrdiff_t offset = PTR_TO_OFFSET (d); + ptrdiff_t charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset) - 1; UPDATE_SYNTAX_TABLE (charpos); GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); s1 = SYNTAX (c1); @@ -4826,7 +4826,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, { PREFETCH_NOLIMIT (); GET_CHAR_AFTER (c2, d, dummy); - UPDATE_SYNTAX_TABLE_FORWARD (charpos); + UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1); s2 = SYNTAX (c2); /* ... and S2 is Sword, and WORD_BOUNDARY_P (C1, C2) @@ -4890,8 +4890,8 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, is the character at D, and S2 is the syntax of C2. */ int c1, c2; int s1, s2; - ptrdiff_t offset = PTR_TO_OFFSET (d) - 1; - ptrdiff_t charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset); + ptrdiff_t offset = PTR_TO_OFFSET (d); + ptrdiff_t charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset) - 1; UPDATE_SYNTAX_TABLE (charpos); GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); s1 = SYNTAX (c1); diff --git a/src/syntax.c b/src/syntax.c index dd2f56f2cf..fe1e2d236b 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -340,20 +340,6 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init, invalidate = false; if (!i) return; - /* interval_of updates only ->position of the return value, so - update the parents manually to speed up update_interval. */ - while (!NULL_PARENT (i)) - { - if (AM_RIGHT_CHILD (i)) - INTERVAL_PARENT (i)->position = i->position - - LEFT_TOTAL_LENGTH (i) + TOTAL_LENGTH (i) /* right end */ - - TOTAL_LENGTH (INTERVAL_PARENT (i)) - + LEFT_TOTAL_LENGTH (INTERVAL_PARENT (i)); - else - INTERVAL_PARENT (i)->position = i->position - LEFT_TOTAL_LENGTH (i) - + TOTAL_LENGTH (i); - i = INTERVAL_PARENT (i); - } i = gl_state.forward_i; gl_state.b_property = i->position - gl_state.offset; gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset; commit 287f2a676405009a6927fe7c33e36299a86b2827 Merge: cf563dac1f 5ec7ca14d9 Author: Glenn Morris Date: Fri Mar 1 09:40:22 2019 -0800 ; Merge from origin/emacs-26 The following commit was skipped: 5ec7ca1 (origin/emacs-26) ; Auto-commit of loaddefs files. commit cf563dac1f4792b913ddf75f6c4323cab0def484 Merge: b628699ad5 9df1365f38 Author: Glenn Morris Date: Fri Mar 1 09:40:22 2019 -0800 Merge from origin/emacs-26 9df1365 Fix a typo in the Calc manual f3dab02 Minor improvement in cross-references of the ELisp manual 560c84b Fix last change on 'compilation-parse-errors' commit b628699ad5ebda602a220a70b064b2a9e16c8bba Merge: 3c1407cedf 1dff097393 Author: Glenn Morris Date: Fri Mar 1 09:40:22 2019 -0800 ; Merge from origin/emacs-26 The following commit was skipped: 1dff097 Backport: js--re-search-backward-inner: Fix infloop commit 3c1407cedf9787605cf6c8ea6071bc97acb169b4 Merge: 7e29eae023 dee3cdc504 Author: Glenn Morris Date: Fri Mar 1 09:40:22 2019 -0800 Merge from origin/emacs-26 dee3cdc Minor improvement for docs of completion c86d419 ; * src/image.c (imagemagick_load, svg_load): Fix typos in co... 6d46fa9 Disable the timerfd interface on Cygwin 3707ea4 Fix a typo in the doc string of 'regex-opt' d9905d5 Document bash 5.0.0 misbehavior in tramp.texi (Bug#34192) # Conflicts: # doc/misc/tramp.texi commit 7e29eae023c8158d41eba02c2367e70cbee53642 Author: Paul Eggert Date: Fri Mar 1 09:01:59 2019 -0800 Suppress GC stats when obviously not needed This should help future improvements where these stats can be bignums that do not fit into intmax_t. * src/alloc.c (struct gcstat, gcstat): New type and static var, to package up GC statistics into one C object. It replaces ... (total_free_intervals, total_intervals, total_strings) (total_free_strings, total_string_bytes, total_vectors) (total_vector_slots, total_free_vector_slots): ... these removed static vars. All uses changed. (garbage_collect_1): Accept a struct gcstat *, not a void * which was not used anymore anyway. Return a bool indicating success, instead of a Lisp object. All callers changed. (garbage_collect): New function. All C callers of Fgarbage_collect changed to use it, since none of them use the return value. Now, only Lisp code uses Fgarbage_collect. (Fgarbage_collect): No longer noinline. Cons up the return value here, not in garbage_collect_1. diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 05a08473c3..ccd245e013 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -1107,6 +1107,9 @@ scan_c_stream (FILE *infile) g->flags |= DEFUN_noreturn; if (strstr (input_buffer, "const")) g->flags |= DEFUN_const; + + /* Although the noinline attribute is no longer used, + leave its support in, in case it's needed later. */ if (strstr (input_buffer, "noinline")) g->flags |= DEFUN_noinline; } diff --git a/src/alloc.c b/src/alloc.c index a0d0a61134..7d63e3c79b 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -253,9 +253,17 @@ typedef intptr_t object_ct; /* Number of live and free conses etc. */ -static object_ct total_conses, total_symbols, total_buffers; -static object_ct total_free_conses, total_free_symbols; -static object_ct total_free_floats, total_floats; +struct gcstat +{ + object_ct total_conses, total_free_conses; + object_ct total_symbols, total_free_symbols; + object_ct total_strings, total_free_strings; + byte_ct total_string_bytes; + object_ct total_vectors, total_vector_slots, total_free_vector_slots; + object_ct total_floats, total_free_floats; + object_ct total_intervals, total_free_intervals; + object_ct total_buffers; +} gcstat; /* Points to memory space allocated as "spare", to be freed if we run out of memory. We keep one large block, four cons-blocks, and @@ -1538,10 +1546,6 @@ static struct interval_block *interval_block; static int interval_block_index = INTERVAL_BLOCK_SIZE; -/* Number of free and live intervals. */ - -static object_ct total_free_intervals, total_intervals; - /* List of free intervals. */ static INTERVAL interval_free_list; @@ -1570,7 +1574,7 @@ make_interval (void) newi->next = interval_block; interval_block = newi; interval_block_index = 0; - total_free_intervals += INTERVAL_BLOCK_SIZE; + gcstat.total_free_intervals += INTERVAL_BLOCK_SIZE; } val = &interval_block->intervals[interval_block_index++]; } @@ -1579,7 +1583,7 @@ make_interval (void) consing_since_gc += sizeof (struct interval); intervals_consed++; - total_free_intervals--; + gcstat.total_free_intervals--; RESET_INTERVAL (val); val->gcmarkbit = 0; return val; @@ -1755,14 +1759,6 @@ static struct string_block *string_blocks; static struct Lisp_String *string_free_list; -/* Number of live and free Lisp_Strings. */ - -static object_ct total_strings, total_free_strings; - -/* Number of bytes used by live strings. */ - -static byte_ct total_string_bytes; - /* Given a pointer to a Lisp_String S which is on the free-list string_free_list, return a pointer to its successor in the free-list. */ @@ -1972,7 +1968,7 @@ allocate_string (void) string_free_list = ptr_bounds_clip (s, sizeof *s); } - total_free_strings += STRING_BLOCK_SIZE; + gcstat.total_free_strings += STRING_BLOCK_SIZE; } check_string_free_list (); @@ -1983,8 +1979,8 @@ allocate_string (void) MALLOC_UNBLOCK_INPUT; - --total_free_strings; - ++total_strings; + gcstat.total_free_strings--; + gcstat.total_strings++; ++strings_consed; consing_since_gc += sizeof *s; @@ -2119,8 +2115,8 @@ sweep_strings (void) struct string_block *live_blocks = NULL; string_free_list = NULL; - total_strings = total_free_strings = 0; - total_string_bytes = 0; + gcstat.total_strings = gcstat.total_free_strings = 0; + gcstat.total_string_bytes = 0; /* Scan strings_blocks, free Lisp_Strings that aren't marked. */ for (b = string_blocks; b; b = next) @@ -2145,8 +2141,8 @@ sweep_strings (void) /* Do not use string_(set|get)_intervals here. */ s->u.s.intervals = balance_intervals (s->u.s.intervals); - ++total_strings; - total_string_bytes += STRING_BYTES (s); + gcstat.total_strings++; + gcstat.total_string_bytes += STRING_BYTES (s); } else { @@ -2186,14 +2182,14 @@ sweep_strings (void) /* Free blocks that contain free Lisp_Strings only, except the first two of them. */ if (nfree == STRING_BLOCK_SIZE - && total_free_strings > STRING_BLOCK_SIZE) + && gcstat.total_free_strings > STRING_BLOCK_SIZE) { lisp_free (b); string_free_list = free_list_before; } else { - total_free_strings += nfree; + gcstat.total_free_strings += nfree; b->next = live_blocks; live_blocks = b; } @@ -2701,7 +2697,7 @@ make_float (double float_value) memset (new->gcmarkbits, 0, sizeof new->gcmarkbits); float_block = new; float_block_index = 0; - total_free_floats += FLOAT_BLOCK_SIZE; + gcstat.total_free_floats += FLOAT_BLOCK_SIZE; } XSETFLOAT (val, &float_block->floats[float_block_index]); float_block_index++; @@ -2713,7 +2709,7 @@ make_float (double float_value) eassert (!XFLOAT_MARKED_P (XFLOAT (val))); consing_since_gc += sizeof (struct Lisp_Float); floats_consed++; - total_free_floats--; + gcstat.total_free_floats--; return val; } @@ -2779,7 +2775,7 @@ free_cons (struct Lisp_Cons *ptr) ptr->u.s.car = Vdead; cons_free_list = ptr; consing_since_gc -= sizeof *ptr; - total_free_conses++; + gcstat.total_free_conses++; } DEFUN ("cons", Fcons, Scons, 2, 2, 0, @@ -2809,7 +2805,7 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, distinct conses might not fit. */ if (max_conses < INTPTR_MAX / sizeof (struct Lisp_Cons) && (max_conses - CONS_BLOCK_SIZE - < total_free_conses + total_conses)) + < gcstat.total_free_conses + gcstat.total_conses)) memory_full (sizeof (struct cons_block)); struct cons_block *new @@ -2818,7 +2814,7 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, new->next = cons_block; cons_block = new; cons_block_index = 0; - total_free_conses += CONS_BLOCK_SIZE; + gcstat.total_free_conses += CONS_BLOCK_SIZE; } XSETCONS (val, &cons_block->conses[cons_block_index]); cons_block_index++; @@ -2830,7 +2826,7 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, XSETCDR (val, cdr); eassert (!XCONS_MARKED_P (XCONS (val))); consing_since_gc += sizeof (struct Lisp_Cons); - total_free_conses--; + gcstat.total_free_conses--; cons_cells_consed++; return val; } @@ -3080,14 +3076,6 @@ static struct large_vector *large_vectors; Lisp_Object zero_vector; -/* Number of live vectors. */ - -static object_ct total_vectors; - -/* Total size of live and free vectors, in Lisp_Object units. */ - -static object_ct total_vector_slots, total_free_vector_slots; - /* Common shortcut to setup vector on a free list. */ static void @@ -3102,7 +3090,7 @@ setup_on_free_list (struct Lisp_Vector *v, ptrdiff_t nbytes) eassert (vindex < VECTOR_MAX_FREE_LIST_INDEX); set_next_vector (v, vector_free_lists[vindex]); vector_free_lists[vindex] = v; - total_free_vector_slots += nbytes / word_size; + gcstat.total_free_vector_slots += nbytes / word_size; } /* Get a new vector block. */ @@ -3150,7 +3138,7 @@ allocate_vector_from_block (ptrdiff_t nbytes) { vector = vector_free_lists[index]; vector_free_lists[index] = next_vector (vector); - total_free_vector_slots -= nbytes / word_size; + gcstat.total_free_vector_slots -= nbytes / word_size; return vector; } @@ -3164,7 +3152,7 @@ allocate_vector_from_block (ptrdiff_t nbytes) /* This vector is larger than requested. */ vector = vector_free_lists[index]; vector_free_lists[index] = next_vector (vector); - total_free_vector_slots -= nbytes / word_size; + gcstat.total_free_vector_slots -= nbytes / word_size; /* Excess bytes are used for the smaller vector, which should be set on an appropriate free list. */ @@ -3295,7 +3283,8 @@ sweep_vectors (void) struct large_vector *lv, **lvprev = &large_vectors; struct Lisp_Vector *vector, *next; - total_vectors = total_vector_slots = total_free_vector_slots = 0; + gcstat.total_vectors = 0; + gcstat.total_vector_slots = gcstat.total_free_vector_slots = 0; memset (vector_free_lists, 0, sizeof (vector_free_lists)); /* Looking through vector blocks. */ @@ -3310,9 +3299,9 @@ sweep_vectors (void) if (XVECTOR_MARKED_P (vector)) { XUNMARK_VECTOR (vector); - total_vectors++; + gcstat.total_vectors++; ptrdiff_t nbytes = vector_nbytes (vector); - total_vector_slots += nbytes / word_size; + gcstat.total_vector_slots += nbytes / word_size; next = ADVANCE (vector, nbytes); } else @@ -3364,12 +3353,11 @@ sweep_vectors (void) if (XVECTOR_MARKED_P (vector)) { XUNMARK_VECTOR (vector); - total_vectors++; - if (vector->header.size & PSEUDOVECTOR_FLAG) - total_vector_slots += vector_nbytes (vector) / word_size; - else - total_vector_slots - += header_size / word_size + vector->header.size; + gcstat.total_vectors++; + gcstat.total_vector_slots + += (vector->header.size & PSEUDOVECTOR_FLAG + ? vector_nbytes (vector) / word_size + : header_size / word_size + vector->header.size); lvprev = &lv->next; } else @@ -3703,7 +3691,7 @@ Its value is void, and its function definition and property list are nil. */) new->next = symbol_block; symbol_block = new; symbol_block_index = 0; - total_free_symbols += SYMBOL_BLOCK_SIZE; + gcstat.total_free_symbols += SYMBOL_BLOCK_SIZE; } XSETSYMBOL (val, &symbol_block->symbols[symbol_block_index]); symbol_block_index++; @@ -3714,7 +3702,7 @@ Its value is void, and its function definition and property list are nil. */) init_symbol (val, name); consing_since_gc += sizeof (struct Lisp_Symbol); symbols_consed++; - total_free_symbols--; + gcstat.total_free_symbols--; return val; } @@ -4976,7 +4964,7 @@ mark_memory (void *start, void *end) { Lisp_Object obj = build_string ("test"); struct Lisp_String *s = XSTRING (obj); - Fgarbage_collect (); + garbage_collect (); fprintf (stderr, "test '%s'\n", s->u.s.data); return Qnil; } @@ -5774,13 +5762,13 @@ static byte_ct total_bytes_of_live_objects (void) { byte_ct tot = 0; - tot += object_bytes (total_conses, sizeof (struct Lisp_Cons)); - tot += object_bytes (total_symbols, sizeof (struct Lisp_Symbol)); - tot += total_string_bytes; - tot += object_bytes (total_vector_slots, word_size); - tot += object_bytes (total_floats, sizeof (struct Lisp_Float)); - tot += object_bytes (total_intervals, sizeof (struct interval)); - tot += object_bytes (total_strings, sizeof (struct Lisp_String)); + tot += object_bytes (gcstat.total_conses, sizeof (struct Lisp_Cons)); + tot += object_bytes (gcstat.total_symbols, sizeof (struct Lisp_Symbol)); + tot += gcstat.total_string_bytes; + tot += object_bytes (gcstat.total_vector_slots, word_size); + tot += object_bytes (gcstat.total_floats, sizeof (struct Lisp_Float)); + tot += object_bytes (gcstat.total_intervals, sizeof (struct interval)); + tot += object_bytes (gcstat.total_strings, sizeof (struct Lisp_String)); return tot; } @@ -6029,22 +6017,15 @@ mark_and_sweep_weak_table_contents (void) } } -/* Subroutine of Fgarbage_collect that does most of the work. It is a - separate function so that we could limit mark_stack in searching - the stack frames below this function, thus avoiding the rare cases - where mark_stack finds values that look like live Lisp objects on - portions of stack that couldn't possibly contain such live objects. - For more details of this, see the discussion at - https://lists.gnu.org/r/emacs-devel/2014-05/msg00270.html. */ -static Lisp_Object -garbage_collect_1 (void *end) +/* Subroutine of Fgarbage_collect that does most of the work. */ +static bool +garbage_collect_1 (struct gcstat *gcst) { struct buffer *nextb; char stack_top_variable; bool message_p; ptrdiff_t count = SPECPDL_INDEX (); struct timespec start; - Lisp_Object retval = Qnil; byte_ct tot_before = 0; eassert (weak_hash_tables == NULL); @@ -6052,7 +6033,7 @@ garbage_collect_1 (void *end) /* Can't GC if pure storage overflowed because we can't determine if something is a pure object or not. */ if (pure_bytes_used_before_overflow) - return Qnil; + return false; /* Record this function, so it appears on the profiler's backtraces. */ record_in_backtrace (QAutomatic_GC, 0, 0); @@ -6215,40 +6196,7 @@ garbage_collect_1 (void *end) unbind_to (count, Qnil); - Lisp_Object total[] = { - list4 (Qconses, make_fixnum (sizeof (struct Lisp_Cons)), - make_int (total_conses), - make_int (total_free_conses)), - list4 (Qsymbols, make_fixnum (sizeof (struct Lisp_Symbol)), - make_int (total_symbols), - make_int (total_free_symbols)), - list4 (Qstrings, make_fixnum (sizeof (struct Lisp_String)), - make_int (total_strings), - make_int (total_free_strings)), - list3 (Qstring_bytes, make_fixnum (1), - make_int (total_string_bytes)), - list3 (Qvectors, - make_fixnum (header_size + sizeof (Lisp_Object)), - make_int (total_vectors)), - list4 (Qvector_slots, make_fixnum (word_size), - make_int (total_vector_slots), - make_int (total_free_vector_slots)), - list4 (Qfloats, make_fixnum (sizeof (struct Lisp_Float)), - make_int (total_floats), - make_int (total_free_floats)), - list4 (Qintervals, make_fixnum (sizeof (struct interval)), - make_int (total_intervals), - make_int (total_free_intervals)), - list3 (Qbuffers, make_fixnum (sizeof (struct buffer)), - make_int (total_buffers)), - -#ifdef DOUG_LEA_MALLOC - list4 (Qheap, make_fixnum (1024), - make_int ((mallinfo ().uordblks + 1023) >> 10), - make_int ((mallinfo ().fordblks + 1023) >> 10)), -#endif - }; - retval = CALLMANY (Flist, total); + *gcst = gcstat; /* GC is complete: now we can run our finalizer callbacks. */ run_finalizers (&doomed_finalizers); @@ -6278,7 +6226,14 @@ garbage_collect_1 (void *end) malloc_probe (min (swept, SIZE_MAX)); } - return retval; + return true; +} + +void +garbage_collect (void) +{ + struct gcstat gcst; + garbage_collect_1 (&gcst); } DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", @@ -6295,13 +6250,47 @@ where each entry has the form (NAME SIZE USED FREE), where: to return them to the OS). However, if there was overflow in pure space, `garbage-collect' returns nil, because real GC can't be done. -See Info node `(elisp)Garbage Collection'. */ - attributes: noinline) +See Info node `(elisp)Garbage Collection'. */) (void) { - void *end; - SET_STACK_TOP_ADDRESS (&end); - return garbage_collect_1 (end); + struct gcstat gcst; + if (!garbage_collect_1 (&gcst)) + return Qnil; + + Lisp_Object total[] = { + list4 (Qconses, make_fixnum (sizeof (struct Lisp_Cons)), + make_int (gcst.total_conses), + make_int (gcst.total_free_conses)), + list4 (Qsymbols, make_fixnum (sizeof (struct Lisp_Symbol)), + make_int (gcst.total_symbols), + make_int (gcst.total_free_symbols)), + list4 (Qstrings, make_fixnum (sizeof (struct Lisp_String)), + make_int (gcst.total_strings), + make_int (gcst.total_free_strings)), + list3 (Qstring_bytes, make_fixnum (1), + make_int (gcst.total_string_bytes)), + list3 (Qvectors, + make_fixnum (header_size + sizeof (Lisp_Object)), + make_int (gcst.total_vectors)), + list4 (Qvector_slots, make_fixnum (word_size), + make_int (gcst.total_vector_slots), + make_int (gcst.total_free_vector_slots)), + list4 (Qfloats, make_fixnum (sizeof (struct Lisp_Float)), + make_int (gcst.total_floats), + make_int (gcst.total_free_floats)), + list4 (Qintervals, make_fixnum (sizeof (struct interval)), + make_int (gcst.total_intervals), + make_int (gcst.total_free_intervals)), + list3 (Qbuffers, make_fixnum (sizeof (struct buffer)), + make_int (gcst.total_buffers)), + +#ifdef DOUG_LEA_MALLOC + list4 (Qheap, make_fixnum (1024), + make_int ((mallinfo ().uordblks + 1023) >> 10), + make_int ((mallinfo ().fordblks + 1023) >> 10)), +#endif + }; + return CALLMANY (Flist, total); } /* Mark Lisp objects in glyph matrix MATRIX. Currently the @@ -7003,8 +6992,8 @@ sweep_conses (void) cprev = &cblk->next; } } - total_conses = num_used; - total_free_conses = num_free; + gcstat.total_conses = num_used; + gcstat.total_free_conses = num_free; } NO_INLINE /* For better stack traces */ @@ -7052,8 +7041,8 @@ sweep_floats (void) fprev = &fblk->next; } } - total_floats = num_used; - total_free_floats = num_free; + gcstat.total_floats = num_used; + gcstat.total_free_floats = num_free; } NO_INLINE /* For better stack traces */ @@ -7101,8 +7090,8 @@ sweep_intervals (void) iprev = &iblk->next; } } - total_intervals = num_used; - total_free_intervals = num_free; + gcstat.total_intervals = num_used; + gcstat.total_free_intervals = num_free; } NO_INLINE /* For better stack traces */ @@ -7170,8 +7159,8 @@ sweep_symbols (void) sprev = &sblk->next; } } - total_symbols = num_used; - total_free_symbols = num_free; + gcstat.total_symbols = num_used; + gcstat.total_free_symbols = num_free; } /* Remove BUFFER's markers that are due to be swept. This is needed since @@ -7195,9 +7184,9 @@ NO_INLINE /* For better stack traces */ static void sweep_buffers (void) { - register struct buffer *buffer, **bprev = &all_buffers; + struct buffer *buffer, **bprev = &all_buffers; - total_buffers = 0; + gcstat.total_buffers = 0; for (buffer = all_buffers; buffer; buffer = *bprev) if (!vectorlike_marked_p (&buffer->header)) { @@ -7211,7 +7200,7 @@ sweep_buffers (void) /* Do not use buffer_(set|get)_intervals here. */ buffer->text->intervals = balance_intervals (buffer->text->intervals); unchain_dead_markers (buffer); - total_buffers++; + gcstat.total_buffers++; bprev = &buffer->next; } } diff --git a/src/lisp.h b/src/lisp.h index 388cd04163..32576930b2 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3763,6 +3763,7 @@ extern void alloc_unexec_post (void); extern void mark_maybe_objects (Lisp_Object *, ptrdiff_t); extern void mark_stack (char *, char *); extern void flush_stack_call_func (void (*func) (void *arg), void *arg); +extern void garbage_collect (void); extern const char *pending_malloc_warning; extern Lisp_Object zero_vector; typedef uintptr_t byte_ct; /* System byte counts reported by GC. */ @@ -5003,7 +5004,7 @@ maybe_gc (void) && consing_since_gc > gc_relative_threshold) || (!NILP (Vmemory_full) && consing_since_gc > memory_full_cons_threshold)) - Fgarbage_collect (); + garbage_collect (); } INLINE_HEADER_END diff --git a/src/pdumper.c b/src/pdumper.c index 724ea7be6d..4d35fd1233 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -4055,7 +4055,7 @@ types. */) /* Clear out any detritus in memory. */ do { number_finalizers_run = 0; - Fgarbage_collect (); + garbage_collect (); } while (number_finalizers_run); ptrdiff_t count = SPECPDL_INDEX (); commit fb52d961a40d889d87628058be6ea8116ced2e13 Author: Glenn Morris Date: Fri Mar 1 07:31:58 2019 -0500 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index dfaaa71b71..cd2b2be340 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -11926,7 +11926,10 @@ Fetch URL and render the page. If the input doesn't look like an URL or a domain name, the word(s) will be searched for via `eww-search-prefix'. -\(fn URL)" t nil) +If called with a prefix ARG, use a new buffer instead of reusing +the default EWW buffer. + +\(fn URL &optional ARG)" t nil) (defalias 'browse-web 'eww) (autoload 'eww-open-file "eww" "\ @@ -12516,6 +12519,41 @@ the name is considered already unique; only the second substitution ;;;*** +;;;### (autoloads nil "fileloop" "fileloop.el" (0 0 0 0)) +;;; Generated autoloads from fileloop.el + +(autoload 'fileloop-initialize "fileloop" "\ +Initialize a new round of operation on several files. +FILES can be either a list of file names, or an iterator (used with `iter-next') +which returns a file name at each step. +SCAN-FUNCTION is a function called with no argument inside a buffer +and it should return non-nil if that buffer has something on which to operate. +OPERATE-FUNCTION is a function called with no argument; it is expected +to perform the operation on the current file buffer and when done +should return non-nil to mean that we should immediately continue +operating on the next file and nil otherwise. + +\(fn FILES SCAN-FUNCTION OPERATE-FUNCTION)" nil nil) + +(autoload 'fileloop-initialize-search "fileloop" "\ + + +\(fn REGEXP FILES CASE-FOLD)" nil nil) + +(autoload 'fileloop-initialize-replace "fileloop" "\ +Initialize a new round of query&replace on several files. +FROM is a regexp and TO is the replacement to use. +FILES describes the file, as in `fileloop-initialize'. +CASE-FOLD can be t, nil, or `default', the latter one meaning to obey +the default setting of `case-fold-search'. +DELIMITED if non-nil means replace only word-delimited matches. + +\(fn FROM TO FILES CASE-FOLD &optional DELIMITED)" nil nil) + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "fileloop" '("fileloop-"))) + +;;;*** + ;;;### (autoloads nil "filenotify" "filenotify.el" (0 0 0 0)) ;;; Generated autoloads from filenotify.el @@ -13092,7 +13130,7 @@ to get the effect of a C-q. ;;;### (autoloads nil "flymake" "progmodes/flymake.el" (0 0 0 0)) ;;; Generated autoloads from progmodes/flymake.el -(push (purecopy '(flymake 1 0 3)) package--builtin-versions) +(push (purecopy '(flymake 1 0 5)) package--builtin-versions) (autoload 'flymake-log "flymake" "\ Log, at level LEVEL, the message MSG formatted with ARGS. @@ -22300,41 +22338,6 @@ QUALITY can be: ;;;*** -;;;### (autoloads nil "fileloop" "fileloop.el" (0 0 0 0)) -;;; Generated autoloads from fileloop.el - -(autoload 'fileloop-initialize "fileloop" "\ -Initialize a new round of operation on several files. -FILES can be either a list of file names, or an iterator (used with `iter-next') -which returns a file name at each step. -SCAN-FUNCTION is a function called with no argument inside a buffer -and it should return non-nil if that buffer has something on which to operate. -OPERATE-FUNCTION is a function called with no argument; it is expected -to perform the operation on the current file buffer and when done -should return non-nil to mean that we should immediately continue -operating on the next file and nil otherwise. - -\(fn FILES SCAN-FUNCTION OPERATE-FUNCTION)" nil nil) - -(autoload 'fileloop-initialize-search "fileloop" "\ - - -\(fn REGEXP FILES CASE-FOLD)" nil nil) - -(autoload 'fileloop-initialize-replace "fileloop" "\ -Initialize a new round of query&replace on several files. -FROM is a regexp and TO is the replacement to use. -FILES describes the file, as in `fileloop-initialize'. -CASE-FOLD can be t, nil, or `default', the latter one meaning to obey -the default setting of `case-fold-search'. -DELIMITED if non-nil means replace only word-delimited matches. - -\(fn FROM TO FILES CASE-FOLD &optional DELIMITED)" nil nil) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "fileloop" '("fileloop-"))) - -;;;*** - ;;;### (autoloads nil "mwheel" "mwheel.el" (0 0 0 0)) ;;; Generated autoloads from mwheel.el @@ -25063,6 +25066,13 @@ Emacs Lisp manual for more information and examples. (function-put 'pcase 'lisp-indent-function '1) +(put 'pcase 'function-documentation '(pcase--make-docstring)) + +(autoload 'pcase--make-docstring "pcase" "\ + + +\(fn)" nil nil) + (autoload 'pcase-exhaustive "pcase" "\ The exhaustive version of `pcase' (which see). If EXP fails to match any of the patterns in CASES, an error is signaled. @@ -25630,6 +25640,13 @@ they are not by default assigned to keys. ;;;*** +;;;### (autoloads nil "pinyin" "language/pinyin.el" (0 0 0 0)) +;;; Generated autoloads from language/pinyin.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "pinyin" '("pinyin-character-map"))) + +;;;*** + ;;;### (autoloads nil "pixel-scroll" "pixel-scroll.el" (0 0 0 0)) ;;; Generated autoloads from pixel-scroll.el @@ -28846,7 +28863,7 @@ CHAR matches 0 through 9. `control', `cntrl' - matches ASCII control characters. + matches any character whose code is in the range 0-31. `hex-digit', `hex', `xdigit' matches 0 through 9, a through f and A through F. @@ -28933,7 +28950,9 @@ CHAR matches a character with category CATEGORY. CATEGORY must be either a character to use for C, or one of the following symbols. - `consonant' (\\c0 in string notation) + `space-for-indent' (\\c\\s in string notation) + `base' (\\c.) + `consonant' (\\c0) `base-vowel' (\\c1) `upper-diacritical-mark' (\\c2) `lower-diacritical-mark' (\\c3) @@ -28951,7 +28970,9 @@ CHAR `japanese-hiragana-two-byte' (\\cH) `indian-two-byte' (\\cI) `japanese-katakana-two-byte' (\\cK) + `strong-left-to-right' (\\cL) `korean-hangul-two-byte' (\\cN) + `strong-right-to-left' (\\cR) `cyrillic-two-byte' (\\cY) `combining-diacritic' (\\c^) `ascii' (\\ca) @@ -31906,8 +31927,7 @@ The default comes from `process-coding-system-alist' and your might try undecided-dos as a coding system. If this doesn't help, Try to set `comint-output-filter-functions' like this: -\(setq comint-output-filter-functions (append comint-output-filter-functions - \\='(comint-strip-ctrl-m))) +\(add-hook 'comint-output-filter-functions #\\='comint-strip-ctrl-m 'append) \(Type \\[describe-mode] in the SQL buffer for a list of commands.) @@ -32349,7 +32369,7 @@ Studlify-case the current buffer. ;;;### (autoloads nil "subr-x" "emacs-lisp/subr-x.el" (0 0 0 0)) ;;; Generated autoloads from emacs-lisp/subr-x.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "subr-x" '("and-let*" "hash-table-" "if-let" "internal--" "string-" "thread-" "when-let"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "subr-x" '("and-let*" "hash-table-" "if-let" "internal--" "replace-region-contents" "string-" "thread-" "when-let"))) ;;;*** @@ -34504,7 +34524,7 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\". \(fn &optional FORCE)" nil nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "titdic-cnv" '("batch-miscdic-convert" "ctlau-" "miscdic-convert" "py-converter" "quail-" "quick-" "tit-" "tsang-" "ziranma-converter"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "titdic-cnv" '("batch-miscdic-convert" "ctlau-" "miscdic-convert" "pinyin-convert" "py-converter" "quail-" "quick-" "tit-" "tsang-" "ziranma-converter"))) ;;;*** @@ -34841,14 +34861,14 @@ It must be supported by libarchive(3).") (defmacro tramp-archive-autoload-file-name-regexp nil "\ Regular expression matching archive file names." '(concat "\\`" "\\(" ".+" "\\." (regexp-opt tramp-archive-suffixes) "\\(?:" "\\." (regexp-opt tramp-archive-compression-suffixes) "\\)*" "\\)" "\\(" "/" ".*" "\\)" "\\'")) -(defalias 'tramp-archive-autoload-file-name-handler 'tramp-autoload-file-name-handler) +(defalias 'tramp-archive-autoload-file-name-handler #'tramp-autoload-file-name-handler) (defun tramp-register-archive-file-name-handler nil "\ -Add archive file name handler to `file-name-handler-alist'." (when tramp-archive-enabled (add-to-list 'file-name-handler-alist (cons (tramp-archive-autoload-file-name-regexp) 'tramp-archive-autoload-file-name-handler)) (put 'tramp-archive-autoload-file-name-handler 'safe-magic t))) +Add archive file name handler to `file-name-handler-alist'." (when tramp-archive-enabled (add-to-list 'file-name-handler-alist (cons (tramp-archive-autoload-file-name-regexp) #'tramp-archive-autoload-file-name-handler)) (put 'tramp-archive-autoload-file-name-handler 'safe-magic t))) -(add-hook 'after-init-hook 'tramp-register-archive-file-name-handler) +(add-hook 'after-init-hook #'tramp-register-archive-file-name-handler) -(add-hook 'tramp-archive-unload-hook (lambda nil (remove-hook 'after-init-hook 'tramp-register-archive-file-name-handler))) +(add-hook 'tramp-archive-unload-hook (lambda nil (remove-hook 'after-init-hook #'tramp-register-archive-file-name-handler))) (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "tramp-archive" '("tramp-" "with-parsed-tramp-archive-file-name"))) @@ -34890,6 +34910,14 @@ Add archive file name handler to `file-name-handler-alist'." (when tramp-archive ;;;*** +;;;### (autoloads nil "tramp-integration" "net/tramp-integration.el" +;;;;;; (0 0 0 0)) +;;; Generated autoloads from net/tramp-integration.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "tramp-integration" '("tramp-"))) + +;;;*** + ;;;### (autoloads nil "tramp-rclone" "net/tramp-rclone.el" (0 0 0 ;;;;;; 0)) ;;; Generated autoloads from net/tramp-rclone.el @@ -36373,6 +36401,11 @@ Display a message indicating unresolved conflicts in FILENAME. (defalias 'vc-resolve-conflicts 'smerge-ediff) +(autoload 'vc-find-conflicted-file "vc" "\ +Visit the next conflicted file in the current project. + +\(fn)" t nil) + (autoload 'vc-create-tag "vc" "\ Descending recursively from DIR, make a tag called NAME. For each registered file, the working revision becomes part of @@ -38712,6 +38745,35 @@ a single modifier. Default value of PREFIX is `C-x' and MODIFIERS is `shift'. \(fn &optional PREFIX MODIFIERS)" t nil) +(autoload 'windmove-swap-states-left "windmove" "\ +Swap the states with the window on the left from the current one. + +\(fn)" t nil) + +(autoload 'windmove-swap-states-up "windmove" "\ +Swap the states with the window above from the current one. + +\(fn)" t nil) + +(autoload 'windmove-swap-states-down "windmove" "\ +Swap the states with the window below from the current one. + +\(fn)" t nil) + +(autoload 'windmove-swap-states-right "windmove" "\ +Swap the states with the window on the right from the current one. + +\(fn)" t nil) + +(autoload 'windmove-swap-states-default-keybindings "windmove" "\ +Set up keybindings for directional window swap states. +Keys are bound to commands that swap the states of the selected window +with the window in the specified direction. Keybindings are of the form +MODIFIERS-{left,right,up,down}, where MODIFIERS is either a list of modifiers +or a single modifier. Default value of MODIFIERS is `shift-super'. + +\(fn &optional MODIFIERS)" t nil) + (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "windmove" '("windmove-"))) ;;;*** commit 5ec7ca14d9e8a2eb5bf817dfd47300f73f37ec91 Author: Glenn Morris Date: Fri Mar 1 06:23:38 2019 -0500 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 531d963161..49578a0465 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -27614,9 +27614,9 @@ than that of a simplified version: ((eq paren \\='symbols) \\='(\"\\\\_<\\\\(\" . \"\\\\)\\\\_>\")) ((null paren) \\='(\"\\\\(?:\" . \"\\\\)\")) (t \\='(\"\\\\(\" . \"\\\\)\"))))) - (concat (car paren) + (concat (car parens) (mapconcat \\='regexp-quote strings \"\\\\|\") - (cdr paren)))) + (cdr parens)))) \(fn STRINGS &optional PAREN)" nil nil) commit 9df1365f3838704e38f82c138175713a146a7164 Author: Eli Zaretskii Date: Fri Mar 1 12:30:47 2019 +0200 Fix a typo in the Calc manual * doc/misc/calc.texi (Algebraic Tutorial): Fix parentheses in @example. (Bug#34689) diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 0b6e119390..7cfb7e1f0b 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -1775,7 +1775,7 @@ evaluated first, then @samp{*}, then @samp{/}, then finally is equivalent to @example -2 + ((3*4*5) / (6*(7^8)) - 9 +2 + ((3*4*5) / (6*(7^8))) - 9 @end example @noindent commit f3dab022324504309cca331b324cb6fed8b5a67c Author: Eli Zaretskii Date: Fri Mar 1 12:25:40 2019 +0200 Minor improvement in cross-references of the ELisp manual * doc/lispref/modes.texi (Minor Mode Conventions): Add cross-references to related major-mode descriptions. (Bug#34678) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 26cb028d26..1343024329 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1405,7 +1405,7 @@ The value of this variable is a list of all minor mode commands. @cindex conventions for writing minor modes There are conventions for writing minor modes just as there are for -major modes. These conventions are described below. The easiest way to +major modes (@pxref{Major Modes}). These conventions are described below. The easiest way to follow them is to use the macro @code{define-minor-mode}. @xref{Defining Minor Modes}. @@ -1516,10 +1516,10 @@ or like this, using @code{add-to-list} (@pxref{List Variables}): @end smallexample @end itemize - In addition, several major mode conventions apply to minor modes as -well: those regarding the names of global symbols, the use of a hook at -the end of the initialization function, and the use of keymaps and other -tables. + In addition, several major mode conventions (@pxref{Major Mode +Conventions}) apply to minor modes as well: those regarding the names +of global symbols, the use of a hook at the end of the initialization +function, and the use of keymaps and other tables. The minor mode should, if possible, support enabling and disabling via Custom (@pxref{Customization}). To do this, the mode variable should be commit ed087faa9b1f042e0c47c712e737ef75e90c4f8d Author: Eli Zaretskii Date: Fri Mar 1 12:19:03 2019 +0200 Don't signal Quit from 'while-no-input' on TTY frames * src/keyboard.c (read_char): Don't inject quit-char after longjmp if while-no-input is in effect. (Bug#34535) diff --git a/src/keyboard.c b/src/keyboard.c index 3af487cf07..c2d8b860e4 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2551,7 +2551,10 @@ read_char (int commandflag, Lisp_Object map, restore_getcjmp (save_jump); pthread_sigmask (SIG_SETMASK, &empty_mask, 0); unbind_to (jmpcount, Qnil); - XSETINT (c, quit_char); + /* If we are in while-no-input, don't trigger C-g, as that will + quit instead of letting while-no-input do its thing. */ + if (!EQ (Vquit_flag, Vthrow_on_input)) + XSETINT (c, quit_char); internal_last_event_frame = selected_frame; Vlast_event_frame = internal_last_event_frame; /* If we report the quit char as an event, commit 560c84b62b346e1ce6edc0a334cdbfaa37de7884 Author: Tobias Bading Date: Mon Feb 25 14:26:38 2019 +0100 Fix last change on 'compilation-parse-errors' * lisp/progmodes/compile.el (compilation-parse-errors): Fix previous change in this function. (Bug#34479) Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 5312a55a25..49b79de585 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1432,7 +1432,7 @@ to `compilation-error-regexp-alist' if RULES is nil." (let ((this-type (if (consp type) (compilation-type type) (or type 2)))) - (compilation--note-type type) + (compilation--note-type this-type) (compilation--put-prop file 'font-lock-face commit 4b63c21f08679c423200132646d48ffb5f97247a Author: Evan Moses Date: Thu Feb 21 13:37:01 2019 -0800 Add 'breakpoint' to builtins for Python * lisp/progmodes/python.el (python-font-lock-keywords-level-2) (python-font-lock-keywords-maxiumum-decoration): Add 'breakpoint' to the list of builtins, it's new as of Python 3.7. Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 71b2a94c07..65d5d90cd5 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -575,7 +575,7 @@ class declarations.") "reload" "unichr" "unicode" "xrange" "apply" "buffer" "coerce" "intern" ;; Python 3: - "ascii" "bytearray" "bytes" "exec" + "ascii" "breakpoint" "bytearray" "bytes" "exec" ;; Extra: "__all__" "__doc__" "__name__" "__package__") symbol-end) . font-lock-builtin-face)) commit 8eb94161b3419f3dd345871928ea37d986791963 Author: Eli Zaretskii Date: Fri Mar 1 11:44:52 2019 +0200 Be more defensive regarding elements of 'load-history' * lisp/loadhist.el (file-dependents): * lisp/apropos.el (apropos-library): * lisp/help-fns.el (help-fns--autoloaded-p, help--loaded-p): * lisp/emacs-lisp/package.el (package--list-loaded-files): Don't assume 'load-history' elements must have a string as their 'car'. (Bug#34462) diff --git a/lisp/apropos.el b/lisp/apropos.el index 6614645f74..1b86f5bcde 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -681,7 +681,7 @@ the output includes key-bindings of commands." (re (concat "\\(?:\\`\\|[\\/]\\)" (regexp-quote file) "\\(\\.\\|\\'\\)"))) (while (and lh (null lh-entry)) - (if (and (caar lh) (string-match re (caar lh))) + (if (and (stringp (caar lh)) (string-match re (caar lh))) (setq lh-entry (car lh)) (setq lh (cdr lh))))) (unless lh-entry (error "Unknown library `%s'" file))) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 458bfad327..5e8864ec73 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -756,7 +756,8 @@ DIR, sorted by most recently loaded last." (let* ((history (delq nil (mapcar (lambda (x) (let ((f (car x))) - (and f (file-name-sans-extension f)))) + (and (stringp f) + (file-name-sans-extension f)))) load-history))) (dir (file-truename dir)) ;; List all files that have already been loaded. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index b4e93d36d4..06b4ec8c20 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -76,7 +76,7 @@ The functions will receive the function name as argument.") (let* ((re (load-history-regexp file)) (done nil)) (dolist (x load-history) - (and (car x) (string-match-p re (car x)) (setq done t))) + (and (stringp (car x)) (string-match-p re (car x)) (setq done t))) done))) (defun help--load-prefixes (prefixes) @@ -521,7 +521,7 @@ FILE is the file where FUNCTION was probably defined." (target (cons t function)) found) (while (and load-hist (not found)) - (and (caar load-hist) + (and (stringp (caar load-hist)) (equal (file-name-sans-extension (caar load-hist)) file) (setq found (member target (cdar load-hist)))) (setq load-hist (cdr load-hist))) diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 5070a00aaf..4e5d8e0f38 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -96,7 +96,8 @@ A library name is equivalent to the file name that `load-library' would load." (let ((provides (file-provides file)) (dependents nil)) (dolist (x load-history dependents) - (when (file-set-intersect provides (file-requires (car x))) + (when (and (stringp (car x)) + (file-set-intersect provides (file-requires (car x)))) (push (car x) dependents))))) (defun read-feature (prompt &optional loaded-p) commit 1dff09739346037a588a3b9290800c09a9b3409a Author: Dmitry Gutov Date: Fri Feb 1 03:01:39 2019 +0300 Backport: js--re-search-backward-inner: Fix infloop Fix JS indentation infloop reported in https://github.com/mooz/js2-mode/issues/513. * lisp/progmodes/js.el (js--re-search-backward-inner): Account for multiline string literals. * test/manual/indent/js.js: New test example. (cherry picked from commit b01a4295c2f9bb58858880e4e28b05cc8396791c) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 14571a04e1..9c3f3b3e4f 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -794,7 +794,6 @@ macro as normal text." (defun js--re-search-backward-inner (regexp &optional bound count) "Auxiliary function for `js--re-search-backward'." (let ((parse) - str-terminator (orig-macro-start (save-excursion (and (js--beginning-of-macro) @@ -805,13 +804,7 @@ macro as normal text." (save-excursion (backward-char) (looking-at "/[/*]"))) (forward-char)) (setq parse (syntax-ppss)) - (cond ((setq str-terminator (nth 3 parse)) - (when (eq str-terminator t) - (setq str-terminator ?/)) - (re-search-backward - (concat "\\([^\\]\\|^\\)" (string str-terminator)) - (point-at-bol) t)) - ((nth 7 parse) + (cond ((nth 8 parse) (goto-char (nth 8 parse))) ((or (nth 4 parse) (and (eq (char-before) ?/) (eq (char-after) ?*))) diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js index b0d8bcabd2..df79098694 100644 --- a/test/manual/indent/js.js +++ b/test/manual/indent/js.js @@ -144,6 +144,13 @@ bar( /abc/ ) +// No infloop inside js--re-search-backward-inner +let b = { + a : ` + //1 + ` +} + // Local Variables: // indent-tabs-mode: nil // js-indent-level: 2 commit dee3cdc50415a3fa45c6b043590d99adf47c7c69 Author: Eli Zaretskii Date: Sat Feb 23 15:31:15 2019 +0200 Minor improvement for docs of completion * doc/lispref/minibuf.texi (Completion Commands) (Completion in Buffers, Programmed Completion): Add to text that references completion tables a cross-reference to where "completion table" is described. (Programmed Completion): Fix the description of 'completion-table-dynamic'. Add more cross-references. diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 0c0862160b..796be07ef1 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1102,11 +1102,11 @@ different function to completely override the normal behavior of in the minibuffer to do completion. @defvar minibuffer-completion-table -The value of this variable is the completion table used for completion -in the minibuffer. This is the global variable that contains what -@code{completing-read} passes to @code{try-completion}. It is used by -minibuffer completion commands such as -@code{minibuffer-complete-word}. +The value of this variable is the completion table (@pxref{Basic +Completion}) used for completion in the minibuffer. This is the +global variable that contains what @code{completing-read} passes to +@code{try-completion}. It is used by minibuffer completion commands +such as @code{minibuffer-complete-word}. @end defvar @defvar minibuffer-completion-predicate @@ -1764,7 +1764,8 @@ possible match, and ignore the match if the predicate returns @code{nil}. @item -A flag specifying the type of completion operation to perform. This +A flag specifying the type of completion operation to perform; see +@ref{Basic Completion}, for the details of those operations. This flag may be one of the following values. @table @code @@ -1835,17 +1836,26 @@ the same as for @code{display-sort-function}. @defun completion-table-dynamic function &optional switch-buffer This function is a convenient way to write a function that can act as -a programmed completion function. The argument @var{function} should be -a function that takes one argument, a string, and returns an alist of -possible completions of it. It is allowed to ignore the argument and -return a full list of all possible completions. You can think of -@code{completion-table-dynamic} as a transducer between that interface +a programmed completion function. The argument @var{function} should +be a function that takes one argument, a string, and returns a +completion table (@pxref{Basic Completion}) containing all the +possible completions. The table returned by @var{function} can also +include elements that don't match the string argument; they are +automatically filtered out by @code{completion-table-dynamic}. In +particular, @var{function} can ignore its argument and return a full +list of all possible completions. You can think of +@code{completion-table-dynamic} as a transducer between @var{function} and the interface for programmed completion functions. If the optional argument @var{switch-buffer} is non-@code{nil}, and completion is performed in the minibuffer, @var{function} will be called with current buffer set to the buffer from which the minibuffer was entered. + +The return value of @code{completion-table-dynamic} is a function that +can be used as the 2nd argument to @code{try-completion} and +@code{all-completions}. Note that this function will always return +empty metadata and trivial boundaries (@pxref{Programmed Completion}). @end defun @defun completion-table-with-cache function &optional ignore-case @@ -1870,9 +1880,10 @@ Emacs Manual}. This command uses the abnormal hook variable @defvar completion-at-point-functions The value of this abnormal hook should be a list of functions, which -are used to compute a completion table for completing the text at -point. It can be used by major modes to provide mode-specific -completion tables (@pxref{Major Mode Conventions}). +are used to compute a completion table (@pxref{Basic Completion}) for +completing the text at point. It can be used by major modes to +provide mode-specific completion tables (@pxref{Major Mode +Conventions}). When the command @code{completion-at-point} runs, it calls the functions in the list one by one, without any argument. Each function commit c86d41911dad6b3ef799d5cda5778768b2aa3aec Author: Eli Zaretskii Date: Sat Feb 23 10:35:59 2019 +0200 ; * src/image.c (imagemagick_load, svg_load): Fix typos in comments. diff --git a/src/image.c b/src/image.c index 2d5a882232..50515e1a42 100644 --- a/src/image.c +++ b/src/image.c @@ -8941,8 +8941,8 @@ imagemagick_load (struct frame *f, struct image *img) #endif success_p = imagemagick_load_image (f, img, 0, 0, SSDATA (file)); } - /* Else its not a file, its a lisp object. Load the image from a - lisp object rather than a file. */ + /* Else it's not a file, it's a Lisp object. Load the image from a + Lisp object rather than a file. */ else { Lisp_Object data; @@ -9250,8 +9250,8 @@ svg_load (struct frame *f, struct image *img) SSDATA (ENCODE_FILE (file))); xfree (contents); } - /* Else its not a file, its a lisp object. Load the image from a - lisp object rather than a file. */ + /* Else it's not a file, it's a Lisp object. Load the image from a + Lisp object rather than a file. */ else { Lisp_Object data, original_filename; commit 6d46fa961c93d435e70b046ef2c400b81934ace8 Author: Ken Brown Date: Fri Feb 22 09:53:52 2019 -0500 Disable the timerfd interface on Cygwin * configure.ac (emacs_cv_have_timerfd): Set to "no" on Cygwin. diff --git a/configure.ac b/configure.ac index d5e802a961..097c3bc68a 100644 --- a/configure.ac +++ b/configure.ac @@ -4145,6 +4145,10 @@ AC_SUBST(LIBS_TERMCAP) AC_SUBST(TERMCAP_OBJ) # GNU/Linux-specific timer functions. +# Bug#34618. +if test "$opsys" = "cygwin"; then + emacs_cv_have_timerfd=no +fi AC_CACHE_CHECK([for timerfd interface], [emacs_cv_have_timerfd], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include commit 3707ea434f1801f911e51896b987be61b4e4c7c2 Author: Eli Zaretskii Date: Fri Feb 22 10:12:14 2019 +0200 Fix a typo in the doc string of 'regex-opt' * lisp/emacs-lisp/regexp-opt.el (regexp-opt): Fix example in the doc string. (Bug#34596) diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el index 152dca2309..63786c1508 100644 --- a/lisp/emacs-lisp/regexp-opt.el +++ b/lisp/emacs-lisp/regexp-opt.el @@ -121,9 +121,9 @@ than that of a simplified version: ((eq paren \\='symbols) \\='(\"\\\\_<\\\\(\" . \"\\\\)\\\\_>\")) ((null paren) \\='(\"\\\\(?:\" . \"\\\\)\")) (t \\='(\"\\\\(\" . \"\\\\)\"))))) - (concat (car paren) + (concat (car parens) (mapconcat \\='regexp-quote strings \"\\\\|\") - (cdr paren))))" + (cdr parens))))" (save-match-data ;; Recurse on the sorted list. (let* ((max-lisp-eval-depth 10000) commit d9905d5c6f22ccefe03ee3ae1267a9fdf28fc61a Author: Michael Albinus Date: Thu Feb 21 12:09:44 2019 +0100 Document bash 5.0.0 misbehavior in tramp.texi (Bug#34192) * doc/misc/tramp.texi (Frequently Asked Questions): Warn about bash 5.0.0 and HISTSIZE=0. (Bug#34192) diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index bfb6d748f2..633f2d16b6 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -3410,7 +3410,9 @@ Due to the remote shell saving tilde expansions triggered by @value{tramp} can suppress this behavior with the user option @code{tramp-histfile-override}. When set to @code{t}, environment variable @env{HISTFILE} is unset, and environment variables -@env{HISTFILESIZE} @env{HISTSIZE} are set to 0. +@env{HISTFILESIZE} and @env{HISTSIZE} are set to 0. Don't use this +with @command{bash} 5.0.0. There is a bug in @command{bash} which +lets @command{bash} die. Alternatively, @code{tramp-histfile-override} could be a string. Environment variable @env{HISTFILE} is set to this file name then. Be