summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/edebug.el
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug #40992 whilst still allowing breakpoint highlights in edebugAlan Mackenzie2020-05-111-15/+38
| | | | | | | | | | | | | | | | | | | | | | | Strategy: when an instrumented function gets re-evaluated, save the former value of its symbol's `edebug' property in the new propery `ghost-edebug'. If this function is still being edebugged, edebug will then access its info from this new property. Also fix the bug whereby compile-defun'ing an instrumented function prevents the function being re-instrumented by I (edebug-instrument-callee). * lisp/emacs-lisp/edebug.el (edebug-get-edebug-or-ghost): New function. (edebug-read-and-maybe-wrap-form1): save value of `edebug' property in 'ghost-edebug'. (edebug-make-form-wrapper): Set value of `ghost-edebug' to nil. (edebug-make-form-wrapper, edebug-find-stop-point, edebug-next-break-point) (edebug-modify-breakpoint, edebug--overlay-breakpoints, edebug-set-breakpoint) (edebug-unset-breakpoints, edebug-toggle-disable-breakpoint) (edebug--backtrace-goto-source, edebug-display-freq-count) (edebug-set-conditional-breakpoint): Use edebug-get-edebug-or-ghost to access edebug information. (edebug-instrument-function): Also check a function is a cons before declaring it "already instrumented".
* Fix bug #40766, an error in edebug spec handlingAlan Mackenzie2020-04-241-4/+1
| | | | | | | | | | Also remove some debris. * lisp/emacs-lisp/edebug.el (edebug-spec): Move the entry for edebug-spec-list to before that for vector in the &or form. This assures that in a dotted list of vectors, that list gets handled correctly by edebug-spec-list rather than wrongly by (vector ...). (def-edebug-spec &key): Remove, since it is ill formed and superfluous.
* Remove obsolete XEmacs commentStefan Kangas2020-03-211-1/+0
| | | | | * lisp/emacs-lisp/edebug.el (edebug--display-1): Remove comment regarding an XEmacs exclusive variable.
* Introduce element &error into edebug specification lists for macrosAlan Mackenzie2020-01-171-0/+12
| | | | | | | | | | | | | | | This fixes bug #37540. * lisp/emacs-lisp/edebug.el (top level): New entry for &error in alist used to associate elements with their handling functions. (edebug-match-&error): New function. (nested-backquote-form): Use the new element &error to abort instrumentation on encountering a three deep nesting of backquotes (without intervening commas). * doc/lispref/edebug.texi (Specification List): Add an entry for &error. * etc/NEWS: Add an entry for &error.
* edebug: remove ancient code for ancient XEmacs support libsGlenn Morris2020-01-161-12/+0
| | | | | | * lisp/emacs-lisp/edebug.el (edebug--require-cl-read): Remove. (edebug-setup-hook, cl-read-load-hooks): Don't modify. (edebug-unload-function): Don't modify cl-read-load-hooks.
* Merge from origin/emacs-27Paul Eggert2020-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | 186152ba40 Pacify gcc -Wunused-function on Ubuntu 18.04.3 4cd143aded Fix copyright years by hand 365e01cc9f Update copyright year to 2020 cd2c156163 ; * etc/NEWS: Make the description of XDG fallback more ac... # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex
| * Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* | Don't bind XEmacs-only variable in edebugLars Ingebrigtsen2019-12-251-3/+1
|/ | | | | * lisp/emacs-lisp/edebug.el (edebug-safe-prin1-to-string): Remove binding of XEmacs-only variable print-readably.
* * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): Use 'user-error'.Juri Linkov2019-12-131-1/+1
|
* Fix edebug instrumentation removing from advised functionsMichael Heerdegen2019-11-231-6/+22
| | | | | * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): Handle advised functions correctly.
* Make edebug-remove-instrumentation remove macro instrumentationLars Ingebrigtsen2019-11-151-2/+3
| | | | | | * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): Macros can also have edebug instrumentation, so remove that as well (bug#38195).
* Allow using edebug-remove-instrumentation more fine-grainedLars Ingebrigtsen2019-11-141-17/+31
| | | | | | * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): Prompt the user for what functions to remove instrumentation from a la cancel-edebug-on-entry (bug#38195).
* Really enable setting a breakpoint without instrumenting firstLars Ingebrigtsen2019-11-011-1/+3
| | | | | * lisp/emacs-lisp/edebug.el (edebug-set-breakpoint): Really enable setting a breakpoint without instrumenting first (bug#23469).
* Make edebug-eval-last-sexp interactively take a zero prefixLars Ingebrigtsen2019-10-221-10/+29
| | | | | | * lisp/emacs-lisp/edebug.el (edebug-eval-last-sexp): Make the zero prefix work analogously to in eval-last-sexp (bug#28895). (edebug-eval-print-last-sexp): Ditto.
* Tiny clean-up of previous edebug patchLars Ingebrigtsen2019-10-211-1/+1
| | | | | * lisp/emacs-lisp/edebug.el (edebug--overlay-breakpoints): Clean up code slightly.
* Ensure we always remove the breakpoint overlaysLars Ingebrigtsen2019-10-211-1/+1
| | | | | | * lisp/emacs-lisp/edebug.el (edebug--display-1): Remove the overlays here -- this cleans up after exiting no matter how we exited.
* Add fringe markers to edebug breakpointsLars Ingebrigtsen2019-10-211-5/+18
| | | | | | * lisp/emacs-lisp/edebug.el (edebug--overlay-breakpoints): Set a fringe element to mark the breakpoint. (edebug-breakpoint): Fringe marker.
* Add a command to toggle an edebug breakpointLars Ingebrigtsen2019-10-201-4/+39
| | | | | | | | | | * doc/lispref/edebug.texi (Breakpoints): Document this. * lisp/emacs-lisp/edebug.el (edebug-disabled-breakpoint): New face (bug#23472). (edebug-enabled-breakpoint): Rename. (edebug--overlay-breakpoints): Use the new face. (edebug-toggle-disable-breakpoint): New command and keystroke.
* Make edebug-mode-map take precedenceLars Ingebrigtsen2019-10-201-2/+6
| | | | | | * lisp/emacs-lisp/edebug.el (edebug--recursive-edit): Bind minor-mode-overriding-map-alist to avoid other minor modes hiding the edebug commands (bug#11018).
* Fix edebug--restore-breakpoints re-instrumentinging bug-outLars Ingebrigtsen2019-10-201-17/+18
| | | | | * lisp/emacs-lisp/edebug.el (edebug--restore-breakpoints): Don't bug out when instrumenting/de-instrumenting/re-instrumenting.
* Add a new edebug-breakpoint faceLars Ingebrigtsen2019-10-201-1/+4
| | | | | | * doc/lispref/edebug.texi (Breakpoints): Mention it. * lisp/emacs-lisp/edebug.el (edebug-breakpoint): New face.
* New command to clear all breakpoints in a functionLars Ingebrigtsen2019-10-201-0/+12
| | | | | | | * doc/lispref/edebug.texi (Breakpoints): Mention it. * lisp/emacs-lisp/edebug.el (edebug-unset-breakpoints): New command and keystroke.
* Preserve breakpoints when Edebug-reinstrumenting functionsLars Ingebrigtsen2019-10-201-6/+27
| | | | | | | * lisp/emacs-lisp/edebug.el (edebug--overlay-breakpoints): New function (bug#23470). * lisp/emacs-lisp/seq.el (seq-position): Autoload.
* Change default to cancel all edebug-on-entry in cancel-edebug-on-entryLars Ingebrigtsen2019-10-201-11/+20
| | | | | * lisp/emacs-lisp/edebug.el (cancel-edebug-on-entry): Make the default to cancel all edebug-on-entry.
* Use user-error in cancel-edebug-on-entryLars Ingebrigtsen2019-10-201-1/+1
| | | | | * lisp/emacs-lisp/edebug.el (cancel-edebug-on-entry): This is a user-class error, so use user-error.
* Instrument function if it hasn't been already in edebug-set-breakpointLars Ingebrigtsen2019-10-201-0/+5
| | | | | * lisp/emacs-lisp/edebug.el (edebug-set-breakpoint): Instrument form automatically when using this function (bug#23469).
* Fix up previous edebug breakpoint overlay changeLars Ingebrigtsen2019-10-201-6/+8
| | | | | | * lisp/emacs-lisp/edebug.el (edebug--overlay-breakpoints): Only make the overlays in edebug mode, so that we remove them when we exit.
* Mark breakpoints in edebug with highlightsLars Ingebrigtsen2019-10-201-1/+23
| | | | | | | | * lisp/emacs-lisp/edebug.el (edebug--overlay-breakpoints) (edebug--overlay-breakpoints-remove): New functions (bug#23468). (edebug-modify-breakpoint): Use them to highlight breakpoints. (edebug--display-1): Restore breakpoint highlights. (edebug--recursive-edit): Remove highlights on exit.
* New command edebug-remove-instrumentationLars Ingebrigtsen2019-10-201-0/+18
| | | | | | | * doc/lispref/edebug.texi (Instrumenting): Document it. * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): New command (bug#15843).
* Fix doc string and interactive spec of cancel-edebug-on-entryLars Ingebrigtsen2019-10-201-1/+24
| | | | | | | | * lisp/emacs-lisp/edebug.el (cancel-edebug-on-entry): Add doc string and make the interactive spec complete over functions that have the spec (bug#10806). (edebug-cancel-edebug-on-entry): Add alias for discoverability. (edebug-on-entry): Clarify what this command does.
* lisp/*.el: Force non-nil result to t, to match docstringJuanma Barranquero2019-10-171-1/+2
| | | | | | | | | | | | | * lisp/emacs-lock.el (emacs-lock-live-process-p): * lisp/shadowfile.el (shadow-file-match): * lisp/emacs-lisp/edebug.el (edebug-basic-spec): * lisp/mail/rmail.el (rmail-expunge-confirmed): * lisp/net/soap-client.el (soap-should-encode-value-for-xs-element): * lisp/progmodes/idlwave.el (idlwave-quoted): * lisp/progmodes/idlw-shell.el (idlwave-shell-filename-string): * lisp/textmodes/refbib.el (r2b-isa-proceedings): * lisp/textmodes/texnfo-upd.el (texinfo-find-lower-level-node): Normalize boolean result.
* Allow global-edebug-prefix to be nilLars Ingebrigtsen2019-10-091-2/+3
| | | | | | * lisp/emacs-lisp/edebug.el (global-edebug-prefix): Allow global-edebug-prefix to be nil (if the user doesn't want that prefix) (bug#25188).
* New edebug-spec, nested-backquote-form. This fixes bug #31090Alan Mackenzie2019-09-241-0/+13
| | | | | | | * lisp/emacs-lisp/edebug.el: (nested-backquote-form): a new edebug-spec which handles nested backquote structures without a , or ,@ "between" the outer and inner backquotes. (backquote-form): Use nested-backquote-form.
* edebug.el comment fixLars Ingebrigtsen2019-07-271-1/+1
| | | | | * lisp/emacs-lisp/edebug.el: Fix comment referring to non-existent variable (bug#25188).
* Rename coverage symbols in edebug to avoid collisionsLars Ingebrigtsen2019-07-271-5/+5
| | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-clear-coverage): Use edebug-unknown and edebug-ok-coverage instead of unknown and ok-coverage to avoid naming collisions with packages that use those two symbols (bug#25471). (edebug--update-coverage, edebug-display-freq-count): Ditto.
* Go back to "Maintainer: emacs-devel@gnu.org"Paul Eggert2019-05-251-0/+1
| | | | | | Restore lines saying "Maintainer: emacs-devel@gnu.org" when there is no special maintainer for a file. Although this wasn't documented it was common practice and removing the lines didn't have consensus.
* Fixes for "Maintainer:" and related linesPaul Eggert2019-05-191-1/+0
| | | | | | Mostly, this just removes "Maintainer: emacs-devel@gnu.org" lines, which are not that useful. It also cleans up and regularizes a few similar lines.
* * lisp/emacs-lisp/edebug.el: Better handle instrumentation of `end-of-defun`Stefan Monnier2019-05-011-51/+34
| | | | | | Remove redundant :group args. (edebug-read-top-level-form): Let-bind edebug-active. (edebug-active): Move before this new first use.
* * lisp/subr.el (setq-default): Define as a macroStefan Monnier2019-04-011-1/+0
| | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-setq-default): Delete. (byte-compile-set-default): Inline the part that it used. * lisp/emacs-lisp/edebug.el (setq-default): Remove the debug spec. * src/data.c (Fsetq_default): Delete. (syms_of_data): Don't register.
* Make edebug-eval-expression support code completionFederico Tedin2019-03-221-3/+1
| | | | | * lisp/emacs-lisp/edebug.el (edebug-eval-expression): Use read--expression instead of read-from-minibuffer. (Bug#34065)
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Merge from origin/emacs-26Glenn Morris2018-11-201-2/+2
|\| | | | | | | d667318 (origin/emacs-26) Fix two Edebug defcustoms (bug#33428)
| * Fix two Edebug defcustoms (bug#33428)Stephen Berman2018-11-191-2/+2
| | | | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-print-length) (edebug-print-level): Fix customization type to allow setting the documented valid value nil via the Customize interface.
* | edebug.el: Move window focus switch into edebug-pop-to-bufferAlan Mackenzie2018-10-231-15/+9
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/follow.el (edebug-focus-frame): Remove. (edebug-pop-to-buffer): Call x-focus-frame for GUI frames. (edebug-default-enter, edebug--display-1): Replace call to edebug-focus-frame with x-focus-frame. (edebug-where, edebug-bounce-point, edebug-visit-eval-list): Remove no longer needed calls to edebug-focus-frame.
* | In edebug in GUIs, move focus to the selected frame.Alan Mackenzie2018-10-191-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thus when entering edebug, the focus will be moved to the frame with the source being debugged, and when its finished, the focus will move back. Commands edebug-visit-eval-list (`E') and edebug-bounce-point (`p') have been likewise amended. * src/keyboard.c (readable_events): Handle FOCUS_OUT_EVENT as an invisible event. This prevents input-pending-p returning t when one of these events arrives, and thus obviates an instant termination of sit-for when there's no "real" event waiting. * lisp/emacs-lisp/edebug.el (edebug-focus-frame): New function. (edebug-default-enter, edebug--display-1, edbug-where, edebug-bounce-point) (edebug-visit-eval-list): Call edebug-focus-frame to move focus into the window newly selected by edebug-pop-to-buffer.
* | Prune most-positive-fixnum from Lisp sourcePaul Eggert2018-08-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I looked through all instances of most-negative-fixnum and most-positive-fixnum in the Lisp source code, and when it was easy I removed assumptions that integers fit in fixnums. The remaining instances are either nontrivial to fix, or are inherent to the algorithm. * lisp/arc-mode.el (archive-l-e): Do not convert to float, since we have bignums now. All uses changed. * lisp/calc/calc.el (math-bignum): Don’t special-case most-negative-fixnum. * lisp/calendar/parse-time.el (parse-time-string): * lisp/emacs-lisp/edebug.el (edebug-read-special): * lisp/emacs-lisp/package.el (package--remove-hidden): * lisp/gnus/nnfolder.el (nnfolder-read-folder): * lisp/international/mule-util.el (filepos-to-bufferpos--dos): * lisp/menu-bar.el (menu-bar-update-buffers): * lisp/net/rcirc.el (rcirc-handler-317): * lisp/org/org-agenda.el (org-cmp-ts): * lisp/window.el (window--resize-child-windows): Avoid arbitrary limit to most-positive-fixnum or to most-negative-fixnum. * lisp/calendar/time-date.el (days-to-time): * lisp/erc/erc-dcc.el (erc-unpack-int): Don’t worry about integer overflow. * lisp/cedet/semantic/wisent/comp.el (wisent-BITS-PER-WORD): * lisp/gnus/message.el (message-unique-id): * lisp/org/org-footnote.el (org-footnote-new): Simplify. * lisp/erc/erc-dcc.el (erc-most-positive-int-bytes) (erc-most-positive-int-msb): Remove; no longer needed. * lisp/net/imap.el (imap-string-to-integer): Remove; unused. * lisp/org/org-element.el (org-element--cache-generate-key): Document fixnum limitation.
* | Fix typo in edebug-backtrace-hide-instrumentation's docstring.Gemini Lasswell2018-08-031-1/+1
| | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-backtrace-hide-instrumentation): Fix docstring copypasta.
* | Add new commands to Edebug backtracesGemini Lasswell2018-08-031-39/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Always make buttons from function names in backtracesGemini Lasswell2018-08-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | * 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.