1. 26 Nov, 2020 1 commit
    • Mattias Engdegård's avatar
      Fix replace-regexp-in-string substring match data translation · 558b6dbc
      Mattias Engdegård authored
      For certain patterns, re-matching the same regexp on the matched
      substring does not produce correctly translated match data
      (bug#15107 and bug#44861).
      
      Using a new builtin function also improves performance since the
      number of calls to string-match is halved.
      
      Reported by Kevin Ryde and Shigeru Fukaya.
      
      * lisp/subr.el (replace-regexp-in-string): Translate the match data
      using match-data--translate instead of trusting a call to string-match
      on the matched string to do the job.
      * test/lisp/subr-tests.el (subr-replace-regexp-in-string):
      Add test cases.
      * src/search.c (Fmatch_data__translate): New internal function.
      (syms_of_search): Register it as a subroutine.
      558b6dbc
  2. 25 Nov, 2020 2 commits
  3. 24 Nov, 2020 2 commits
  4. 23 Nov, 2020 1 commit
  5. 22 Nov, 2020 4 commits
    • Philipp Stephani's avatar
      Unbreak compilation with CHECK_STRUCTS. · edd949a3
      Philipp Stephani authored
      Commit 3963aea4 modified the ‘buffer’
      structure, but didn’t adapt the hash.
      
      * src/pdumper.c (dump_buffer): Update buffer hash.
      edd949a3
    • Stefan Kangas's avatar
      Say which command shadows a key binding · fb9326b4
      Stefan Kangas authored
      * src/keymap.c (describe_vector): Say which command shadows this
      binding.  (Bug#9293)
      * test/src/keymap-tests.el
      (help--describe-vector/bug-9293-one-shadowed-in-range): Adapt
      test.
      fb9326b4
    • Stefan Kangas's avatar
      Don't shadow bindings by the same command · 84dd5c9b
      Stefan Kangas authored
      * src/keymap.c (describe_vector): Do not say binding is shadowed if
      the other key binding points to the same command.  (Bug#9293)
      * test/src/keymap-tests.el
      (help--describe-vector/bug-9293-same-command-does-not-shadow): New
      test.
      84dd5c9b
    • Stefan Kangas's avatar
      Don't show key ranges if shadowed by different commands · a6490343
      Stefan Kangas authored
      * src/keymap.c (describe_vector): Make sure found consecutive keys
      are either not shadowed or, if they are, that they are shadowed by
      the same command.  (Bug#9293)
      * test/src/keymap-tests.el
      (help--describe-vector/bug-9293-one-shadowed-in-range): New test.
      a6490343
  6. 21 Nov, 2020 3 commits
  7. 20 Nov, 2020 1 commit
  8. 19 Nov, 2020 6 commits
    • Lars Ingebrigtsen's avatar
      Avoid a compilation warning about an ambiguous else · bc951000
      Lars Ingebrigtsen authored
      * src/data.c (set_internal): Avoid compilation warning.
      
      data.c:1443:9: error: suggest explicit braces to avoid ambiguous ‘else’
       1443 |      if (idx > 0 && bindflag == SET_INTERNAL_SET
            |         ^
      bc951000
    • Stefan Monnier's avatar
      * src/data.c (set_internal): Fix bug#44733 · 8fac2444
      Stefan Monnier authored
      Set the default value when `set` encounters a PER_BUFFER variable
      which has been let-bound globally, to match the behavior seen with
      `make-variable-buffer-local`.
      
      * test/src/data-tests.el (binding-test--let-buffer-local):
      Add corresponding test.
      (data-tests--set-default-per-buffer): Add tentative test for the
      performance problem encountered in bug#41029.
      8fac2444
    • Eli Zaretskii's avatar
      Improve documentation of 'font-spec' · f641ef1a
      Eli Zaretskii authored
      * doc/lispref/display.texi (Low-Level Font):
      * src/font.c (Ffont_spec): Document 'font-spec' keys that are
      supported, but were undocumented.
      f641ef1a
    • Stefan Monnier's avatar
      * src/buffer.h (struct buffer): Remove unused field `minor_modes` · 3963aea4
      Stefan Monnier authored
      * src/buffer.c (bset_minor_modes): Remove function.
      (reset_buffer_local_variables, init_buffer_once): Don't set `minor_modes`.
      3963aea4
    • Mattias Engdegård's avatar
      More string-search optimisations · 90aab73f
      Mattias Engdegård authored
      All-ASCII strings cannot have substrings with non-ASCII characters in
      them; use this fact to avoid searching entirely.
      
      * src/fns.c (Fstring_search): For multibyte non-ASCII needle and
      unibyte haystack, don't check if the haystack is all-ASCII; it's a
      waste of time. For multibyte non-ASCII needle and multibyte
      all-ASCII haystack, fail immediately.
      * test/src/fns-tests.el (string-search): Add more test cases.
      90aab73f
    • Alan Mackenzie's avatar
      In attempted recursive minibuffer use, display error message in correct frame · 6e469709
      Alan Mackenzie authored
      This was problematic when minibuffer-follows-selected-frame was non-nil.
      Introduce a new parameter DONT-SET-FRAME to set-window-configuration.
      
      * doc/lispref/windows.texi (Window Configurations): Describe the new &optional
      parameter to set-window-configuration.
      
      * etc/NEWS (Lisp Changes): Note the new parameter to set-window-configuration.
      
      * src/keyboard.c (read_char_help_form_unwind): Add a new Qnil argument to the
      call of Fset_window_configuration.
      
      * src/minibuf.c (read_minibuf): Cons up a Qt with the window configuration in
      the argument to record_unwind_protect for the window configuration (twice).
      
      * src/window.c (Fset_window_configuration): Add the new &optional parameter
      and document it in the doc string.  At the final do_switch_frame operation,
      restore the original frame when DONT-SET-FRAME is non-nil.
      (restore_window_configuration): Handle the new parameter when the supplied
      argument is a cons.
      6e469709
  9. 18 Nov, 2020 1 commit
  10. 15 Nov, 2020 1 commit
    • Stefan Kangas's avatar
      Make initial frame match frame-title-format · 36431e16
      Stefan Kangas authored
      * src/xterm.c (x_term_init):
      * src/w32term.c (w32_initialize_display_info): Sync initial frame
      title with new value of Vframe_title_format.
      Problem reported by Angelo Graziosi <angelo.g0@libero.it>.
      36431e16
  11. 14 Nov, 2020 6 commits
    • Akira Kyle's avatar
      Work around glib messing with signal handlers more than it should · e71f5f1f
      Akira Kyle authored
      * src/process.c (init_process_emacs): force glib's g_unix_signal
      handler into lib_child_handler where it should belong.
      
      Copyright-paperwork-exempt: yes
      e71f5f1f
    • Eli Zaretskii's avatar
      Don't leave lock files after 'replace-buffer-contents' · e2c7b637
      Eli Zaretskii authored
      * src/editfns.c (Freplace_buffer_contents): Unlock the buffer's
      file if no changes have been made.  (Bug#44303)
      
      (cherry picked from commit a5867ddf)
      e2c7b637
    • Philipp Stephani's avatar
      Capitalize portable dump messages. · b13e87c3
      Philipp Stephani authored
      We capitalize all other messages during the dump, so capitalize the
      "dump mode" and "dumping fingerprint" ones as well for consistency.
      
      * src/pdumper.c (Fdump_emacs_portable): Capitalize fingerprint message
      prefix.
      
      * lisp/loadup.el: Capitalize "dump mode" message.
      b13e87c3
    • Jared Finder's avatar
      Face-changing text properties and help-echo now work with xterm-mouse. · 91d5edd9
      Jared Finder authored
      * src/dispnew.c (update_mouse_position): New function for mouse
      movement logic in 'handle_one_term_event' that can be shared across
      different mouse backends.
      (display--update-for-mouse-movement): New lisp function, call it.
      * lisp/xt-mouse.el (xterm-mouse--handle-mouse-movement): New function
      that calls 'display--update-for-mouse-movement'.
      (xterm-mouse-translate-1): Call it.
      * src/term.c (handle_one_term_event): Inline logic from
      'term_mouse_movement' and call 'update_mouse_position'.
      (term_mouse_movement): Delete.
      91d5edd9
    • Eli Zaretskii's avatar
      Fix display of truncated R2L lines on TTY frames · 5aabf2cc
      Eli Zaretskii authored
      * src/xdisp.c (extend_face_to_end_of_line): Use a while-loop, not
      a do-while loop, to avoid appending an extra glyph at the end of a
      line that is one character shorter than the window-width.  This is
      needed to fix display of reversed glyph rows that are almost as
      wide as the window, because append_space_for_newline already added
      one space glyph.
      5aabf2cc
    • Eli Zaretskii's avatar
      Avoid crashes when a reversed glyph row starts with a composition · daff3bda
      Eli Zaretskii authored
      * src/dispnew.c (build_frame_matrix_from_leaf_window): Add an
      assertion to prevent us from overwriting non-char glyphs with the
      vertical border glyph.
      * src/xdisp.c (extend_face_to_end_of_line): Account for one glyph
      possibly inserted by append_space_for_newline.  (Bug#44506)
      Remove a kludgey correction for an off-by-one error in column
      counting, which is no longer needed.
      daff3bda
  12. 13 Nov, 2020 1 commit
  13. 12 Nov, 2020 1 commit
    • Stefan Kangas's avatar
      Fix mistake in describe-buffer-bindings · ccf25760
      Stefan Kangas authored
      * src/keymap.c (Fdescribe_buffer_bindings): Fix a call in
      describe-buffer-bindings.  This fixes a mistake in my previous commit
      to prefer the Lisp version of describe-map-tree (8a144131), where
      0 was accidentally converted to Qt in two places.
      ccf25760
  14. 11 Nov, 2020 1 commit
  15. 10 Nov, 2020 2 commits
  16. 09 Nov, 2020 7 commits
    • Philipp Stephani's avatar
      Fix undefined behavior when fetching glyphs from the display vector. · 109eb1e7
      Philipp Stephani authored
      You can trigger this rather obscure bug by enabling selective display
      if the second glyph in its display vector has an invalid face.  For
      example, evaluate
      
      (set-display-table-slot standard-display-table
                              'selective-display [?A (?B . invalid)])
      
      and then enable selective display.
      
      * src/xdisp.c (next_element_from_display_vector): Check whether next
      glyph code is valid before accessing it.
      109eb1e7
    • Stefan Kangas's avatar
      Simplify getting value of text-quoting-style (Bug#44471) · 95c04675
      Stefan Kangas authored
      * src/doc.c (text_quoting_style): Remove function by merging it...
      (Ftext_quoting_style): ...here.  Rename from Fget_quoting_style.
      (syms_of_doc): Update defsubr for Ftext_quoting_style.
      * src/lisp.h (enum text_quoting_style): Remove enum.
      * src/doprnt.c (doprnt):
      * src/editfns.c (styled_format):
      * lisp/help.el (substitute-command-keys): Update callers to use
      text-quoting-style.
      95c04675
    • Alan Third's avatar
      Fix css length calculations · 52937958
      Alan Third authored
      * src/image.c (svg_css_length_to_pixels): Put in missing breaks where
      necessary.
      52937958
    • Eli Zaretskii's avatar
      Fix compilation of image.c on MS-Windows · 3de31e7b
      Eli Zaretskii authored
      This is a followup to last change in image.c.
      * src/image.c (rsvg_handle_get_intrinsic_dimensions): Define to
      call fn_rsvg_handle_get_intrinsic_dimensions.
      (svg_css_length_to_pixels): Compile only for librsvg >= 2.46.0, as
      RsvgLength type was not defined before.
      3de31e7b
    • Eli Zaretskii's avatar
      Avoid breaking Arabic shaping in 'window-text-pixel-size' · 13ab70c8
      Eli Zaretskii authored
      * src/xdisp.c (CHAR_COMPOSED_P): If the bidi_p flag is not set,
      pass -1 to composition_reseat_it, so that the shaping engine will
      figure out the directionality of the text.  This is important,
      e.g., when using move_it_* functions in some context that is not
      redisplay, such as 'window-text-pixel-size'.  (Bug#44521)
      13ab70c8
    • Alan Third's avatar
      Fix crash in ns_mouse_position (bug#44313) · 18a7267c
      Alan Third authored
      * src/nsterm.m (ns_destroy_window): Close the window before freeing
      the frame resources so we don't end up accessing the frame struct
      after it's been freed.
      18a7267c
    • Alan Third's avatar
      Calculate SVG image sizes more accurately (bug#44206) · 4469e0de
      Alan Third authored
      * src/image.c (svg_css_length_to_pixels): New function.
      (svg_load_image): Try more methods to work out the image size.
      4469e0de