1. 10 Jun, 2018 7 commits
    • Paul Eggert's avatar
      Simplify read_key_sequence · efa750e6
      Paul Eggert authored
      * src/keyboard.c (READ_KEY_ELTS): New constant.
      (keyremap_step, read_key_sequence): Omit BUFSIZE arg, since it's
      always READ_KEY_ELTS.  All callers changed.
      (grow_bool_vector): Remove; no longer needed.
      (read_key_sequence): Use a bool array instead of a Lisp bool
      vector, since it's small and this puts less pressure on the GC.
    • Daniel Colascione's avatar
      Unbreak echoing · cace203d
      Daniel Colascione authored
      * src/keyboard.c (read_key_sequence): Don't echo_truncate the first time.
    • Paul Eggert's avatar
      Fix pointer misuse in JSON parser · 3e3e23fb
      Paul Eggert authored
      * src/json.c (lisp_to_json_toplevel_1): Fix pointer misuse not
      caught by C type checking (json_t ** converted to void * where
      the program expected json_t *).  Bug caught on Fedora 28 x86-64 via
      './configure CFLAGS="-g3 -O2 -fsanitize=address" CANNOT_DUMP=yes'.
      Avoid similar problems in the future by rewriting to use
      json_t * instead of json_t **.
    • Daniel Colascione's avatar
      Correctly set last_nonmenu_event when replaying · d12924ca
      Daniel Colascione authored
      read_key_sequence can, in various circumstances, play back recorded
      events.  Make sure that we set last_nonmenu_event as if we weren't
      replaying.  Without this change, we leave last_nonmenu_event set to
      whatever it was before we started replaying, leading to spurious
      random keymap menu prompts appearing after reading terminal control
      sequences, the translation of which sometimes causes event replays.
      * src/keyboard.c:
      (grow_bool_vector): New function
      (read_key_sequence): Remember menu event history per-event.
    • Daniel Colascione's avatar
      Add debug facility for formatting in rr sessions · aaffae84
      Daniel Colascione authored
      The existing debug print commands don't work in rr, since they touch
      stderr. The new xfmt command just calls Fformat and doesn't touch the
      stdio streams.
      * src/.gdbinit:
      (xfmt): New GDB command.
      * src/print.c:
      (debug_format): New function.
    • Daniel Colascione's avatar
      Fix typo in docstring · 16015dea
      Daniel Colascione authored
      * lisp/term/xterm.el: (xterm-paste-ending-sequence): Fix typo
    • Paul Eggert's avatar
      Fix read buffer overrun on overflowed integers · 1a4c6e69
      Paul Eggert authored
      * src/lread.c (read_integer): Fix off-by-1 buffer overrun
      introduced in 2018-04-17T23:23:16Z!eggert@cs.ucla.edu.  The
      bug could occur when Emacs read radixed integers containing
      more than 100 digits.  Bug caught by AddressSanitizer.
  2. 09 Jun, 2018 11 commits
    • Alan Mackenzie's avatar
      Implement the C++11 "using" type definition. · 89e2683d
      Alan Mackenzie authored
      Cease using the long obsolete c++-template-syntax-table.
      * lisp/progmodes/cc-align.el (c-lineup-template-args): Cease using
      * lisp/progmodes/cc-engine.el (c-beginning-of-inheritance-list)
      (c-search-decl-header-end, c-beginning-of-decl-1, c-end-of-decl-1)
      (c-guess-continued-construct, c-guess-basic-syntax): Cease using
      (c-guess-basic-syntax): Add CASE 5D.6 to handle C++11's "using" type
      * lisp/progmodes/cc-langs.el (c++-make-template-syntax-table)
      (c++-template-syntax-table): Remove.
      (c-equals-type-clause-kwds, c-equals-type-clause-key): New language
    • Daniel Colascione's avatar
      Improve robustness xterm event processing · a66a3b7f
      Daniel Colascione authored
      We used to treat the start of a focus-in, focus-out, and the start of
      a paste sequence as normal events bound in global-map, but this
      approach produces problems when we recognize events in the middle of
      actions that don't immediately dispatch to the command loop.
      Now we handle these events internally inside read-key, translating the
      focus events to nothing and paste-start into an xterm-paste event that
      neatly encapsulates the entire paste sequence.
      * lisp/term/xterm.el:
      (xterm-paste): Accept an event argument; insert text from event.
      (xterm-translate-bracketed-paste): New functions.
      (xterm-handle-focus-in,xterm-handle-focus-out): Remove.
      (xterm-rxvt-function-map): Bind new translation functions.
    • Alan Mackenzie's avatar
      CC Mode: In brace lists, anchor an elt on its predecessor, not on first elt · 66ad9868
      Alan Mackenzie authored
      * lisp/progmodes/cc-engine.el (c-beginning-of-statement-1): At the end, accept
      "." as a unary operator (which it now is in brace lists in, e.g., C Mode).
      (c-guess-basic-syntax): Just before CASE 9C, move back to the previous brace
      list entry in the block, rather than to the first one.
    • Philipp Stephani's avatar
      Make error checking for thread functions stricter. · b4dcac2d
      Philipp Stephani authored
      * src/systhread.c (sys_thread_create): Change return type to bool.
      Check for errors returned by pthread_attr_setstacksize and
      (sys_mutex_init): Abort on errors.  Enable mutex checks when checking
      is enabled.
      (sys_cond_init): Abort on errors.
      (sys_mutex_lock, sys_mutex_unlock, sys_cond_wait)
      (sys_cond_signal, sys_cond_broadcast, sys_cond_destroy): Check for
      errors in debug mode.
    • Eli Zaretskii's avatar
      Allow to reset Deleted flag when exporting messages in Rmail · ca369a8c
      Eli Zaretskii authored
      * lisp/mail/rmailout.el (rmail-output-reset-deleted-flag): New
      (rmail-output): When 'rmail-output-reset-deleted-flag' is non-nil,
      reset the Deleted flag of the appended messages, and if COUNT is
      greater than 1, do not ignore deleted messages.  Update the doc
      string accordingly.  (Bug#31271)
      * doc/emacs/rmail.texi (Rmail Output): Document
      * etc/NEWS: Mention the new user option.
    • Eli Zaretskii's avatar
    • Paul Eggert's avatar
      Remove AddressSanitizer bug workaround · 49ba7544
      Paul Eggert authored
      This workaround no longer appears to be needed.
      * src/alloc.c (USE_ALIGNED_ALLOC): Don’t leave undefined
      merely because ADDRESS_SANITIZER is defined, as that bug
      in -fsanitize=address appears to have been fixed.  See:
      * src/conf_post.h (vfork): Improve comment.
    • Basil L. Contovounesios's avatar
      Fix default candidate of find-face-definition · c8dd1bc0
      Basil L. Contovounesios authored
      * lisp/emacs-lisp/find-func.el (find-function-read): Use
      face-at-point instead of variable-at-point for faces. (bug#31699)
    • Daniel Colascione's avatar
      Avoid unnecessary readahead early in TTY frame init · c67befd6
      Daniel Colascione authored
      We query some properties of the terminal early in initialization, and
      just before we do, we perform ordinary redisplay.  This redisplay can
      result in unsightly flickering if we change some aspects of the
      display immediately afterward and redisplay again.  By avoiding
      redisplay in xquery--query as long as we get timely responses from the
      terminal, we can avoid this early unwanted redisplay.
      * lisp/term/xterm.el:
      (xterm-query-redisplay-timeout): New variable.
      (xterm--read-event-for-query): New function.
      Call it.
    • Daniel Colascione's avatar
      Support terminal focus notifications · 6fdc3fac
      Daniel Colascione authored
      * lisp/frame.el (handle-focus-in,handle-focus-out): Make event
      argument optional.
      (blink-cursor-check): Make sure that the current frame is a
      window-system frame before restarting the blink timer. TTY frames
      can get focus, but don't need a blink timer because the terminal
      will do the blinking.
      * lisp/term/xterm.el
      (xterm-handle-focus-in,xterm-handle-focus-out): New functions.
      (xterm-rxvt-function-map): Recognize focus notification sequences.
      (xterm--init-focus-tracking): New function.
      (terminal-init-xterm): Call it.
    • Daniel Colascione's avatar
      Fix formatting in the face filter change · f1e65b73
      Daniel Colascione authored
      * src/xfaces.c:
      (merge_face_ref,syms_of_xfaces): Fix comments, formatting.
  3. 08 Jun, 2018 15 commits
    • Daniel Colascione's avatar
      Make setting inhibit-startup-screen in early init work · d1febb42
      Daniel Colascione authored
      * lisp/startup.el (command-line): Bind `inhibit-startup-screen'
      around loading the site file instead of unconditionally
      resetting it.
    • João Távora's avatar
      Describe flymake-start-on-save-buffer in manual and NEWS · 38111b5e
      João Távora authored
      Fixes: bug#31738
      * doc/misc/flymake.texi (Using Flymake, Customizable variables):
      Mention flymake-start-on-save-buffer.
      * etc/NEWS: Mention flymake-start-on-save-buffer.
    • João Távora's avatar
      New flymake-start-on-save-buffer custom variable · 21c6534e
      João Távora authored
      Fixes: bug#21419
      * lisp/progmodes/flymake.el (flymake-after-save-hook): Use
      (flymake-start-on-save-buffer): New custom variable.
      (flymake-start-on-flymake-mode): Tweak docstring.
    • Alan Mackenzie's avatar
      CC Mode: Fontify unbalanced quotes in unconstrained multiline strings, etc. · fe06f643
      Alan Mackenzie authored
      ("Unconstrained" meaning that every string is multiline, without needing such
      special marking as used by Pike Mode.)
      * lisp/progmodes/cc-mode.el (c-pps-to-string-delim): Don't process the char
      before BOB.
      (c-multiline-string-check-final-quote): New function.
      (c-bc-changed-stringiness): New variable.
      (c-before-change-check-unbalanced-strings): Add handling for unconstrained
      multiline strings.
      (c-after-change-re-mark-unbalanced-strings): Add handling for unconstrained
      multiline strings.  Handle escaped double quotes more accurately.
    • Paul Eggert's avatar
      Port alignment verification to x86 --with-wide-int · db353b86
      Paul Eggert authored
      Problem reported by Eli Zaretskii in:
      * src/lisp.h (struct Lisp_Symbol, union vectorlike_header)
      (struct Lisp_Cons, struct Lisp_String):
      Do not check alignment if !USE_LSB_TAG, as alignment is
      needed only if we are tagging the low-order bits.
    • Michal Nazarewicz's avatar
      ; Tiny tpyo fix · f09e9d29
      Michal Nazarewicz authored
      * src/xfaces.c (face-remapping-alist): remove an empty ‘(3)’ introduced
      in a docstring by mistake.
    • Daniel Colascione's avatar
      Offer to open large files without modes · 416ba369
      Daniel Colascione authored
      * lisp/files.el:
      (files--ask-user-about-large-file): New function.
      (abort-if-file-too-large): Call it.
      (find-file-noselect): Support new raw open.
    • Daniel Colascione's avatar
      Add support for per-window face remapping · 9d447fa1
      Daniel Colascione authored
      Extend face specifications to support the notion of filtering to a
      specific context and add a filter that limits a face specification to
      windows having a certain parameter.
      * src/xfaces.c:
      (evaluate_face_filter,filter_face_ref): New functions.
      (merge_face_ref): Ignore filtered face specifications.
      Pass window to face machinery.
      (syms_of_xfaces): Add :window and :filtered
      * src/xdisp.c (init_iterator, handle_face_prop)
      (handle_single_display_spec, merge_escape_glyph_face)
      (merge_glyphless_glyph_face, get_next_display_element)
      (next_element_from_display_vector, append_space_for_newline)
      (display_line, calc_line_height_property): Pass window to
      face machinery.
      * src/term.c (tty_menu_activate): Adjust to new face core
      function signature.
      * src/msdos.c (XMenuActivate): Adjust to new face core
      function signature.
      * src/fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face):
      Pass window to face machinery.
      * src/font.c (font_range, Finternal_char_font): Pass window to
      face machinery.
      * src/dispnew.c (spec_glyph_lookup_face): Pass window to
      face machinery.
      * src/dispextern.h:
      Add struct window arguments to prototypes.
    • Paul Eggert's avatar
      Fit kill_buffer_xwidgets into 80 · e2a98002
      Paul Eggert authored
      * src/xwidget.c (kill_buffer_xwidgets): Reindent and use C99
      style to fit in 80 columns.
    • Paul Eggert's avatar
      Minor cleanup of save_excursion_restore · 0e1bfd38
      Paul Eggert authored
      * src/editfns.c (save_excursion_restore): Use clearer names
      for locals.  Free earlier, removing the need for a label and goto.
    • Paul Eggert's avatar
      New function record_unwind_protect_excursion · a0aa1d4e
      Paul Eggert authored
      This simplifies callers a bit, and will simplify future changes.
      * src/eval.c (record_unwind_protect_excursion): New function.
      * src/buffer.c (Fkill_buffer):
      * src/bytecode.c (exec_byte_code):
      * src/editfns.c (Fsave_excursion, Freplace_buffer_contents):
      * src/lread.c (readevalloop, Feval_buffer):
      * src/window.c (scroll_command):
      Use it.
    • Paul Eggert's avatar
      * src/.gdbinit: Omit soon-obsolete comment. · a0641286
      Paul Eggert authored
    • Paul Eggert's avatar
      Fix ftfont_open2 failure cleanup · 4d176b74
      Paul Eggert authored
      * src/ftfont.c (ftfont_open2): Don’t increment counter if failing.
      Avoid use-after-free once the increment bug is fixed.
    • Paul Eggert's avatar
      Don’t over-align if WIDE_EMACS_INT · b76389f2
      Paul Eggert authored
      * src/lisp.h (GCALIGNED_UNION): New macro.
      (struct Lisp_Symbol, union vectorlike_header)
      (struct Lisp_Cons, struct Lisp_String):
      Use it to avoid possible over-alignment if !USE_LSB_TAG.
    • Paul Eggert's avatar
      Fix GC-related commentary · 7c16392c
      Paul Eggert authored
      * src/lisp.h: USE_STACK_LISP_OBJECTS is no longer experimental.
      Also, remove confusion about scope vs lifetime.
      And say that stack-allocated strings should not be given
      text properties.
  4. 07 Jun, 2018 3 commits
    • Noam Postavsky's avatar
      Let isearch-yank-kill enable isearch-mode if needed (Bug#21419) · 9966842a
      Noam Postavsky authored
      * lisp/isearch.el (isearch-yank-kill): Enable isearch-mode if needed.
    • João Távora's avatar
      Accept plists when serializing and parsing JSON · 3509aaae
      João Távora authored
      * doc/lispref/text.texi (Parsing JSON): Mention plist support.
      * src/json.c (lisp_to_json_toplevel_1): Serialize plists to json.
      (Fjson_serialize): Mention plists in docstring.
      (enum json_object_type): Add json_object_plist.
      (json_to_lisp): Parse JSON into plists.
      (json_parse_object_type): Consider plists.
      (Fjson_parse_string): Mention plists in docstring.
      (syms_of_json): New Qplist sym_of_json.
      (lisp_to_json): Update comment.
      * test/src/json-tests.el (json-serialize/object)
      (json-parse-string/object): New plist tests.
    • Michael Albinus's avatar
      Remove Tramp "obex" and "synce" methods · 2e2f61ef
      Michael Albinus authored
      * doc/misc/tramp.texi (GVFS based methods): Remove `obex' and `synce'.
      * etc/NEWS: Mention obsolete Tramp "obex" and "synce" methods.
      * lisp/net/tramp-gvfs.el (tramp-gvfs-methods):
      Remove "obex" and "synce".
      (top): Do not add defaults for "obex" and "synce".
      (tramp-bluez-service, tramp-bluez-interface-manager)
      (tramp-bluez-discover-devices-timeout, tramp-bluez-discovery)
      (tramp-bluez-devices, tramp-hal-service, tramp-hal-path-manager)
      (tramp-hal-interface-manager, tramp-hal-interface-device)
      (tramp-bluez-address, tramp-bluez-device)
      (tramp-bluez-list-devices, tramp-bluez-property-changed)
      (tramp-bluez-device-found, tramp-bluez-parse-device-names)
      (tramp-synce-list-devices, tramp-synce-parse-device-names): Remove.
      (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Do not
      handle "obex" and "synce".
  5. 05 Jun, 2018 4 commits
    • João Távora's avatar
      When navigating Flymake diagnostics, consider their severity · 4a51deb9
      João Távora authored
      The FILTER arg of flymake-goto-next-error, a list of types, includes
      every diagnostic with a severity number `eq` to those types.
      * lisp/progmodes/flymake.el (flymake--severity): New helper.
      (flymake-goto-next-error, flymake-goto-prev-error): Clarify
      meaning of FILTER.
      (flymake-goto-next-error): Interpret filter as a severity filter.
      (flymake--mode-line-format): Simplify.
    • João Távora's avatar
      Obsolete Flymake's flymake-diagnostic-types-alist · fa794d1b
      João Távora authored
      That varaiable was an association between symbols and properties,
      effecively duplicating symbol's property lists.  It is simpler to just
      put properties on symbols.  Backward compatibility to the old variable
      has been kept.
      * doc/misc/flymake.texi (Flymake error types): Don't mention
      (Flymake error types): Rework section.
      (Backend functions): Refill a paragraph.
      (Flymake utility functions): Don't mention
      (Proc customization variables): Don't mention
      * etc/NEWS: Mention obsoletion of flymake-diagnostic-types-alist.
      * lisp/progmodes/flymake-proc.el
      (flymake-proc--diagnostics-for-pattern): Don't use
      * lisp/progmodes/flymake.el: Rewrite commentary.
      (flymake-make-diagnostic, flymake-mode, flymake-goto-next-error)
      (flymake-goto-prev-error): Don't mention
      flymake-diagnostic-types-alist in docstring.
      (flymake-diagnostic-types-alist): Make obsolete.
      (:error, :warning, :note): Put flymake-category in these symbols.
      (flymake-error, flymake-warning, flymake-note): Put
      `flymake-bitmap', not `bitmap' in these symbols.
      (flymake--lookup-type-property, flymake--highlight-line): Rewrite.
      Honor flymake-diagnostic-types-alist for backward
      * lisp/progmodes/python.el (python-flymake-msg-alist): Don't
      mention flymake-diagnostic-types-alist.
    • João Távora's avatar
      Correctly filter Flymake diagnostic types shown in mode-line · aadac049
      João Távora authored
      Thus, if a package foo has its own types foo-error and
      foo-warning, and if the buffer has no errors, the mode-line
      will correctly show `[0 0]' (zero errors and warnings) instead
      of `[0 0 0 0]' (zero errors, zero foo-errors, zero warnings,
      zero  foo-warnings).
      * lisp/progmodes/flymake.el
      (flymake--mode-line-format): Coalesce diagnostic types based on
      the severity, not the symbol.
    • João Távora's avatar
      Let Flymake backends attach arbitrary data to diagnostics · fb759a75
      João Távora authored
      This is easier that setting properties on diagnostics' text.
      * lisp/progmodes/flymake.el (flymake--diag): Add data slot.
      (flymake-make-diagnostic): Add DATA arg.
      (flymake-diagnostic-data): New accessor.