commit e823709d1755cb4fd087f2a9ba92d350dd32fe47 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Wed Aug 26 00:07:09 2020 -0700 regex-emacs: copy less when reallocating * src/regex-emacs.c (GROW_FAIL_STACK): Copy just the occupied stack slots, as the rest are garbage. diff --git a/src/regex-emacs.c b/src/regex-emacs.c index 3d8aaf4bb1..971a5f6374 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -929,7 +929,7 @@ typedef struct ? 0 \ : ((fail_stack).stack \ = REGEX_REALLOCATE ((fail_stack).stack, \ - (fail_stack).size * sizeof (fail_stack_elt_t), \ + (fail_stack).avail * sizeof (fail_stack_elt_t), \ min (emacs_re_max_failures * TYPICAL_FAILURE_SIZE, \ ((fail_stack).size * FAIL_STACK_GROWTH_FACTOR)) \ * sizeof (fail_stack_elt_t)), \ commit bd5771ff27dbbb2b09cc7c14f1ac040234285acc Author: Paul Eggert Date: Wed Aug 26 00:07:08 2020 -0700 regex-emacs: fix leak on memory allocation failure * src/regex-emacs.c (ENSURE_FAIL_STACK): If the failure stack cannot be grown, free locally-allocated storage before returning. diff --git a/src/regex-emacs.c b/src/regex-emacs.c index 5d1bb094d5..3d8aaf4bb1 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -969,7 +969,11 @@ typedef struct #define ENSURE_FAIL_STACK(space) \ while (REMAINING_AVAIL_SLOTS <= space) { \ if (!GROW_FAIL_STACK (fail_stack)) \ - return -2; \ + { \ + unbind_to (count, Qnil); \ + SAFE_FREE (); \ + return -2; \ + } \ DEBUG_PRINT ("\n Doubled stack; size now: %td\n", fail_stack.size); \ DEBUG_PRINT (" slots available: %td\n", REMAINING_AVAIL_SLOTS);\ } commit 4c0a9754ace421461d648b911da6d5eec49e9a62 Author: Paul Eggert Date: Wed Aug 26 00:07:08 2020 -0700 regex-emacs: subscript-check register numbers * src/regex-emacs.c (PUSH_FAILURE_REG, POP_FAILURE_REG_OR_COUNT) (re_match_2_internal): Add some easserts for subscript checking. diff --git a/src/regex-emacs.c b/src/regex-emacs.c index b9c157d21f..5d1bb094d5 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -979,10 +979,11 @@ while (REMAINING_AVAIL_SLOTS <= space) { \ do { \ char *destination; \ intptr_t n = num; \ + eassert (0 < n && n < num_regs); \ + eassert (REG_UNSET (regstart[n]) <= REG_UNSET (regend[n])); \ ENSURE_FAIL_STACK(3); \ DEBUG_PRINT (" Push reg %"PRIdPTR" (spanning %p -> %p)\n", \ n, regstart[n], regend[n]); \ - eassert (REG_UNSET (regstart[n]) <= REG_UNSET (regend[n])); \ PUSH_FAILURE_POINTER (regstart[n]); \ PUSH_FAILURE_POINTER (regend[n]); \ PUSH_FAILURE_INT (n); \ @@ -1018,6 +1019,7 @@ do { \ } \ else \ { \ + eassert (0 < pfreg && pfreg < num_regs); \ regend[pfreg] = POP_FAILURE_POINTER (); \ regstart[pfreg] = POP_FAILURE_POINTER (); \ eassert (REG_UNSET (regstart[pfreg]) <= REG_UNSET (regend[pfreg])); \ @@ -4375,6 +4377,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, registers data structure) under the register number. */ case start_memory: DEBUG_PRINT ("EXECUTING start_memory %d:\n", *p); + eassert (0 < *p && *p < num_regs); /* In case we need to undo this operation (via backtracking). */ PUSH_FAILURE_REG (*p); @@ -4392,6 +4395,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, case stop_memory: DEBUG_PRINT ("EXECUTING stop_memory %d:\n", *p); + eassert (0 < *p && *p < num_regs); eassert (!REG_UNSET (regstart[*p])); /* Strictly speaking, there should be code such as: @@ -4424,6 +4428,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, DEBUG_PRINT ("EXECUTING duplicate %d.\n", regno); /* Can't back reference a group which we've never matched. */ + eassert (0 < regno && regno < num_regs); eassert (REG_UNSET (regstart[regno]) <= REG_UNSET (regend[regno])); if (REG_UNSET (regend[regno])) goto fail; commit 82c089f532ede12c5811daacae5f824703ff8a7e Author: Paul Eggert Date: Wed Aug 26 00:07:08 2020 -0700 regex-emacs: omit regstart tests and regend set * src/regex-emacs.c (PUSH_FAILURE_REG, POP_FAILURE_REG_OR_COUNT) (re_match_2_internal): Add some assertions that regstart is set whenever regend is. (re_match_2_internal): Omit two unnecessary REG_UNSET (regstart ...)s and one unnecessary assignment to regend. diff --git a/src/regex-emacs.c b/src/regex-emacs.c index da73f58f50..b9c157d21f 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -982,6 +982,7 @@ do { \ ENSURE_FAIL_STACK(3); \ DEBUG_PRINT (" Push reg %"PRIdPTR" (spanning %p -> %p)\n", \ n, regstart[n], regend[n]); \ + eassert (REG_UNSET (regstart[n]) <= REG_UNSET (regend[n])); \ PUSH_FAILURE_POINTER (regstart[n]); \ PUSH_FAILURE_POINTER (regend[n]); \ PUSH_FAILURE_INT (n); \ @@ -1019,6 +1020,7 @@ do { \ { \ regend[pfreg] = POP_FAILURE_POINTER (); \ regstart[pfreg] = POP_FAILURE_POINTER (); \ + eassert (REG_UNSET (regstart[pfreg]) <= REG_UNSET (regend[pfreg])); \ DEBUG_PRINT (" Pop reg %ld (spanning %p -> %p)\n", \ pfreg, regstart[pfreg], regend[pfreg]); \ } \ @@ -4122,6 +4124,8 @@ re_match_2_internal (struct re_pattern_buffer *bufp, { regstart[reg] = best_regstart[reg]; regend[reg] = best_regend[reg]; + eassert (REG_UNSET (regstart[reg]) + <= REG_UNSET (regend[reg])); } } } /* d != end_match_2 */ @@ -4169,7 +4173,9 @@ re_match_2_internal (struct re_pattern_buffer *bufp, for (ptrdiff_t reg = 1; reg < num_regs; reg++) { - if (REG_UNSET (regstart[reg]) || REG_UNSET (regend[reg])) + eassert (REG_UNSET (regstart[reg]) + <= REG_UNSET (regend[reg])); + if (REG_UNSET (regend[reg])) regs->start[reg] = regs->end[reg] = -1; else { @@ -4374,7 +4380,6 @@ re_match_2_internal (struct re_pattern_buffer *bufp, PUSH_FAILURE_REG (*p); regstart[*p] = d; - regend[*p] = NULL; /* probably unnecessary. -sm */ DEBUG_PRINT (" regstart: %td\n", POINTER_TO_OFFSET (regstart[*p])); /* Move past the register number and inner group count. */ @@ -4419,7 +4424,8 @@ re_match_2_internal (struct re_pattern_buffer *bufp, DEBUG_PRINT ("EXECUTING duplicate %d.\n", regno); /* Can't back reference a group which we've never matched. */ - if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno])) + eassert (REG_UNSET (regstart[regno]) <= REG_UNSET (regend[regno])); + if (REG_UNSET (regend[regno])) goto fail; /* Where in input to try to start matching. */ commit 768bea30cbc0a5e7851fa60ad1ea7ec14cf2cdd8 Author: Paul Eggert Date: Wed Aug 26 00:07:08 2020 -0700 regex-emacs omit allocation of 3 slots * src/regex-emacs.c (re_match_2_internal): Avoid unnecessary allocation of REGEND[0], BEST_REGSTART[0], BEST_REGEND[0]. diff --git a/src/regex-emacs.c b/src/regex-emacs.c index 954a193371..da73f58f50 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -3923,8 +3923,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, attempt) by a subexpression part of the pattern, that is, the regnum-th regstart pointer points to where in the pattern we began matching and the regnum-th regend points to right after where we - stopped matching the regnum-th subexpression. (The zeroth register - keeps track of what the whole pattern matches.) */ + stopped matching the regnum-th subexpression. */ re_char **regstart UNINIT, **regend UNINIT; /* The following record the register info as found in the above @@ -3973,20 +3972,21 @@ re_match_2_internal (struct re_pattern_buffer *bufp, /* Do not bother to initialize all the register variables if there are no groups in the pattern, as it takes a fair amount of time. If there are groups, we include space for register 0 (the whole - pattern), even though we never use it, since it simplifies the - array indexing. We should fix this. */ - if (bufp->re_nsub) + pattern) in REGSTART[0], even though we never use it, to avoid + the undefined behavior of subtracting 1 from REGSTART. */ + ptrdiff_t re_nsub = num_regs - 1; + if (0 < re_nsub) { - regstart = SAFE_ALLOCA (num_regs * 4 * sizeof *regstart); + regstart = SAFE_ALLOCA ((re_nsub * 4 + 1) * sizeof *regstart); regend = regstart + num_regs; - best_regstart = regend + num_regs; - best_regend = best_regstart + num_regs; - } + best_regstart = regend + re_nsub; + best_regend = best_regstart + re_nsub; - /* Initialize subexpression text positions to -1 to mark ones that no - start_memory/stop_memory has been seen for. */ - for (ptrdiff_t reg = 1; reg < num_regs; reg++) - regstart[reg] = regend[reg] = NULL; + /* Initialize subexpression text positions to unset, to mark ones + that no start_memory/stop_memory has been seen for. */ + for (re_char **apos = regstart + 1; apos < best_regstart + 1; apos++) + *apos = NULL; + } /* We move 'string1' into 'string2' if the latter's empty -- but not if 'string1' is null. */ commit 438975bbaa25b7de74993e7928c45cf5779442b8 Author: Paul Eggert Date: Wed Aug 26 00:07:08 2020 -0700 regex-emacs omit POS runtime check * src/regex-emacs.c (re_match_2_internal): Replace unnecessary runtime check of POS with some eassumes. diff --git a/src/regex-emacs.c b/src/regex-emacs.c index c44cce9f78..954a193371 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -3864,6 +3864,10 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string2, ptrdiff_t size2, ptrdiff_t pos, struct re_registers *regs, ptrdiff_t stop) { + eassume (0 <= size1); + eassume (0 <= size2); + eassume (0 <= pos && pos <= stop && stop <= size1 + size2); + /* General temporaries. */ int mcnt; @@ -3979,14 +3983,6 @@ re_match_2_internal (struct re_pattern_buffer *bufp, best_regend = best_regstart + num_regs; } - /* The starting position is bogus. */ - if (pos < 0 || pos > size1 + size2) - { - unbind_to (count, Qnil); - SAFE_FREE (); - return -1; - } - /* Initialize subexpression text positions to -1 to mark ones that no start_memory/stop_memory has been seen for. */ for (ptrdiff_t reg = 1; reg < num_regs; reg++) commit b64d04c3d63d009ffeb801a128a39e3728ff9a99 Author: Paul Eggert Date: Tue Aug 25 18:33:22 2020 -0700 Fix gpg2-related test failures on RHEL 7.8 * test/lisp/gnus/mml-sec-tests.el (test-conf) (mml-secure-en-decrypt-passphrase-no-cache-openpgp-todo) (mml-secure-run-tests-with-gpg2): Use epg-find-configuration instead of the obsolescent epg-configuration. This fixes test failures on RHEL 7.8, where ‘gpg’ and ‘gpg2’ are both 2.0.22. diff --git a/test/lisp/gnus/mml-sec-tests.el b/test/lisp/gnus/mml-sec-tests.el index 2924673b36..673fa6984a 100644 --- a/test/lisp/gnus/mml-sec-tests.el +++ b/test/lisp/gnus/mml-sec-tests.el @@ -37,7 +37,7 @@ Mostly, the empty passphrase is used. However, the keys for as S/MIME).") (defun test-conf () - (ignore-errors (epg-configuration))) + (ignore-errors (epg-find-configuration 'OpenPGP))) (defun enc-standards () (if with-smime '(enc-pgp enc-pgp-mime enc-smime) @@ -843,7 +843,8 @@ So the second decryption fails." (ert-deftest mml-secure-en-decrypt-passphrase-no-cache-openpgp-todo () "Passphrase caching with OpenPGP only for GnuPG 1.x." (skip-unless (test-conf)) - (skip-unless (string< (cdr (assq 'version (epg-configuration))) "2")) + (skip-unless (string< (cdr (assq 'version (epg-find-configuration 'OpenPGP))) + "2")) (mml-secure-en-decrypt-passphrase-no-cache 'enc-pgp) (mml-secure-en-decrypt-passphrase-no-cache 'enc-pgp-mime)) @@ -885,7 +886,7 @@ So the second decryption fails." (defun mml-secure-run-tests-with-gpg2 () "Run all tests with gpg2 instead of gpg." (let* ((epg-gpg-program "gpg2"); ~/local/gnupg-2.1.9/PLAY/inst/bin/gpg2 - (gpg-version (cdr (assq 'version (epg-configuration)))) + (gpg-version (cdr (assq 'version (epg-find-configuration 'OpenPGP)))) ;; Empty passphrases do not seem to work with gpgsm in 2.1.x: ;; https://lists.gnupg.org/pipermail/gnupg-users/2015-October/054575.html (with-smime (string< gpg-version "2.1"))) commit ea382a289d3cd956492894da775ff4ef104f3852 Author: Paul Eggert Date: Tue Aug 25 18:02:58 2020 -0700 mml-secure-en-decrypt-sign-1-2-double is unstable * test/lisp/gnus/mml-sec-tests.el: (mml-secure-en-decrypt-sign-1-2-double): Mark this as unstable. diff --git a/test/lisp/gnus/mml-sec-tests.el b/test/lisp/gnus/mml-sec-tests.el index 07da4bffa5..2924673b36 100644 --- a/test/lisp/gnus/mml-sec-tests.el +++ b/test/lisp/gnus/mml-sec-tests.el @@ -647,6 +647,7 @@ In this test, just multiple encryption and signing keys may be available." (ert-deftest mml-secure-en-decrypt-sign-1-2-double () "Sign and encrypt message; then decrypt and test for expected result. In this test, just multiple encryption and signing keys may be available." + :tags '(:unstable) (skip-unless (test-conf)) (mml-secure-test-key-fixture (lambda () commit d4b5dff48297faec67291c95f8831a3d84f87460 Author: Paul Eggert Date: Tue Aug 25 17:56:57 2020 -0700 Update from Gnulib This incorporates: 2020-08-25 verify: Avoid warnings when assume(0) is used * lib/verify.h: Copy from Gnulib. diff --git a/lib/verify.h b/lib/verify.h index 6d7b961db7..ca2a154073 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -320,7 +320,9 @@ template based on __builtin_unreachable does not. (GCC so far has only __builtin_unreachable.) */ #if _GL_HAS_BUILTIN_ASSUME -/* Use a temporary variable, to avoid a clang warning +/* Use __builtin_constant_p to help clang's data-flow analysis for the case + assume (0). + Use a temporary variable, to avoid a clang warning "the argument to '__builtin_assume' has side effects that will be discarded" if R contains invocations of functions not marked as 'const'. The type of the temporary variable can't be __typeof__ (R), because that @@ -328,12 +330,16 @@ template instead. */ # if defined __cplusplus # define assume(R) \ - ((void) ({ bool _gl_verify_temp = (R); \ - __builtin_assume (_gl_verify_temp); })) + (__builtin_constant_p (R) && !(R) \ + ? (void) __builtin_unreachable () \ + : (void) ({ bool _gl_verify_temp = (R); \ + __builtin_assume (_gl_verify_temp); })) # else # define assume(R) \ - ((void) ({ _Bool _gl_verify_temp = (R); \ - __builtin_assume (_gl_verify_temp); })) + (__builtin_constant_p (R) && !(R) \ + ? (void) __builtin_unreachable () \ + : (void) ({ _Bool _gl_verify_temp = (R); \ + __builtin_assume (_gl_verify_temp); })) # endif #elif _GL_HAS_BUILTIN_UNREACHABLE # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) commit 65543b5a879315031d275c7a9a9eb2e26452eb10 Author: Stefan Kangas Date: Wed Aug 26 00:37:40 2020 +0200 Add package prefix to jsonrpc defconst * lisp/jsonrpc.el (jsonrpc-default-request-timeout): Rename from 'jrpc-default-request-timeout'. (jrpc-default-request-timeout): Make into obsolete variable alias for 'jsonrpc-default-request-timeout'. (Bug#40054) diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index ff8f250a22..2d50df70fd 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -329,7 +329,10 @@ ignored." :method method :params params)) -(defconst jrpc-default-request-timeout 10 +(define-obsolete-variable-alias 'jrpc-default-request-timeout + 'jsonrpc-default-request-timeout "28.1") + +(defconst jsonrpc-default-request-timeout 10 "Time in seconds before timing out a JSONRPC request.") @@ -617,7 +620,7 @@ With optional CLEANUP, kill any associated buffers." params &rest args &key success-fn error-fn timeout-fn - (timeout jrpc-default-request-timeout) + (timeout jsonrpc-default-request-timeout) (deferred nil)) "Does actual work for `jsonrpc-async-request'. commit 375e87409a3a016615db6a1bc67ac143d39254d9 Author: Paul Eggert Date: Tue Aug 25 14:27:17 2020 -0700 Omit "V" at the start of DEFVAR_BOOL vars Problem noted by Stefan Monnier in: https://lists.gnu.org/r/emacs-devel/2020-08/msg00846.html * src/font.c (xft_ignore_color_fonts): * src/syntax.c (comment_end_can_be_escaped): * src/xdisp.c (word_wrap_by_category, display_fill_column_indicator): Rename these DEFVAR_BOOL variables to avoid the initial "V" that wrongly suggests that they are Lisp_Object variables. All uses changed. diff --git a/src/font.c b/src/font.c index 5c01c7ff79..2786a772dc 100644 --- a/src/font.c +++ b/src/font.c @@ -5521,11 +5521,11 @@ footprint in sessions that use lots of different fonts. */); #endif DEFVAR_BOOL ("xft-ignore-color-fonts", - Vxft_ignore_color_fonts, + xft_ignore_color_fonts, doc: /* Non-nil means don't query fontconfig for color fonts, since they often cause Xft crashes. Only has an effect in Xft builds. */); - Vxft_ignore_color_fonts = 1; + xft_ignore_color_fonts = true; #ifdef HAVE_WINDOW_SYSTEM #ifdef HAVE_FREETYPE diff --git a/src/ftfont.c b/src/ftfont.c index a904007a32..6fca9c8509 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -768,7 +768,7 @@ ftfont_spec_pattern (Lisp_Object spec, char *otlayout, struct OpenTypeSpec **ots #if defined HAVE_XFT && defined FC_COLOR /* We really don't like color fonts, they cause Xft crashes. See Bug#30874. */ - if (Vxft_ignore_color_fonts + if (xft_ignore_color_fonts && ! FcPatternAddBool (pattern, FC_COLOR, FcFalse)) goto err; #endif @@ -911,7 +911,7 @@ ftfont_list (struct frame *f, Lisp_Object spec) returns them even when it shouldn't really do so, so we need to manually skip them here (Bug#37786). */ FcBool b; - if (Vxft_ignore_color_fonts + if (xft_ignore_color_fonts && FcPatternGetBool (fontset->fonts[i], FC_COLOR, 0, &b) == FcResultMatch && b != FcFalse) continue; diff --git a/src/syntax.c b/src/syntax.c index 9f77ea5f9b..7f0fc341f6 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -807,7 +807,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, /* Ignore escaped characters, except comment-enders which cannot be escaped. */ - if ((Vcomment_end_can_be_escaped || code != Sendcomment) + if ((comment_end_can_be_escaped || code != Sendcomment) && char_quoted (from, from_byte)) continue; @@ -2336,7 +2336,7 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ? (nesting > 0 && --nesting == 0) : nesting < 0) - && !(Vcomment_end_can_be_escaped && char_quoted (from, from_byte))) + && !(comment_end_can_be_escaped && char_quoted (from, from_byte))) /* We have encountered a comment end of the same style as the comment sequence which began this comment section. */ @@ -2569,7 +2569,7 @@ between them, return t; otherwise return nil. */) } else if (code == Sendcomment) { - found = (!quoted || !Vcomment_end_can_be_escaped) + found = (!quoted || !comment_end_can_be_escaped) && back_comment (from, from_byte, stop, comnested, comstyle, &out_charpos, &out_bytepos); if (!found) @@ -3760,9 +3760,9 @@ character of that word. In both cases, LIMIT bounds the search. */); Vfind_word_boundary_function_table = Fmake_char_table (Qnil, Qnil); - DEFVAR_BOOL ("comment-end-can-be-escaped", Vcomment_end_can_be_escaped, + DEFVAR_BOOL ("comment-end-can-be-escaped", comment_end_can_be_escaped, doc: /* Non-nil means an escaped ender inside a comment doesn't end the comment. */); - Vcomment_end_can_be_escaped = 0; + comment_end_can_be_escaped = false; DEFSYM (Qcomment_end_can_be_escaped, "comment-end-can-be-escaped"); Fmake_variable_buffer_local (Qcomment_end_can_be_escaped); diff --git a/src/window.c b/src/window.c index ef58f43a0b..e7433969d2 100644 --- a/src/window.c +++ b/src/window.c @@ -5462,7 +5462,7 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, bool noerror) wset_redisplay (XWINDOW (window)); - if (whole && Vfast_but_imprecise_scrolling) + if (whole && fast_but_imprecise_scrolling) specbind (Qfontification_functions, Qnil); /* On GUI frames, use the pixel-based version which is much slower @@ -8398,7 +8398,7 @@ pixelwise even if this option is nil. */); window_resize_pixelwise = false; DEFVAR_BOOL ("fast-but-imprecise-scrolling", - Vfast_but_imprecise_scrolling, + fast_but_imprecise_scrolling, doc: /* When non-nil, accelerate scrolling operations. This comes into play when scrolling rapidly over previously unfontified buffer regions. Only those portions of the buffer which @@ -8406,7 +8406,7 @@ are actually going to be displayed get fontified. Note that this optimization can cause the portion of the buffer displayed after a scrolling operation to be somewhat inaccurate. */); - Vfast_but_imprecise_scrolling = false; + fast_but_imprecise_scrolling = false; defsubr (&Sselected_window); defsubr (&Sold_selected_window); diff --git a/src/xdisp.c b/src/xdisp.c index ed1d248990..dd73758043 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -538,7 +538,7 @@ it_char_has_category(struct it *it, int cat) static bool char_can_wrap_before (struct it *it) { - if (!Vword_wrap_by_category) + if (!word_wrap_by_category) return !IT_DISPLAYING_WHITESPACE (it); /* For CJK (LTR) text in RTL paragraph, EOL and BOL are flipped. @@ -560,7 +560,7 @@ char_can_wrap_before (struct it *it) static bool char_can_wrap_after (struct it *it) { - if (!Vword_wrap_by_category) + if (!word_wrap_by_category) return IT_DISPLAYING_WHITESPACE (it); /* For CJK (LTR) text in RTL paragraph, EOL and BOL are flipped. @@ -589,7 +589,7 @@ char_can_wrap_after (struct it *it) static int fill_column_indicator_column (struct it *it, int char_width) { - if (Vdisplay_fill_column_indicator + if (display_fill_column_indicator && !it->w->pseudo_window_p && it->continuation_lines_width == 0 && CHARACTERP (Vdisplay_fill_column_indicator_character)) @@ -21929,7 +21929,7 @@ extend_face_to_end_of_line (struct it *it) && !face->stipple #endif && !it->glyph_row->reversed_p - && !Vdisplay_fill_column_indicator) + && !display_fill_column_indicator) return; /* Set the glyph row flag indicating that the face of the last glyph @@ -34772,7 +34772,7 @@ A value of nil means to respect the value of `truncate-lines'. If `word-wrap' is enabled, you might want to reduce this. */); Vtruncate_partial_width_windows = make_fixnum (50); - DEFVAR_BOOL("word-wrap-by-category", Vword_wrap_by_category, doc: /* + DEFVAR_BOOL("word-wrap-by-category", word_wrap_by_category, doc: /* Non-nil means also wrap after characters of a certain category. Normally when `word-wrap' is on, Emacs only breaks lines after whitespace characters. When this option is turned on, Emacs also @@ -34787,7 +34787,7 @@ when breaking lines. That means characters with the ">" category don't appear at the beginning of a line (e.g., FULLWIDTH COMMA), and characters with the "<" category don't appear at the end of a line (e.g., LEFT DOUBLE ANGLE BRACKET). */); - Vword_wrap_by_category = false; + word_wrap_by_category = false; DEFVAR_LISP ("line-number-display-limit", Vline_number_display_limit, doc: /* Maximum buffer size for which line number should be displayed. @@ -35184,10 +35184,10 @@ It has no effect when set to 0, or when line numbers are not absolute. */); DEFSYM (Qdisplay_line_numbers_offset, "display-line-numbers-offset"); Fmake_variable_buffer_local (Qdisplay_line_numbers_offset); - DEFVAR_BOOL ("display-fill-column-indicator", Vdisplay_fill_column_indicator, + DEFVAR_BOOL ("display-fill-column-indicator", display_fill_column_indicator, doc: /* Non-nil means display the fill column indicator. See Info node `Displaying Boundaries' for details. */); - Vdisplay_fill_column_indicator = false; + display_fill_column_indicator = false; DEFSYM (Qdisplay_fill_column_indicator, "display-fill-column-indicator"); Fmake_variable_buffer_local (Qdisplay_fill_column_indicator); commit 9c011a1083c2a78e2fdfe931988ab53f42323a9c Author: Daniel Colascione Date: Tue Aug 25 10:53:53 2020 -0700 Add undefine keyword to make-mode * lisp/progmodes/make-mode.el (makefile-gmake-statements): Add "undefine" to the list of gmake keywords diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index ec246d63ac..235279e226 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -316,7 +316,7 @@ not be enclosed in { } or ( )." (defconst makefile-gmake-statements `("-sinclude" "sinclude" ; makefile-makepp-statements takes rest "ifdef" "ifndef" "ifeq" "ifneq" "-include" "define" "endef" "export" - "override define" "override" "unexport" "vpath" + "override define" "override" "unexport" "vpath" "undefine" ,@(cdr makefile-automake-statements)) "List of keywords understood by gmake.") commit a17ad0b212330fd6a196fef55721195f281b205d Author: Stefan Kangas Date: Mon Aug 24 02:17:52 2020 +0200 Add "Delete" submenu to Dired "Operate" menu * lisp/dired.el (dired-mode-map): Add "Delete" submenu to "Operate" menu with an entry for 'dired-do-flagged-delete'. (Bug#41524) diff --git a/lisp/dired.el b/lisp/dired.el index 94d3befda8..08d0468851 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2244,8 +2244,15 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." '(menu-item "Shell Command..." dired-do-shell-command :help "Run a shell command on current or marked files")) (define-key map [menu-bar operate delete] - '(menu-item "Delete" dired-do-delete - :help "Delete current file or all marked files")) + `(menu-item "Delete" + ,(let ((menu (make-sparse-keymap "Delete"))) + (define-key menu [delete-flagged] + '(menu-item "Delete Flagged Files" dired-do-flagged-delete + :help "Delete all files flagged for deletion (D)")) + (define-key menu [delete-marked] + '(menu-item "Delete Marked (Not Flagged) Files" dired-do-delete + :help "Delete current file or all marked files (excluding flagged files)")) + menu))) (define-key map [menu-bar operate rename] '(menu-item "Rename to..." dired-do-rename :help "Rename current file or move marked files")) commit 585beb6c12c82bb2a7f87905e1511c8346942d4a Author: Eric Abrahamsen Date: Fri Aug 21 13:36:58 2020 -0700 Add basic D-Bus integration to Gnus * lisp/gnus/gnus-dbus.el: New library, registering a signal that closes all Gnus servers when the system is going to sleep. * lisp/gnus/gnus-start.el: Check new option `gnus-dbus-close-on-sleep', and register the appropriate D-Bus signal if it is non-nil. * lisp/gnus/gnus.el: New gnus-dbus customization group. * doc/misc/gnus.texi: Document. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 332926a685..0bdc2fa297 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -828,6 +828,7 @@ Various * Spam Package:: A package for filtering and processing spam. * The Gnus Registry:: A package for tracking messages by Message-ID. * The Gnus Cloud:: A package for synchronizing Gnus marks. +* D-Bus Integration:: Closing Gnus servers on system sleep. * Other modes:: Interaction with other modes. * Various Various:: Things that are really various. @@ -22333,6 +22334,7 @@ to you, using @kbd{G b u} and updating the group will usually fix this. * Spam Package:: A package for filtering and processing spam. * The Gnus Registry:: A package for tracking messages by Message-ID. * The Gnus Cloud:: A package for synchronizing Gnus marks. +* D-Bus Integration:: Closing Gnus servers on system sleep. * Other modes:: Interaction with other modes. * Various Various:: Things that are really various. @end menu @@ -26404,6 +26406,26 @@ CloudSynchronizationDataPack(TM)s. It's easiest to set this from the Server buffer (@pxref{Gnus Cloud Setup}). @end defvar +@node D-Bus Integration +@section D-Bus Integration +@cindex dbus +@cindex D-Bus +@cindex gnus-dbus +@cindex system sleep +@cindex closing servers automatically +@cindex hung connections + +When using laptops or other systems that have a sleep or hibernate +functionality, it's possible for long-running server connections to +become ``hung'', requiring the user to manually close and re-open the +connections after the system resumes. On systems compiled with D-Bus +support (check the value of @code{(featurep 'dbusbind)}), Gnus can +register a D-Bus signal to automatically close all server connections +before the system goes to sleep. To enable this, set +@code{gnus-dbus-close-on-sleep} to a non-nil value. + +For more information about D-Bus and Emacs, @pxref{Top,,, dbus, D-Bus integration in Emacs}. + @node Other modes @section Interaction with other modes diff --git a/etc/NEWS b/etc/NEWS index d03153cc3f..2f8e5eb855 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -295,6 +295,11 @@ tags to be considered as well. ** Gnus ++++ +*** New option 'gnus-dbus-close-on-sleep' +On systems with D-Bus support, it is now possible to register a signal +to close all Gnus servers before the system sleeps. + +++ *** The key binding of 'gnus-summary-search-article-forward' has changed. This command was previously on 'M-s' and shadowed the global 'M-s' diff --git a/lisp/gnus/gnus-dbus.el b/lisp/gnus/gnus-dbus.el new file mode 100644 index 0000000000..b6e8bb9c8b --- /dev/null +++ b/lisp/gnus/gnus-dbus.el @@ -0,0 +1,68 @@ +;;; gnus-dbus.el --- DBUS integration for Gnus -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Eric Abrahamsen + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This library contains some Gnus integration for systems using DBUS. +;; At present it registers a signal to close all Gnus servers before +;; system sleep or hibernation. + +;;; Code: + +(require 'gnus) +(require 'dbus) +(declare-function gnus-close-all-servers "gnus-start") + +(defcustom gnus-dbus-close-on-sleep nil + "When non-nil, close Gnus servers on system sleep." + :group 'gnus-dbus + :type 'boolean) + +(defvar gnus-dbus-sleep-registration-object nil + "Object returned from `dbus-register-signal'. +Used to unregister the signal.") + +(defun gnus-dbus-register-sleep-signal () + "Use `dbus-register-signal' to close servers on sleep." + (when (featurep 'dbusbind) + (setq gnus-dbus-sleep-registration-object + (dbus-register-signal :session + "org.freedesktop.login1" + "/org/freedesktop/login1" + "org.freedesktop.login1.Manager" + "PrepareForSleep" + #'gnus-dbus-sleep-handler)) + (gnus-add-shutdown #'gnus-dbus-unregister-sleep-signal 'gnus))) + +(defun gnus-dbus-sleep-handler (sleep-start) + ;; Sleep-start is t before sleeping. + (when (and sleep-start + (gnus-alive-p)) + (condition-case nil + (gnus-close-all-servers) + (error nil)))) + +(defun gnus-dbus-unregister-sleep-signal () + (condition-case nil + (dbus-unregister-object + gnus-dbus-sleep-registration-object) + (wrong-type-argument nil))) + +(provide 'gnus-dbus) +;;; gnus-dbus.el ends here diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index ba8b91be5c..fe600f107c 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -31,6 +31,7 @@ (require 'gnus-range) (require 'gnus-util) (require 'gnus-cloud) +(require 'gnus-dbus) (autoload 'message-make-date "message") (autoload 'gnus-agent-read-servers-validate "gnus-agent") (autoload 'gnus-agent-save-local "gnus-agent") @@ -798,6 +799,8 @@ prompt the user for the name of an NNTP server to use." (gnus-run-hooks 'gnus-setup-news-hook) (when gnus-agent (gnus-request-create-group "queue" '(nndraft ""))) + (when gnus-dbus-close-on-sleep + (gnus-dbus-register-sleep-signal)) (gnus-start-draft-setup) ;; Generate the group buffer. (gnus-group-list-groups level) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index cecf4d4fb4..f615d49d27 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -292,6 +292,10 @@ is restarted, and sometimes reloaded." :link '(custom-manual "(gnus)Exiting Gnus") :group 'gnus) +(defgroup gnus-dbus nil + "D-Bus integration for Gnus." + :group 'gnus) + (defconst gnus-version-number "5.13" "Version number for this version of Gnus.") commit 0e01d5aa723cd50749f9028f0e8ad85a3afe52aa Author: Štěpán Němec Date: Sun Apr 12 00:27:51 2020 +0200 Preserve setf semantics in 'substring', 'cons', 'logand' expanders * doc/lispref/variables.texi (Adding Generalized Variables): Fix example. * lisp/emacs-lisp/cl-lib.el (substring) * lisp/emacs-lisp/gv.el (cons, logand): Return the value being assigned, as specified for 'setf'. (bug#35546) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index abcd4bbd0f..94c8c88796 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2585,8 +2585,11 @@ implemented this way: (macroexp-let2* nil ((start from) (end to)) (funcall do `(substring ,getter ,start ,end) (lambda (v) - (funcall setter `(cl--set-substring - ,getter ,start ,end ,v)))))))) + (macroexp-let2 nil v v + `(progn + ,(funcall setter `(cl--set-substring + ,getter ,start ,end ,v)) + ,v)))))))) @end example @end defmac diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 7a26d9a90f..7a4d3c9c3e 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -619,8 +619,11 @@ If ALIST is non-nil, the new pairs are prepended to it." (macroexp-let2* nil ((start from) (end to)) (funcall do `(substring ,getter ,start ,end) (lambda (v) - (funcall setter `(cl--set-substring - ,getter ,start ,end ,v)))))))) + (macroexp-let2 nil v v + `(progn + ,(funcall setter `(cl--set-substring + ,getter ,start ,end ,v)) + ,v)))))))) ;;; Miscellaneous. diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 513bd32889..78d86b9fc3 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -527,9 +527,12 @@ This macro only makes sense when used in a place." (gv-letplace (dgetter dsetter) d (funcall do `(cons ,agetter ,dgetter) - (lambda (v) `(progn - ,(funcall asetter `(car ,v)) - ,(funcall dsetter `(cdr ,v))))))))) + (lambda (v) + (macroexp-let2 nil v v + `(progn + ,(funcall asetter `(car ,v)) + ,(funcall dsetter `(cdr ,v)) + ,v)))))))) (put 'logand 'gv-expander (lambda (do place &rest masks) @@ -539,9 +542,12 @@ This macro only makes sense when used in a place." (funcall do `(logand ,getter ,mask) (lambda (v) - (funcall setter - `(logior (logand ,v ,mask) - (logand ,getter (lognot ,mask)))))))))) + (macroexp-let2 nil v v + `(progn + ,(funcall setter + `(logior (logand ,v ,mask) + (logand ,getter (lognot ,mask)))) + ,v)))))))) ;;; References commit f3e29733bbe63950b3ef1259744723193ff5f388 Author: Lars Ingebrigtsen Date: Tue Aug 25 17:07:39 2020 +0200 Tweak the file/buffer comparison from previous save-some-buffers change * lisp/files.el (save-some-buffers): Relax the "similarity" regexp from the previous regexp: Don't show both file and buffer names if the file is /tmp/foo and the buffer name is foo. diff --git a/lisp/files.el b/lisp/files.el index f1931c7d92..9a20ad41ba 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5575,7 +5575,7 @@ change the additional actions you can take on files." (regexp-quote (file-name-nondirectory buffer-file-name)) - "<[0-9]+>\\'") + "<[^>]*>\\'") (buffer-name buffer))) ;; The buffer name is similar to the ;; file name. commit 7445560d0cd4d94f93988d51a98bdba465173f44 Author: Lars Ingebrigtsen Date: Tue Aug 25 16:57:53 2020 +0200 Fix problem with folded Gcc headers in Gnus * lisp/gnus/gnus-msg.el (gnus-inews-do-gcc): Tokenize the gcc header properly (there may be newlines and tabs in the separators) (bug#43036). diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index cdfbf16db5..e770abc2cd 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1598,7 +1598,7 @@ this is a reply." (message-remove-header "gcc") (widen) (setq groups (message-unquote-tokens - (message-tokenize-header gcc " ,"))) + (message-tokenize-header gcc " ,\n\t"))) ;; Copy the article over to some group(s). (while (setq group (pop groups)) (setq method (gnus-inews-group-method group) commit 6d10b607d094bfd29b9ce0c4baf469e3683c3ac6 Author: Lars Ingebrigtsen Date: Tue Aug 25 16:47:10 2020 +0200 Possibly mention both file and buffer names in save-some-buffers * lisp/files.el (save-some-buffers): If the file and buffer names are dissimilar, mention both their names (bug#8399). diff --git a/lisp/files.el b/lisp/files.el index b6abafa4bd..f1931c7d92 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5566,10 +5566,28 @@ change the additional actions you can take on files." t (setq queried t) (if (buffer-file-name buffer) - (format "Save file %s? " - (buffer-file-name buffer)) - (format "Save buffer %s? " - (buffer-name buffer)))))) + (if (or + (equal (buffer-name buffer) + (file-name-nondirectory + (buffer-file-name buffer))) + (string-match + (concat "\\<" + (regexp-quote + (file-name-nondirectory + buffer-file-name)) + "<[0-9]+>\\'") + (buffer-name buffer))) + ;; The buffer name is similar to the + ;; file name. + (format "Save file %s? " + (buffer-file-name buffer)) + ;; The buffer and file names are + ;; dissimilar; display both. + (format "Save file %s (buffer %s)? " + (buffer-file-name buffer) + (buffer-name buffer))) + ;; No file name + (format "Save buffer %s? " (buffer-name buffer)))))) (lambda (buffer) (with-current-buffer buffer (save-buffer))) commit e8db980dcb50bf1883b3d456a8e070baae83a2d7 Author: Lars Ingebrigtsen Date: Tue Aug 25 16:36:15 2020 +0200 Don't bug out in gnus-icalendar when there no recurring event * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event:recurring-days): Fix previous patch (bug#43038) -- don't bug out when there's no recurring event. diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el index f13d4dec01..da41b08c71 100644 --- a/lisp/gnus/gnus-icalendar.el +++ b/lisp/gnus/gnus-icalendar.el @@ -148,7 +148,7 @@ ("TH" . 4) ("FR" . 5) ("SA" . 6)))) - (when (string-match "BYDAY=\\([^;]+\\)" rrule) + (when (and rrule (string-match "BYDAY=\\([^;]+\\)" rrule)) (let ((bydays (split-string (match-string 1 rrule) ","))) (seq-map (lambda (x) (cdr (assoc x weekday-map))) commit 665fe1c18594dbc817c674898cf102e3e390c112 Merge: f9754ef74a 642c921f4e Author: Michael Albinus Date: Tue Aug 25 16:27:09 2020 +0200 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit f9754ef74a0afea1ea46e06ec39e09f094152df6 Author: Michael Albinus Date: Tue Aug 25 15:19:11 2020 +0200 * admin/admin.el (reminder-for-release-blocking-bugs): New command. diff --git a/admin/admin.el b/admin/admin.el index 310cd54e95..728aab8b1a 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -921,6 +921,51 @@ changes (in a non-trivial way). This function does not check for that." 'help-echo "Mouse-2: visit this definition" :type 'cusver-xref))))))) + +;; Reminder message for open release-blocking bugs. This requires the +;; GNU ELPA package `debbugs'. + +(defun reminder-for-release-blocking-bugs (version) + "Submit a reminder message for release-blocking bugs of Emacs VERSION." + (interactive + (list (completing-read + "Emacs release: " + (mapcar #'identity debbugs-gnu-emacs-blocking-reports) + nil t debbugs-gnu-emacs-current-release))) + + (require 'reporter) + (require 'debbugs-gnu) + + (when-let ((id (alist-get version debbugs-gnu-emacs-blocking-reports + nil nil #'string-equal)) + (status-id (debbugs-get-status id)) + (blockedby-ids (debbugs-get-attribute (car status-id) 'blockedby)) + (blockedby-status + (apply #'debbugs-get-status (sort blockedby-ids #'<)))) + + (reporter-submit-bug-report + "" ; to-address + nil nil nil + (lambda () ; posthook + (goto-char (point-min)) + (mail-position-on-field "subject") + (insert (format "Release-blocking bugs for Emacs %s" version)) + (mail-text) + (delete-region (point) (point-max)) + (insert " +The following bugs are regarded as release-blocking for Emacs " version ". +People are encouraged to work on them with priority.\n\n") + (dolist (_ blockedby-status) + (unless (equal (debbugs-get-attribute _ 'pending) "done") + (insert (format "bug#%d %s\n" + (debbugs-get-attribute _ 'id) + (debbugs-get-attribute _ 'subject))))) + (insert " +If you use the debbugs package from GNU ELPA, you can apply the +following form to see all bugs which block a given release: + + (debbugs-gnu-emacs-release-blocking-reports \"" version "\")\n"))))) + (provide 'admin) ;;; admin.el ends here commit 642c921f4ec7ffdcc5b599e2381318f84dade436 Author: Lars Ingebrigtsen Date: Tue Aug 25 16:22:07 2020 +0200 remove-overlays doc clarification * lisp/subr.el (remove-overlays): Doc fix (bug#13648). diff --git a/lisp/subr.el b/lisp/subr.el index a58a873a33..660367642a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3071,9 +3071,17 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." o1)) (defun remove-overlays (&optional beg end name val) - "Clear BEG and END of overlays whose property NAME has value VAL. -Overlays might be moved and/or split. -BEG and END default respectively to the beginning and end of buffer." + "Remove overlays between BEG and END that have property NAME with value VAL. +Overlays might be moved and/or split. If any targeted overlays +start before BEG, the overlays will be altered so that they end +at BEG. Likewise, if the targeted overlays end after END, they +will be altered so that they start at END. Overlays that start +at or after BEG and end before END will be removed completely. + +BEG and END default respectively to the beginning and end of the +buffer. +Values are compared with `eq'. +If either NAME or VAL are specified, both should be specified." ;; This speeds up the loops over overlays. (unless beg (setq beg (point-min))) (unless end (setq end (point-max))) commit 1165618288b5425361a92e3c042deb4b08912458 Author: Lars Ingebrigtsen Date: Tue Aug 25 14:42:22 2020 +0200 Doc fix for copy-directory * lisp/files.el (copy-directory): PARENTS is no longer the last argument. diff --git a/lisp/files.el b/lisp/files.el index 873f362dd5..b6abafa4bd 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5897,9 +5897,9 @@ last-modified time as the old ones. (This works on only some systems.) A prefix arg makes KEEP-TIME non-nil. -Noninteractively, the last argument PARENTS says whether to -create parent directories if they don't exist. Interactively, -this happens by default. +Noninteractively, the PARENTS argument says whether to create +parent directories if they don't exist. Interactively, this +happens by default. If NEWNAME is a directory name, copy DIRECTORY as a subdirectory there. However, if called from Lisp with a non-nil optional commit 36f2f67c96d44c82ce31dafb38cd4e2622a5a372 Merge: 478c2e2362 44104a607a Author: Michael Albinus Date: Tue Aug 25 15:29:38 2020 +0200 Merge from origin/emacs-27 44104a607a Fix error in GMP test e26e63444d Add Feature testing for Windows binaries 4e2caef384 ; * src/character.c (str_as_multibyte): Fix the commentary. d3a4ce8420 Revert "; * etc/NEWS: Remove temporary note on documentati... 16f00e36dc * admin/admin.el (set-version): Trap yet another NEWS error. 121be3e118 ; * etc/NEWS: Remove temporary note on documentation. (Bu... 5fcb97dabd Fix cond jump table compilation (bug#42919) commit 478c2e23620eeda65030458762a843231f7e9b35 Author: Eli Zaretskii Date: Tue Aug 25 16:03:51 2020 +0300 ; * lisp/info.el (Info-up): Fix a typo in a comment. diff --git a/lisp/info.el b/lisp/info.el index fc04099e7e..8810bc7a83 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2309,7 +2309,7 @@ If SAME-FILE is non-nil, do not move to a different Info file." (progn (beginning-of-line) (if (looking-at "^\\* ") (forward-char 2))) (goto-char p) (Info-restore-point Info-history)))) - ;; If scroll-conservatively is non-zerop and less than 101, display + ;; If scroll-conservatively is non-zero and less than 101, display ;; as much of the superior node above the target line as possible. (when (< 0 scroll-conservatively 101) (recenter))) commit 1064b2f65ecc9b09e4ede3d8a614b9948e179aa4 Author: Lars Ingebrigtsen Date: Tue Aug 25 13:57:00 2020 +0200 Extend background colours in shr * lisp/net/shr.el (shr-colorize-region): Extend backgrounds to the end (bug#43031). This avoid ragged edges to the right when, for instance, the has a bgcolor. (shr-face-background): Ditto. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 24595301b7..8fdc758032 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1315,7 +1315,7 @@ ones, in case fg and bg are nil." t)) (when bg (add-face-text-property start end - (list :background (car new-colors)) + (list :background (car new-colors) :extend t) t))) new-colors))) @@ -2250,7 +2250,7 @@ flags that control whether to collect or render objects." (not background)) (setq background (cadr elem)))) (and background - (list :background background)))))) + (list :background background :extend t)))))) (defun shr-expand-alignments (start end) (while (< (setq start (next-single-property-change commit 71209b231a806bcc23f4fbe44a5fe54583809889 Author: Stephen Berman Date: Tue Aug 25 13:30:58 2020 +0200 Tweak how "u" works in Info buffers when scroll-conservatively is set * info.el (Info-up): If scroll-conservatively is non-zero and less than 101, display as much of the superior node above the target line as possible (Bug#13690). diff --git a/lisp/info.el b/lisp/info.el index 78f88947c7..fc04099e7e 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2308,7 +2308,11 @@ If SAME-FILE is non-nil, do not move to a different Info file." nil t)) (progn (beginning-of-line) (if (looking-at "^\\* ") (forward-char 2))) (goto-char p) - (Info-restore-point Info-history))))) + (Info-restore-point Info-history)))) + ;; If scroll-conservatively is non-zerop and less than 101, display + ;; as much of the superior node above the target line as possible. + (when (< 0 scroll-conservatively 101) + (recenter))) (defun Info-history-back () "Go back in the history to the last node visited." commit 764bad713e1040cc714b602678009f30c4806fe8 Author: Lars Ingebrigtsen Date: Tue Aug 25 13:14:00 2020 +0200 Make shadowing warning in describe_map less confusing * src/keymap.c (describe_map): A binding may be shadowed by something else than a mode (bug#14086) (just a `define-key' works), so don't say that it's a mode that shadows it. diff --git a/src/keymap.c b/src/keymap.c index d98b27b7a1..0608bdddee 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -3277,7 +3277,7 @@ describe_map (Lisp_Object map, Lisp_Object prefix, ptrdiff_t pt = max (PT - 1, BEG); SET_PT (pt); - insert_string ("\n (that binding is currently shadowed by another mode)"); + insert_string ("\n (this binding is currently shadowed)"); pt = min (PT + 1, Z); SET_PT (pt); } commit 44104a607aeb7fd73bf7edcbbe6a508eee36dd0f Author: Phillip Lord Date: Mon Aug 24 22:44:21 2020 +0100 Fix error in GMP test * etc/w32-feature.el: Update to use system-configuration-features for GMP test. diff --git a/etc/w32-feature.el b/etc/w32-feature.el index 458a24350d..3c0f74175c 100644 --- a/etc/w32-feature.el +++ b/etc/w32-feature.el @@ -53,7 +53,7 @@ (ert-deftest feature-gmp () (should - (string-match-p "GMP" system-configuration-options))) + (string-match-p "GMP" system-configuration-features))) (ert-deftest feature-module () (should (fboundp 'module-load))) commit e26e63444d38933809b82b1577313b4343b4f38b Author: Phillip Lord Date: Mon Aug 24 22:14:01 2020 +0100 Add Feature testing for Windows binaries * etc/w32-feature.el: New file diff --git a/etc/w32-feature.el b/etc/w32-feature.el new file mode 100644 index 0000000000..458a24350d --- /dev/null +++ b/etc/w32-feature.el @@ -0,0 +1,87 @@ +;;; w32-feature.el --- Check Availability of Emacs Features -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Phillip Lord + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; This file provides tests for various features of Emacs. It is +;; designed to check whether bundled binary distributions of Emacs on +;; windows are fully functional. + +;;; Code: +(require 'ert) + +(ert-deftest feature-optimization () + (should + (string-match-p "CFLAGS=-O2" system-configuration-options))) + +(ert-deftest feature-harfbuzz () + (should + (eq + 'harfbuzz + (car (frame-parameter nil 'font-backend))))) + +(ert-deftest feature-gnutls () + (should (gnutls-available-p))) + +(ert-deftest feature-zlib () + (should (zlib-available-p))) + +(ert-deftest feature-thread () + (should (fboundp 'make-thread))) + +(ert-deftest feature-json () + (should + (fboundp 'json-serialize))) + +(ert-deftest feature-gmp () + (should + (string-match-p "GMP" system-configuration-options))) + +(ert-deftest feature-module () + (should (fboundp 'module-load))) + +(ert-deftest feature-libxml () + (should (libxml-available-p))) + +(ert-deftest feature-lcms2 () + (should (lcms2-available-p))) + +(ert-deftest feature-xpm () + (should (image-type-available-p 'xpm))) + +(ert-deftest feature-gif () + (should (image-type-available-p 'gif))) + +(ert-deftest feature-png () + (should (image-type-available-p 'png))) + +(ert-deftest feature-xpm () + (should (image-type-available-p 'xpm))) + +(ert-deftest feature-jpeg () + (should (image-type-available-p 'jpeg))) + +(ert-deftest feature-tiff () + (should (image-type-available-p 'tiff))) + +(ert-deftest feature-svg () + (should (image-type-available-p 'svg))) +;;; feature.el ends here commit 4e2caef38499873ef801029e30357a023e939929 Author: Eli Zaretskii Date: Fri Aug 21 18:15:05 2020 +0300 ; * src/character.c (str_as_multibyte): Fix the commentary. diff --git a/src/character.c b/src/character.c index 5d419a2e83..97065e17f0 100644 --- a/src/character.c +++ b/src/character.c @@ -550,9 +550,9 @@ parse_str_as_multibyte (const unsigned char *str, ptrdiff_t len, /* Arrange unibyte text at STR of NBYTES bytes as a multibyte text. It actually converts only such 8-bit characters that don't construct - a multibyte sequence to multibyte forms of Latin-1 characters. If - NCHARS is nonzero, set *NCHARS to the number of characters in the - text. It is assured that we can use LEN bytes at STR as a work + a multibyte sequence to multibyte forms of raw bytes. If NCHARS + is nonzero, set *NCHARS to the number of characters in the text. + It is assured that we can use LEN bytes at STR as a work area and that is enough. Return the number of bytes of the resulting text. */ commit d3a4ce84201c5ea837cc2ddeba2fa01d67f7e6ab Author: Stefan Kangas Date: Wed Aug 19 20:57:22 2020 +0200 Revert "; * etc/NEWS: Remove temporary note on documentation. (Bug#42917)" This reverts commit 121be3e1181e609734fc4cc9d2d54cf7eec18ab2. diff --git a/etc/NEWS b/etc/NEWS index c44b5137c5..2571108c9e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -15,6 +15,12 @@ in older Emacs versions. You can narrow news to a specific version by calling 'view-emacs-news' with a prefix argument or by typing 'C-u C-h C-n'. +Temporary note: ++++ indicates that all relevant manuals in doc/ have been updated. +--- means no change in the manuals is needed. +When you add a new item, use the appropriate mark if you are sure it +applies, and please also update docstrings as needed. + * Installation Changes in Emacs 27.2 commit 16f00e36dc2292db08e7bc88bd25e55c0cbf99f7 Author: Glenn Morris Date: Wed Aug 19 20:52:08 2020 +0100 * admin/admin.el (set-version): Trap yet another NEWS error. diff --git a/admin/admin.el b/admin/admin.el index 923f010082..310cd54e95 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -151,7 +151,7 @@ Root must be the root of an Emacs source tree." (display-warning 'admin "NEWS file contains empty sections - remove them?")) (goto-char (point-min)) - (if (re-search-forward "^\\(\\+\\+\\+ *\\|--- *\\)$" nil t) + (if (re-search-forward "^\\(\\+\\+\\+ *$\\|--- *$\\|Temporary note:\\)" nil t) (display-warning 'admin "NEWS file still contains temporary markup. Documentation changes might not have been completed!")))) commit 121be3e1181e609734fc4cc9d2d54cf7eec18ab2 Author: Stefan Kangas Date: Wed Aug 19 19:51:52 2020 +0200 ; * etc/NEWS: Remove temporary note on documentation. (Bug#42917) diff --git a/etc/NEWS b/etc/NEWS index f1f4151ab2..c44b5137c5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -15,12 +15,6 @@ in older Emacs versions. You can narrow news to a specific version by calling 'view-emacs-news' with a prefix argument or by typing 'C-u C-h C-n'. -Temporary note: -+++ indicates that all relevant manuals in doc/ have been updated. ---- means no change in the manuals is needed. -When you add a new item, use the appropriate mark if you are sure it -applies, and please also update docstrings as needed. - * Installation Changes in Emacs 27.2 @@ -53,7 +47,6 @@ This is a bug-fix release with no new features. * Installation Changes in Emacs 27.1 ---- ** Emacs now uses GMP, the GNU Multiple Precision library. By default, if 'configure' does not find a suitable libgmp, it arranges for the included mini-gmp library to be built and used. @@ -87,7 +80,6 @@ that building with Cairo enabled results in using Pango instead of libXft for font support, and that Pango 1.44 has removed support for bitmapped fonts. -+++ ** Emacs now uses a "portable dumper" instead of unexec. This improves compatibility with memory allocation on modern systems, and in particular better supports the Address Space Layout commit 5fcb97dabd3f7b00ebc574d6be4bad16a64482de Author: Mattias Engdegård Date: Wed Aug 19 14:59:29 2020 +0200 Fix cond jump table compilation (bug#42919) This bug affected compilation of (cond ((member '(some list) variable) ...) ...) While equal is symmetric, member is not; in the latter case the arguments must be a variable and a constant list, in that order. Reported by Ikumi Keita. * lisp/emacs-lisp/bytecomp.el (byte-compile--cond-switch-prefix): Don't treat equality and member predicates in the same way; only the former are symmetric in their arguments. * test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data): Add test cases. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 5479e6536a..90745a3a2f 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -4172,40 +4172,44 @@ Return (TAIL VAR TEST CASES), where: (switch-var nil) (switch-test 'eq)) (while (pcase (car clauses) - (`((,fn ,expr1 ,expr2) . ,body) + (`((,(and fn (or 'eq 'eql 'equal)) ,expr1 ,expr2) . ,body) (let* ((vars (byte-compile--cond-vars expr1 expr2)) (var (car vars)) (value (cdr vars))) (and var (or (eq var switch-var) (not switch-var)) - (cond - ((memq fn '(eq eql equal)) + (progn (setq switch-var var) (setq switch-test (byte-compile--common-test switch-test fn)) (unless (member value keys) (push value keys) (push (cons (list value) (or body '(t))) cases)) - t) - ((and (memq fn '(memq memql member)) - (listp value) - ;; Require a non-empty body, since the member - ;; function value depends on the switch - ;; argument. - body) - (setq switch-var var) - (setq switch-test - (byte-compile--common-test - switch-test (cdr (assq fn '((memq . eq) - (memql . eql) - (member . equal)))))) - (let ((vals nil)) - (dolist (elem value) - (unless (funcall fn elem keys) - (push elem vals))) - (when vals - (setq keys (append vals keys)) - (push (cons (nreverse vals) body) cases))) - t)))))) + t)))) + (`((,(and fn (or 'memq 'memql 'member)) ,var ,expr) . ,body) + (and (symbolp var) + (or (eq var switch-var) (not switch-var)) + (macroexp-const-p expr) + ;; Require a non-empty body, since the member + ;; function value depends on the switch argument. + body + (let ((value (eval expr))) + (and (proper-list-p value) + (progn + (setq switch-var var) + (setq switch-test + (byte-compile--common-test + switch-test + (cdr (assq fn '((memq . eq) + (memql . eql) + (member . equal)))))) + (let ((vals nil)) + (dolist (elem value) + (unless (funcall fn elem keys) + (push elem vals))) + (when vals + (setq keys (append vals keys)) + (push (cons (nreverse vals) body) cases))) + t)))))) (setq clauses (cdr clauses))) ;; Assume that a single switch is cheaper than two or more discrete ;; compare clauses. This could be tuned, possibly taking into diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index a16adfedfb..3aba9af3e7 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -347,7 +347,20 @@ ((eq x 't) 99) (t 999)))) '((a c) (b c) (7 c) (-3 c) (nil nil) (t c) (q c) (r c) (s c) - (t c) (x "a") (x "c") (x c) (x d) (x e)))) + (t c) (x "a") (x "c") (x c) (x d) (x e))) + + (mapcar (lambda (x) (cond ((member '(a . b) x) 1) + ((equal x '(c)) 2))) + '(((a . b)) a b (c) (d))) + (mapcar (lambda (x) (cond ((memq '(a . b) x) 1) + ((equal x '(c)) 2))) + '(((a . b)) a b (c) (d))) + (mapcar (lambda (x) (cond ((member '(a b) x) 1) + ((equal x '(c)) 2))) + '(((a b)) a b (c) (d))) + (mapcar (lambda (x) (cond ((memq '(a b) x) 1) + ((equal x '(c)) 2))) + '(((a b)) a b (c) (d)))) "List of expression for test. Each element will be executed by interpreter and with bytecompiled code, and their results compared.")