1. 06 Aug, 2018 6 commits
    • Paul Eggert's avatar
      Remove always-0 struct re_pattern_buffer members · e097826f
      Paul Eggert authored
      * src/regex-emacs.h (struct re_pattern_buffer):
      Remove no_sub, not_bol, not_eol.  They are always zero.
      All uses removed, and code simplified.
      e097826f
    • Paul Eggert's avatar
      Simplify regex-emacs by assuming Emacs syntax · 03dfb606
      Paul Eggert authored
      * src/regex-emacs.c (reg_syntax_t)
      (RE_BACKSLASH_ESCAPE_IN_LISTS, RE_BK_PLUS_QM)
      (RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS)
      (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS)
      (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE)
      (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT)
      (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS)
      (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES)
      (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING)
      (RE_NO_GNU_OPS, RE_FRUGAL, RE_SHY_GROUPS)
      (RE_NO_NEWLINE_ANCHOR, RE_SYNTAX_EMACS, RE_TRANSLATE_P):
      Remove.  All uses removed and resulting code simplified.
      (TRANSLATE): Treat nil as an absent translation table, not zero.
      All uses changed.
      03dfb606
    • Paul Eggert's avatar
      Simplify regex-emacs code by assuming Emacs · 3a6abe65
      Paul Eggert authored
      * src/regex-emacs.c: Omit no-longer-needed AIX code.
      Don’t ignore GCC warnings.
      Include regex-emacs.h immediately after config.h,
      to test that it’s independent.
      Omit the "#ifndef emacs" and "#ifdef REGEX_MALLOC" and
      "#if WIDE_CHAR_SUPPORT" or "#ifdef _REGEX_RE_COMP",
      code, as we are no longer interested in compiling outside
      Emacs (with or without debugging or native wide char support)
      or in avoiding alloca.
      (REGEX_EMACS_DEBUG, regex_emacs_debug): Rename from DEBUG and debug,
      to avoid collision with other DEBUGS.  All uses changed.
      In debugging output, change %ld and %zd to %zu when appropriate.
      No need to include stddef.h, stdlib.h, sys/types.h, wchar.h,
      wctype.h, locale/localeinfo.h, locale/elem-hash.h, langinfo.h,
      libintl.h, unistd.h, stdbool.h, string.h, stdio.h, assert.h.
      All uses of assert changed to eassert.
      (RE_DUP_MAX, reg_syntax_t, RE_BACKSLASH_ESCAPE_IN_LISTS)
      (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS)
      (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS, RE_DOT_NEWLINE)
      (RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE, RE_INTERVALS)
      (RE_LIMITED_OPS, RE_NEWLINE_ALT, RE_NO_BK_BRACES)
      (RE_NO_BK_PARENS, RE_NO_BK_REFS, RE_NO_BK_VBAR)
      (RE_NO_EMPTY_RANGES, RE_UNMATCHED_RIGHT_PAREN_ORD)
      (RE_NO_POSIX_BACKTRACKING, RE_NO_GNU_OPS, RE_FRUGAL)
      (RE_SHY_GROUPS, RE_NO_NEWLINE_ANCHOR, RE_SYNTAX_EMACS)
      (REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE)
      (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN)
      (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT)
      (REG_EEND, REG_ESIZE, REG_ERPAREN, REG_ERANGEX, REG_ESIZEBR)
      (reg_errcode_t, REGS_UNALLOCATED, REGS_REALLOCATE, REGS_FIXED)
      (RE_NREGS, RE_TRANSLATE, RE_TRANSLATE_P):
      Move here from regex-emacs.h.
      (RE_NREGS): Define unconditionally.
      (boolean): Remove.  All uses replaced by bool.
      (WIDE_CHAR_SUPPORT, regfree, regexec, regcomp, regerror):
      (re_set_syntax, re_syntax_options, WEAK_ALIAS, gettext, gettext_noop):
      Remove.  All uses removed.
      (malloc, realloc, free): Do not redefine.  Adjust all callers
      to use xmalloc, xrealloc, xfree instead.
      (re_error_msgid): Use C99 to avoid need to keep in same order
      as reg_error_t.
      (REGEX_USE_SAFE_ALLOCA): Simplify by using USE_SAFE_ALLOCA.
      (REGEX_ALLOCATE, REGEX_REALLOCATE, REGEX_FREE, REGEX_ALLOCATE_STACK)
      (REGEX_REALLOCATE_STACK, REGEX_FREE_STACK): Remove.
      All callers changed to use the non-REGEX_MALLOC version.
      (REGEX_TALLOC): Remove.  All callers changed to use SAFE_ALLOCA.
      (re_set_syntax): Remove; unused.
      (MATCH_MAY_ALLOCATE): Remove; now always true.  All uses simplified.
      (INIT_FAILURE_ALLOC): Define unconditionally.
      (re_compile_fastmap): Now static.
      (re_compile_pattern): Avoid unnecessary cast.
      * src/regex-emacs.h (EMACS_REGEX_H): Renamed from _REGEX_H to
      avoid possible collision with glibc.
      Don’t include sys/types.h.  All uses of ssize_t changed to ptrdiff_t.
      Don’t worry about C++ or VMS.
      Assume emacs is defined and that _REGEX_RE_COMP and WIDE_CHAR_SUPPORT
      are not.
      Define struct re_registers before including lisp.h.
      (REG_ENOSYS, RE_TRANSLATE_TYPE): Remove; all uses replaced by
      Lisp_Object.
      (regoff_t): Remove.  All uses replaced with ptrdiff_t.
      (re_match, regcomp, regexec, regerror, regfree):
      Remove decl of nonexistent functions.
      (RE_DEBUG, RE_SYNTAX_AWK, RE_SYNTAX_GNU_AWK)
      (RE_SYNTAX_POSIX_AWK, RE_SYNTAX_GREP, RE_SYNTAX_EGREP)
      (RE_SYNTAX_POSIX_EGREP, RE_SYNTAX_ED, RE_SYNTAX_SED)
      (_RE_SYNTAX_POSIX_COMMON, RE_SYNTAX_POSIX_BASIC)
      (RE_SYNTAX_POSIX_MINIMAL_BASIC, RE_SYNTAX_POSIX_EXTENDED)
      (RE_SYNTAX_POSIX_MINIMAL_EXTENDED, REG_EXTENDED, REG_ICASE)
      (REG_NEWLINE, REG_NOSUB, REG_NOTBOL, REG_NOTEOL, regmatch_t):
      Remove; unused.
      * src/search.c (Fset_match_data): Simplify range test now that
      we know it’s ptrdiff_t.
      3a6abe65
    • Paul Eggert's avatar
      Use Gnulib regex for lib-src · d904cc83
      Paul Eggert authored
      Emacs regular expressions forked from everyone else long ago.
      This makes it official and should allow simplification later.
      etags.c now uses the glibc regex API, falling back on a
      Gnulib-supplied substitute lib/regex.c if necessary.
      Emacs proper now uses its own regular expression module.
      Although this patch may look dauntingly large, most of it
      was generated automatically by admin/merge-gnulib
      and contains an exact copy of the glibc regex source,
      and the by-hand changes do not grow the Emacs source code.
      * admin/merge-gnulib (GNULIB_MODULES): Add regex.
      (AVOIDED_MODULES): Add btowc, langinfo, lock, mbrtowc, mbsinit,
      nl_langinfo, wchar, wcrtomb, wctype-h.
      * lib-src/Makefile.in (regex-emacs.o): Remove; Gnulib does it now.
      (etags_deps, etags_libs): Remove regex-emacs.o.
      * lib-src/etags.c: Go back to including regex.h.
      (add_regex): Use unsigned char translation array,
      since glibc regex requires that.
      * lib/Makefile.in (not_emacs_OBJECTS, for_emacs_OBJECTS): New macros.
      (libegnu_a_OBJECTS): Use them, to avoid building e-regex.o.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c:
      * lib/regex_internal.h, lib/regexec.c, m4/builtin-expect.m4:
      * m4/eealloc.m4, m4/glibc21.m4, m4/mbstate_t.m4, m4/regex.m4:
      New files, copied from Gnulib.
      * src/regex-emacs.h, src/conf_post.h:
      (RE_TRANSLATE_TYPE, RE_TRANSLATE, RE_TRANSLATE_P):
      Move from src/conf_post.h to src/regex-emacs.h,
      so that they don’t interfere with compiling lib/regex.c.
      d904cc83
    • Paul Eggert's avatar
      Rename src/regex.c to src/regex-emacs.c. · e5652268
      Paul Eggert authored
      This is in preparation for using Gnulib regex for etags,
      to avoid collisions in include directives.
      * src/regex-emacs.c: Rename from src/regex.c.
      * src/regex-emacs.h: Rename from src/regex.h.  All uses changed.
      * test/src/regex-emacs-tests.el: Rename from test/src/regex-tests.el.
      e5652268
    • Paul Eggert's avatar
      Update from gnulib · ba8eb994
      Paul Eggert authored
      This incorporates:
      2018-08-05 Fix link error regarding 'rpl_environ'
      * build-aux/config.guess, lib/unistd.in.h, lib/warn-on-use.h:
      * m4/extern-inline.m4: Copy from Gnulib.
      ba8eb994
  2. 05 Aug, 2018 2 commits
  3. 04 Aug, 2018 11 commits
    • Stephen Berman's avatar
      Fix assorted todo-mode bugs (bug#32366) · f7d65a5e
      Stephen Berman authored
      * lisp/calendar/todo-mode.el (todo-forward-category): Fix
      calculation for skipping backward over archived categories.
      (todo-jump-to-category): When hl-line-mode is enabled, force
      highlighting to compensate for apparent failure of
      post-command-hook to run.
      (todo-insert-item--basic): Prevent inserting a new todo item in an
      archive category.
      (todo-delete-item): Ensure done items separator disappears when
      the last done item is deleted.
      (todo-edit-item--header): Fix calculation for choosing a month
      prior to the current one.
      (todo-find-filtered-items-file): Fix use of completing-read,
      correcting typo in default value passed to it and confining
      history to filtered items files.
      (todo-go-to-source-item): Make a noop when point is not on an item.
      (todo-save-filtered-items-buffer): Make buffer read-only after
      saving and improve buffer name.
      (todo-key-bindings-t+a+f): Remove three mistakenly included bindings.
      (todo-key-bindings-t+a): Add two mistakenly omitted bindings.
      f7d65a5e
    • Noam Postavsky's avatar
    • Noam Postavsky's avatar
    • Noam Postavsky's avatar
      Respect non-saved value of `read-short-answer' (Bug#31782) · 95050a58
      Noam Postavsky authored
      * lisp/emacs-lisp/map-ynp.el (read-answer-short): Add an `auto'
      setting.
      (read-answer): Check the function cell of `yes-or-no-p' when
      `read-answer-short' is `auto' rather than calling
      `custom-reevaluate-setting' which would reset the option to its saved
      value.
      95050a58
    • Noam Postavsky's avatar
      ; Merge from emacs-26 · d228de8a
      Noam Postavsky authored
      The following commit was skipped:
      
      cc233365 New function read-answer (Bug#31782)
      d228de8a
    • Noam Postavsky's avatar
      Merge from emacs-26 · 529ec8df
      Noam Postavsky authored
      f0b8e64f Avoid assertion violations in maybe_produce_line_number
      7669bf78 Avoid assertion violations in set_text_properties_1
      529ec8df
    • Noam Postavsky's avatar
      ; Merge from emacs-26 · b6dd0374
      Noam Postavsky authored
      The following commit was skipped:
      
      15458a83 ; Auto-commit of loaddefs files.
      b6dd0374
    • Noam Postavsky's avatar
      Merge from emacs-26 · 6328d2ff
      Noam Postavsky authored
      951c5a12 Fix wdired test failure when byte compiled (bug#32318)
      0252f731 * test/lisp/wdired-tests.el (wdired-test-symlink-name): Ne...
      dd514347 Fix url's thing-at-point beginning-op (Bug#32028)
      6328d2ff
    • Juri Linkov's avatar
      New function read-answer (Bug#31782) · cc233365
      Juri Linkov authored
      * lisp/emacs-lisp/map-ynp.el (read-answer-short): New defcustom.
      (read-answer): New function.
      * lisp/subr.el (assoc-delete-all): New function.
      * etc/NEWS: Announce them.
      
      * lisp/dired.el (dired-delete-file): Use read-answer.
      (dired--yes-no-all-quit-help): Remove function.
      (dired-delete-help): Remove defconst.
      
      (backported from master, "New function read-answer (bug#30073)" and
      "Respect non-saved value of `read-short-answer' (Bug#31782)")
      cc233365
    • Michael Albinus's avatar
      * lisp/international/mule-cmds.el (universal-coding-system-argument): · c27bd469
      Michael Albinus authored
      Use `current-input-mode' for determining quit char.
      c27bd469
    • Michael Albinus's avatar
      Rename Tramp method "owncloud" to "nextcloud" · b9e2a91e
      Michael Albinus authored
      In the spirit of freedom, "nextcloud" is preferred over "owncloud".
      
      * doc/misc/tramp.texi (Quick Start Guide, GVFS based methods):
      * etc/NEWS: Rename "owncloud" method to "nextcloud".
      
      * lisp/net/tramp-gvfs.el (tramp-gvfs-methods, tramp-goa-methods)
      (tramp-gvfs-url-file-name, tramp-gvfs-handler-mounted-unmounted)
      (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec)
      (tramp-get-goa-accounts): Use "nextcloud" instead of "owncloud".
      (tramp-gvfs-nextcloud-default-prefix)
      (tramp-gvfs-nextcloud-default-prefix-regexp): Rename them.  Adapt
      all callees.
      
      * test/lisp/net/tramp-tests.el (tramp--test-nextcloud-p):
      Rename from `tramp--test-owncloud-p'.
      (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
      b9e2a91e
  4. 03 Aug, 2018 20 commits
    • Ken Brown's avatar
      Fix a filenotify test failure on Cygwin · 5dc3d0a9
      Ken Brown authored
      * test/lisp/filenotify-tests.el
      (file-notify-test04-autorevert): Increase a sleep-for time
      from 2 to 3 on Cygwin.  This avoids sporadic failures of the
      test.  (Bug#32363)
      5dc3d0a9
    • Gemini Lasswell's avatar
      Merge branch 'scratch/backtrace-mode' · da0054c3
      Gemini Lasswell authored
      da0054c3
    • Gemini Lasswell's avatar
      Fix some documentation formatting nits · 95b2ab3d
      Gemini Lasswell authored
      * doc/misc/ert.texi (Running Tests Interactively): Correct
      Elisp manual titile in xref.
      * doc/lispref/edebug.texi (Edebug Misc): Use single argument
      form of xref.
      * doc/lispref/debugging.texi (Backtraces): Add comma and
      period after xref braces.
      (Backtraces): Correct Emacs manual title.
      (Internals of Debugger): Add a space before period.
      95b2ab3d
    • Gemini Lasswell's avatar
      Fix typo in edebug-backtrace-hide-instrumentation's docstring. · 58be6cb6
      Gemini Lasswell authored
      * lisp/emacs-lisp/edebug.el (edebug-backtrace-hide-instrumentation):
      Fix docstring copypasta.
      58be6cb6
    • Gemini Lasswell's avatar
      Give two backtrace-mode commands better names · 3cd6a684
      Gemini Lasswell authored
      * lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Update
      bindings and menu items with new function names.
      (backtrace-collapse, backtrace-pretty-print)
      (backtrace--collapse, backtrace--pretty-print): Remove functions.
      (backtrace-single-line, backtrace-multi-line)
      (backtrace--single-line, backtrace--multi-line): New functions.
      (backtrace--reformat-sexp): Remove 'error-message' argument.
      * test/lisp/emacs-lisp/backtrace-tests.el
      (backtrace-tests--pretty-print-and-collapse): Remove.
      (backtrace-tests--single-and-multi-line): New test.
      (backtrace-tests--verify-pp-and-collapse): Remove.
      (backtrace-tests--verify-single-and-multi-line): New function.
      3cd6a684
    • Gemini Lasswell's avatar
      Move 'backtrace' from subr.el to backtrace.el · 83af893f
      Gemini Lasswell authored
      * lisp/subr.el (backtrace, backtrace--print-frame): Remove functions.
      * lisp/emacs-lisp/backtrace.el (backtrace-backtrace): Remove function.
      (backtrace): New function.
      (backtrace-to-string): Make argument optional.
      * doc/lispref/debugging.texi (Internals of Debugger): Update
      description of 'backtrace' function.
      83af893f
    • Gemini Lasswell's avatar
      Add new commands to Edebug backtraces · ca983772
      Gemini Lasswell authored
      Add commands to go to source if available, and to show and hide
      Edebug's instrumentation.  Make Edebug pop to backtraces instead of
      displaying them, which makes Edebug consistant with the behavior of
      ERT and the Lisp Debugger.
      * doc/lispref/edebug.texi (Edebug Misc): Document when and how you can
      jump to source code from an Edebug backtrace.  Document
      'edebug-backtrace-show-instrumentation' and
      'edebug-backtrace-hide-instrumentation'.
      * lisp/emacs-lisp/backtrace.el (backtrace-frame): Add comments to
      describe the fields.
      (backtrace-goto-source-functions): New
      abnormal hook.
      (backtrace-mode-map): Add keybinding and menu item for
      backtrace-goto-source.
      (backtrace--flags-width): New constant.
      (backtrace-update-flags): Use it.
      (backtrace-goto-source): New command.
      (backtrace--print-flags): Print the :source-available flag.
      * lisp/emacs-lisp/edebug.el (edebug-backtrace-frames)
      (edebug-instrumented-backtrace-frames): New variables.
      (edebug-backtrace, edebug--backtrace-frames): Remove functions.
      (edebug-pop-to-backtrace, edebug--backtrace-goto-source)
      (edebug--add-source-info): New functions.
      (edebug-mode-map, edebug-mode-menus): Replace 'edebug-backtrace' with
      'edebug-pop-to-backtrace'.
      (edebug--strip-instrumentation): New function.
      (edebug--unwrap-and-add-info): Remove.
      (edebug-unwrap-frame, edebug-add-source-info): New functions.
      (edebug-backtrace-show-instrumentation)
      (edebug-backtrace-hide-instrumentation): New commands.
      * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-check-keymap):
      Verify keybindings in backtrace-mode-map used by new test.
      Update with binding for 'edebug-pop-to-backtrace'.
      (edebug-tests-backtrace-goto-source): New test.
      * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
      (edebug-test-code-range): Add a new stop point.
      ca983772
    • Gemini Lasswell's avatar
      Add a menu for backtrace-mode · 1459ad2c
      Gemini Lasswell authored
      * lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Add a menu.
      * lisp/emacs-lisp/debug.el (debugger-mode-map): Change menu text for
      'backtrace-help-follow-symbol' to better describe what it does.
      1459ad2c
    • Gemini Lasswell's avatar
    • Gemini Lasswell's avatar
      Add new command to expand all "..."s in a backtrace frame · a3ba34ae
      Gemini Lasswell authored
      * doc/lispref/debugging.texi (Backtraces): Document new keybinding.
      * lisp/emacs-lisp/backtrace.el (backtrace-line-length): Add the
      option of unlimited line length.
      (backtrace--match-ellipsis-in-string): Add a comment to explain
      why this function is necessary.
      (backtrace-mode-map): Add keybinding for 'backtrace-expand-ellipses'.
      (backtrace-expand-ellipsis): Use 'cl-print-to-string-with-limit'.
      (backtrace-expand-ellipses): New command.
      (backtrace-print-to-string): Use 'cl-print-to-string-with-limit'.
      Tag the printed forms with a gensym instead of the values of
      print-length and print-level.
      (backtrace--print): Add 'stream' argument.
      * test/lisp/emacs-lisp/backtrace-tests.el
      (backtrace-tests--expand-ellipsis): Make the test less dependent
      on the implementation.
      (backtrace-tests--expand-ellipses): New test.
      
      Move the fitting of a printed representation into a limited number of
      characters using appropriate values of print-level and print-length
      from 'backtrace-print-to-string' to cl-print.el for future use by
      other parts of Emacs.
      * lisp/emacs-lisp/cl-print.el (cl-print-to-string-with-limit): New
      function.
      * test/lisp/emacs-lisp/cl-print-tests.el
      (cl-print-tests-print-to-string-with-limit): New test.
      a3ba34ae
    • Gemini Lasswell's avatar
      Change keybinding for backtrace-collapse from '=' to '-' · 2ede75c4
      Gemini Lasswell authored
      '+' and '-' make a more intuitive pair of keybindings for
      backtrace-pretty-print and backtrace-collapse than '+' and '='.
      * lisp/emacs-lisp/backtrace.el (backtrace-mode-map):
      * doc/lispref/debugging.texi (Backtraces): Change
      keybinding for backtrace-collapse.
      2ede75c4
    • Gemini Lasswell's avatar
      Add more tests for backtrace-mode · 04cc0b61
      Gemini Lasswell authored
      * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--variables)
      (backtrace-tests--backward-frame, backtrace-tests--forward-frame)
      (backtrace-tests--pretty-print-and-collapse)
      (backtrace-tests--verify-pp-and-collapse)
      (backtrace-tests--print-circle, backtrace-tests--make-regexp)
      (backtrace-tests--expand-ellipsis): New tests.
      (backtrace-tests--to-string): Use backtrace-tests--make-backtrace.
      (backtrace-tests--get-substring): New function.
      
      Change the method of generating sample backtraces in backtrace tests
      to work whether or not the tests are byte-compiled.
      * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--func1)
      (backtrace-tests--func2, backtrace-tests--func3)
      (backtrace-tests--create-backtrace-frames): Remove.
      (backtrace-tests--uncompiled-functions): New constant.
      (backtrace-tests--make-backtrace, backtrace-tests--setup-buffer):
      New functions.
      (backtrace-tests--backtrace-lines)
      (backtrace-tests--backtrace-lines-with-locals): New functions.
      (backtrace-tests--line-count): New constant.
      (backtrace-tests--result, backtrace-tests--result-with-locals):
      New functions.
      (backtrace-tests--header): New constant.
      (backtrace-tests--insert-header): Use backtrace-tests--header.
      (backtrace-tests--with-buffer): Remove.
      04cc0b61
    • Gemini Lasswell's avatar
      Add link in backtraces to position in buffer being evaluated (bug#14081) · af5f3771
      Gemini Lasswell authored
      * lisp/emacs-lisp/backtrace.el (backtrace-frame): Add buffer field.
      (backtrace-get-frames): Set buffer field of frame.
      (backtrace-buffer-pos): New button type.
      (backtrace--pop-to-buffer-pos): New function.
      (backtrace--print-func-and-args): Create a button for the buffer
      position if it is set.
      af5f3771
    • Gemini Lasswell's avatar
      Add links in backtraces to functions written in C (bug#25393) · 9aa9d79e
      Gemini Lasswell authored
      * lisp/emacs-lisp/backtrace.el (backtrace--print-func-and-args):
      Look up file names for built-in functions with evaluated arguments.
      9aa9d79e
    • Gemini Lasswell's avatar
      Add prefix argument to backtrace-toggle-print-circle · bb9de872
      Gemini Lasswell authored
      With prefix argument, toggle print-circle for the whole buffer.
      * lisp/emacs-lisp/backtrace.el (backtrace-toggle-print-circle): Add
      universal prefix argument.
      (backtrace--toggle-feature): Add new argument 'all' to toggle all
      frames.
      (backtrace--set-feature): New function.
      (backtrace-mode): Use indent functions from Lisp modes.
      bb9de872
    • Gemini Lasswell's avatar
      Lazily print backtrace frame local variables · d6b364ed
      Gemini Lasswell authored
      Instead of printing the local variables for all frames when the
      backtrace buffer is created, print them when they are first made
      visible.  Add a prefix argument to backtrace-toggle-locals to toggle
      local variables display for the entire buffer.
      * lisp/emacs-lisp/backtrace.el (backtrace-view): Mention
      :show-locals in docstring.
      (backtrace-get-section-end): Remove function.
      (backtrace-toggle-locals): Add prefix argument.
      (backtrace--with-output-variables): Move before first use.
      (backtrace--set-frame-locals-visible): New function.
      (backtrace--set-locals-visible-overlay): New function.
      (backtrace--set-locals-visible): Remove function.
      (backtrace-toggle-feature): Remove TODO comment.
      (backtrace--print-locals): Skip printing the locals if they are not
      visible.
      d6b364ed
    • Gemini Lasswell's avatar
      Always make buttons from function names in backtraces · 5b50fa5a
      Gemini Lasswell authored
      * lisp/emacs-lisp/backtrace.el (backtrace-view)
      (backtrace--print-func-and-args, backtrace-mode): Always
      make buttons.  Remove all uses of ':do-xrefs'.
      * lisp/emacs-lisp/debug.el (debugger-setup-buffer): Modify
      backtrace-view instead of setting it.
      * lisp/emacs-lisp/edebug.el (edebug-backtrace):
      * lisp/emacs-lisp/ert.el
      (ert-results-pop-to-backtrace-for-test-at-point):
      Remove initialization of backtrace-view.
      5b50fa5a
    • Gemini Lasswell's avatar
      Add backtrace-mode and use it in the debugger, ERT and Edebug · e09120d6
      Gemini Lasswell authored
      * doc/lispref/debugging.texi (Using Debugger): Remove explanation of
      backtrace buffer.  Refer to new node.
      (Backtraces): New node.
      (Debugger Commands): Refer to new node.  Remove 'v'.
      * doc/lispref/edebug.texi (Edebug Misc): Refer to new node.
      * doc/misc/ert.texi (Running Tests Interactively): Refer to new node.
      
      * lisp/emacs-lisp-backtrace.el: New file.
      * test/lisp/emacs-lisp/backtrace-tests.el: New file.
      
      * lisp/emacs-lisp/debug.el: (debugger-buffer-state): New cl-defstruct.
      (debugger--restore-buffer-state): New function.
      (debug): Use a debugger-buffer-state object to save and restore buffer
      state.  Fix bug#15749 by leaving an unused buffer in debugger-mode,
      empty, instead of in fundamental-mode, and then when reusing a buffer,
      not calling debugger-mode if the buffer is already in debugger-mode.
      (debugger-insert-backtrace): Remove.
      (debugger-setup-buffer): Use backtrace-mode.
      (debugger--insert-header): New function.
      (debugger-continue, debugger-return-value): Change check for flags to
      use backtrace-frames.
      (debugger-frame-number): Determine backtrace frame number from
      backtrace-frames.
      (debugger--locals-visible-p, debugger--insert-locals)
      (debugger--show-locals, debugger--hide-locals)
      (debugger-toggle-locals): Remove.
      (debugger-mode-map): Make a child of backtrace-mode-map.  Move
      navigation commands to backtrace-mode-map.  Bind 'q' to debugger-quit
      instead of top-level.  Make Help Follow menu item call
      backtrace-help-follow-symbol.
      (debugger-mode): Derive from backtrace-mode.
      (debug-help-follow): Remove.  Move body of this function to
      'backtrace-help-follow-symbol' in backtrace.el.
      (debugger-quit): New function.
      
      * lisp/emacs-lisp/edebug.el (edebug-unwrap-results): Remove warning
      in docstring about circular results.
      (edebug-unwrap): Use pcase.
      (edebug-unwrap1): New function to unwrap circular objects.
      (edebug-unwrap*): Use it.
      (edebug--frame): New cl-defstruct.
      (edebug-backtrace): Call the buffer *Edebug Backtrace* and use
      backtrace-mode.  Get the frames from edebug--backtrace-frames.
      (edebug--backtrace-frames, edebug--unwrap-and-add-info)
      (edebug--symbol-not-prefixed-p): New functions.
      
      * lisp/emacs-lisp/lisp-mode.el
      (lisp-el-font-lock-keywords-for-backtraces)
      (lisp-el-font-lock-keywords-for-backtraces-1)
      (lisp-el-font-lock-keywords-for-backtraces-2): New constants.
      
      * lisp/emacs-lisp/ert.el (ert--print-backtrace): Remove.
      (ert--run-test-debugger): Use backtrace-get-frames.
      (ert-run-tests-batch): Use backtrace-to-string.
      (ert-results-pop-to-backtrace-for-test-at-point): Use backtrace-mode.
      (ert--insert-backtrace-header): New function.
      
      * tests/lisp/emacs-lisp/ert-tests.el (ert-test--which-file):
      Use backtrace-frame slot accessor.
      e09120d6
    • Gemini Lasswell's avatar
      Add methods for strings to cl-print · 8a762095
      Gemini Lasswell authored
      * lisp/emacs-lisp/cl-print.el (cl-print-object) <string>: New method.
      (cl-print-object-contents) <string>: New method.
      (cl-print--find-sharing): Look in string property lists.
      
      * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-3): Test
      printing of long strings.
      (cl-print-tests-4): Test printing of strings nested in other objects.
      (cl-print-tests-strings, cl-print-tests-ellipsis-string): New
      tests.
      8a762095
    • Gemini Lasswell's avatar
      Support ellipsis expansion in cl-print · eba16e5e
      Gemini Lasswell authored
      * lisp/emacs-lisp/cl-print.el (cl-print-object-contents): New
      generic method.
      (cl-print-object-contents) <cons, vector,cl-structure-object>: New
      methods.
      (cl-print-object) <cons>: Use cl-print-insert-ellipsis.
      (cl-print-object) <vector, cl-structure-object>: Elide whole object if
      print-level exceeded.  Use cl-print-insert-ellipsis.
      (cl-print-insert-ellipsis, cl-print-propertize-ellipsis)
      (cl-print-expand-ellipsis): New functions.
      
      * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-4): Test
      printing of objects nested in other objects.
      (cl-print-tests-strings, cl-print-tests-ellipsis-cons)
      (cl-print-tests-ellipsis-vector, cl-print-tests-ellipsis-struct)
      (cl-print-tests-ellipsis-circular): New tests.
      (cl-print-tests-check-ellipsis-expansion)
      (cl-print-tests-check-ellipsis-expansion-rx): New functions.
      eba16e5e
  5. 02 Aug, 2018 1 commit
    • Eli Zaretskii's avatar
      Avoid assertion violations in maybe_produce_line_number · f0b8e64f
      Eli Zaretskii authored
      * src/xdisp.c (redisplay_window): Make sure desired_matrix is
      cleared before calling try_window.  This is important when
      display-line-numbers is non-nil, because line-number display code
      assumes each glyph row is completely cleared when it is called to
      produce a line number.  (Bug#32358)
      f0b8e64f