1. 03 Aug, 2018 15 commits
    • 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.
    • 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
      * 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--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--strip-instrumentation): New function.
      (edebug--unwrap-and-add-info): Remove.
      (edebug-unwrap-frame, edebug-add-source-info): New functions.
      (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.
    • 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.
    • 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
      * test/lisp/emacs-lisp/cl-print-tests.el
      (cl-print-tests-print-to-string-with-limit): New test.
    • 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.
    • 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--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-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.
    • 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.
    • 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.
    • 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
      (backtrace--set-feature): New function.
      (backtrace-mode): Use indent functions from Lisp modes.
    • 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
    • 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
      Remove initialization of backtrace-view.
    • 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
      (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
      (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-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.
    • 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
    • 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
      (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-rx): New functions.
  2. 02 Aug, 2018 2 commits
    • Tino Calancha's avatar
      New commands to create an empty file · e65ec81f
      Tino Calancha authored
      Similarly as `create-directory', `dired-create-directory',
      the new commands create the parent dirs as needed (Bug#24150).
      * lisp/files.el (make-empty-file): New command.
      * lisp/dired-aux.el (dired-create-empty-file): New command.
      (dired--find-topmost-parent-dir): New function extracted
      from `dired-create-directory'.
      (dired-create-directory, dired-create-empty-file): Use it.
      * lisp/dired.el (dired-mode-map):
      Add menu entry for `dired-create-empty-file'.
      * doc/emacs/dired.texi (Misc Dired Features)
      * doc/lispref/files.texi (Create/Delete Dirs): Update manual.
      ; * etc/NEWS: Announce the changes.
    • Paul Eggert's avatar
      Substitute a <ieee754.h> on hosts lacking it · d216d7d2
      Paul Eggert authored
      * .gitignore: Add lib/ieee754.h.
      * admin/merge-gnulib (GNULIB_MODULES): Add ieee754-h.
      * configure.ac: Remove ieee754.h check, as Gnulib now does that.
      * etc/NEWS: Mention this.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/ieee754.in.h, m4/ieee754-h.m4: New files, from Gnulib.
      * src/lisp.h (IEEE_FLOATING_POINT): Now a macro so that it
      can be used in #if.
      * src/lread.c, src/print.c: Include <ieee754.h> if
      * src/lread.c (string_to_number):
      * src/print.c (float_to_string):
      Process NaNs only on IEEE hosts, and assume <ieee754.h>
      in that case.
  3. 01 Aug, 2018 8 commits
    • Michael Albinus's avatar
      Fix Bug#32325 · 2f37ecae
      Michael Albinus authored
      * lisp/net/tramp-sh.el (tramp-sh-handle-make-directory): In case
      of PARENTS flush also upper directories caches.  (Bug#32325)
    • Gemini Lasswell's avatar
      Fix Edebug spec for cl-macrolet (bug#29919) · df7371b8
      Gemini Lasswell authored
      Add an Edebug matching function for cl-macrolet which keeps track of
      its bindings and treats them as macros without Edebug specs when found
      in the body of the expression.
      * lisp/emacs-lisp/edebug.el (edebug--cl-macrolet-defs): New variable.
      (edebug-list-form-args): Use it.
      (edebug--current-cl-macrolet-defs): New variable.
      (edebug-match-cl-macrolet-expr, edebug-match-cl-macrolet-name)
      (edebug-match-cl-macrolet-body): New functions.
      * lisp/emacs-lisp/cl-macs.el (cl-macrolet): Use cl-macrolet-expr
      for Edebug spec.
      * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-cl-macrolet):
      New test.
      * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
      (edebug-test-code-use-cl-macrolet): New function.
    • Stephen Berman's avatar
      Fix todo-mode commands called on done items separator · 22d463ed
      Stephen Berman authored
      The done items separator is not reachable by todo-mode navigation
      commands, but it is e.g. by C-n and C-p.  Ensure that invoking
      todo-mode commands with point on the separator does not result in
      unexpected results, errors or file corruption (bug#32343).
      * lisp/calendar/todo-mode.el (todo-insert-item--basic): Make
      copying item and inserting item "here" noops when invoked on done
      items separator.  Consolidate error handling of these cases.  Also
      restrict "here" insertion to valid positions in the current
      category, since this is simpler than the previous behavior of
      inserting as the first item, which was moreover undocumented,
      counterintuitive and superfluous.
      (todo-set-item-priority, todo-move-item, todo-item-done)
      (todo-item-start, todo-item-end): Make noops when invoked on done
      items separator.
      * test/lisp/calendar/todo-mode-tests.el: Require ert-x.
      (todo-test--insert-item): Add formal parameters of
      (todo-test--done-items-separator): New function.
      (todo-test-done-items-separator07): New tests.
    • Glenn Morris's avatar
      ; Auto-commit of loaddefs files. · cabe9e51
      Glenn Morris authored
    • Paul Eggert's avatar
      Read and print NaN significand if <ieee754.h> · 6e37d2fd
      Paul Eggert authored
      * configure.ac: Check for ieee754.h.
      * doc/lispref/numbers.texi (Float Basics): Document
      that NaN string representation digits are machine-dependent.
      * etc/NEWS: Mention the change.
      * src/lread.c, src/print.c [HAVE_IEEE754_H]: Include ieee754.h.
      * src/lread.c (string_to_number) [HAVE_IEEE754_H]:
      * src/print.c (float_to_string) [HAVE_IEEE754_H]:
      Read and print NaN significand.
    • Paul Eggert's avatar
      Simplify by assuming C99 math.h isnan etc. · e28a3743
      Paul Eggert authored
      These should be portable nowadays.
      * src/data.c (isnan): Remove.
      * src/floatfns.c (isfinite, isnan): Remove.
      * src/print.c: Include math.h, for isinf and isnan.
      (float_to_string): Simplify by using them.
    • Stephen Gildea's avatar
    • Stephen Gildea's avatar
      Reset mh-blacklist and mh-whitelist on folder undo · 17205d36
      Stephen Gildea authored
      * mh-funcs.el (mh-undo-folder): Set mh-blacklist and mh-whitelist
      to nil, as is done with the other lists of pending operations.
  4. 31 Jul, 2018 1 commit
    • Michael Albinus's avatar
      Fix Bug#32304 · 82d6416a
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-handle-substitute-in-file-name):
      Handle special cas on Cygwin and MS-Windows.  (Bug#32304)
  5. 30 Jul, 2018 2 commits
  6. 29 Jul, 2018 9 commits
  7. 28 Jul, 2018 3 commits
    • Stephen Berman's avatar
      Fix bugs in wdired.el involving dired-filename property · 8a563d97
      Stephen Berman authored
      After every change in wdired-mode, put the dired-filename text
      property on the file name.  This ensures that changing some but not
      all characters in the name succeeds with non-nil
      wdired-use-interactive-rename (bug#32173) and it also ensures that
      changed names can be found (e.g. by dired-isearch-filenames) while
      still in wdired-mode.
      * lisp/wdired.el (wdired--restore-dired-filename-prop): New function.
      (wdired-change-to-wdired-mode): Add it to after-change-functions.
      (wdired-change-to-dired-mode): Remove it from after-change-functions.
      (wdired-finish-edit): Move invocation of
      wdired-change-to-dired-mode below invocation of wdired-do-renames,
      so that the latter runs wdired--restore-dired-filename-prop, but
      above the invocation of revert-buffer to avoid using
      wdired-revert, which changes back to wdired-mode.
      (wdired-search-and-rename): Wrap renaming in unwind-protect and if
      user types C-g when prompted to change the file name, make sure we
      return to dired-mode.
    • Stephen Berman's avatar
      Add initial tests for wdired.el · 67679f0c
      Stephen Berman authored
      * test/lisp/wdired-tests.el: New file.
    • Stephen Berman's avatar
      Fix use of non-nil wdired-use-interactive-rename · 831a3cb3
      Stephen Berman authored
      This is a fairly minimal fix for the release branch; a more
      comprehensive fix is on master, so do not merge this to master.
      * lisp/wdired.el (wdired-search-and-rename): Remove dired-filename
      text property in order to find new filename when it only partially
      replaces old filename (bug#32173).  If user quits before renaming
      succeeds, restore the dired-filename text property.