Commit graph

311 commits

Author SHA1 Message Date
Stefan Kangas
5f69c222f4 Prefer defvar-local in emacs-lisp/*.el
* lisp/emacs-lisp/chart.el (chart-local-object):
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode)
(define-globalized-minor-mode):
* lisp/emacs-lisp/edebug.el:
* lisp/emacs-lisp/generic.el (generic-font-lock-keywords):
* lisp/emacs-lisp/re-builder.el (reb-regexp, reb-regexp-src)
(reb-overlays):
* lisp/emacs-lisp/syntax.el
(syntax-propertize-extend-region-functions): Prefer defvar-local.
2021-01-31 14:55:53 +01:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Lars Ingebrigtsen
714ca849ba Improve the edebug-form-data doc string
* lisp/emacs-lisp/edebug.el (edebug-form-data): Doc string
clarification (bug#42776).
2020-12-26 23:13:29 +01:00
Stefan Kangas
f0f2c8563b Don't quote lambdas in emacs-lisp/*.el
* lisp/emacs-lisp/cl-seq.el (cl--parsing-keywords, cl-sort):
* lisp/emacs-lisp/cl-macs.el (cl-typecase):
* lisp/emacs-lisp/cl-extra.el (cl-some, cl-every)
(cl--map-keymap-recursively):
* lisp/emacs-lisp/advice.el (ad-insert-argument-access-forms):
* lisp/emacs-lisp/edebug.el (edebug-sort-alist)
(edebug-set-windows):
* lisp/emacs-lisp/pp.el (pp-display-expression):
* lisp/emacs-lisp/regi.el (regi-interpret): Don't quote lambdas.
2020-11-16 18:08:27 +01:00
Lars Ingebrigtsen
4ad3402fb3 Remove mention of `edebug-on-signal' from a doc string
* lisp/emacs-lisp/edebug.el (edebug-mode): Don't mention
non-existent user option (bug#44577).
2020-11-12 13:39:40 +01:00
Stefan Kangas
158d2a1f50 Remove some Emacs 19 compat code and references
* lisp/progmodes/sql.el:
* lisp/mh-e/mh-show.el (mh-display-msg): Remove Emacs 19 compat code.
* lisp/emacs-lisp/edebug.el (edebug-mark-marker): Make into
obsolete alias for mark-marker.
(edebug--display-1, edebug-bounce-point)
(edebug-outside-excursion): Adjust callers.
* lisp/net/snmp-mode.el:
* lisp/forms.el: Remove references to Emacs 19.
(forms-use-text-properties): Doc fix.
2020-10-25 18:27:19 +01:00
Stefan Kangas
fd5c08892e Remove some references to Emacs 18 and 19
* doc/misc/forms.texi (Modifying Forms Contents, Error Messages):
* lisp/arc-mode.el:
* lisp/emacs-lisp/edebug.el (edebug-temp-display-freq-count):
* lisp/type-break.el: Remove some references to Emacs 18 and 19.
2020-10-16 15:27:25 +02:00
Stefan Kangas
bc5da2c3fb Avoid some uses of obsolete function interactive-p
* doc/lispref/help.texi (Accessing Documentation):
* lisp/cedet/data-debug.el:
* lisp/emacs-lisp/edebug.el (edebug-wrap-def-body):
* lisp/simple.el (append-next-kill):
* test/manual/cedet/cedet-utests.el (cedet-utest, pulse-test):
* test/manual/cedet/semantic-tests.el (semantic-lex-spp-write-utest)
(semantic-symref-test-count-hits-in-tag): Use 'called-interactively-p'
instead of obsolete function 'interactive-p'.
2020-08-24 04:27:27 +02:00
Philipp Stephani
ca419812d3 Avoid duplicate Edebug symbols when backtracking (Bug#42701)
When Edebug backtracks, it nevertheless generates definitions for the
non-matching branches, see Bug#41988 and Bug#42701.  This should be
fixed eventually (probably by deferring the definition until a branch
is known to match), but for now add a band-aid to avoid these
duplicate symbols, at least for anonymous forms.

* lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Regenerate
anonymous names.

* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests-duplicate-symbol-backtrack): New regression test.
2020-08-03 21:07:32 +02:00
Philipp Stephani
d8ab98843e Avoid duplicate Edebug symbols when using ‘cl-flet’ (Bug#41989)
* lisp/emacs-lisp/edebug.el (edebug-match-:unique): Add a new
‘:unique’ specifier to generate unique names.

* lisp/emacs-lisp/cl-macs.el (cl-flet): Use it.  This requires
inlining the ‘cl-defun’ specification.

* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-cl-flet): New
unit test.

* doc/lispref/edebug.texi (Specification List): Document new ‘:unique’
construct.
2020-08-02 17:39:24 +02:00
Philipp Stephani
e6eb554b95 Don’t generate duplicate symbols for secondary CL methods (Bug#42671)
* lisp/emacs-lisp/edebug.el
(edebug-match-cl-generic-method-qualifier): Add matcher for
‘cl-defmethod’ qualifier.

* lisp/emacs-lisp/cl-generic.el (cl-defmethod): Use it.

* test/lisp/emacs-lisp/edebug-tests.el
(edebug-cl-defmethod-qualifier): New unit test.
2020-08-02 16:06:41 +02:00
Stefan Kangas
7899fa4309 Declare some ancient compat aliases obsolete (Bug#41328)
* lisp/comint.el (comint-read-noecho):
* lisp/emacs-lisp/edebug.el (edebug-all-defuns):
* lisp/man.el (manual-entry):
* lisp/vc/log-edit.el (vc-log-mode-map, vc-log-entry-mode): Declare
ancient backwards-compatibility aliases and functions obsolete.  The
oldest in this list was added in 1992, and the most recent in 2004.

* lisp/net/telnet.el (telnet-initial-filter): Don't use
`comint-read-noecho'.
2020-07-31 06:02:30 +02:00
Alan Mackenzie
dd0b910f1a Fix bug #40992 whilst still allowing breakpoint highlights in edebug
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".
2020-05-11 20:05:54 +00:00
Alan Mackenzie
85fb942733 Fix bug #40766, an error in edebug spec handling
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.
2020-04-24 15:51:43 +00:00
Stefan Kangas
271f9a6aed Remove obsolete XEmacs comment
* lisp/emacs-lisp/edebug.el (edebug--display-1): Remove comment
regarding an XEmacs exclusive variable.
2020-03-21 07:38:44 +01:00
Alan Mackenzie
8d2fecdf6c Introduce element &error into edebug specification lists for macros
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.
2020-01-17 21:53:13 +00:00
Glenn Morris
ee0e3a792b edebug: remove ancient code for ancient XEmacs support libs
* 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.
2020-01-16 21:15:02 -08:00
Paul Eggert
c6fb86b40b Merge from origin/emacs-27
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
2020-01-01 01:08:16 +00:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Lars Ingebrigtsen
19b28abc9b Don't bind XEmacs-only variable in edebug
* lisp/emacs-lisp/edebug.el (edebug-safe-prin1-to-string): Remove
binding of XEmacs-only variable print-readably.
2019-12-25 17:14:26 +01:00
Juri Linkov
9eaad4de02 * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): Use 'user-error'. 2019-12-13 01:47:03 +02:00
Michael Heerdegen
311ca036f4 Fix edebug instrumentation removing from advised functions
* lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): Handle
advised functions correctly.
2019-11-23 14:20:50 +01:00
Lars Ingebrigtsen
ecc21845ea Make edebug-remove-instrumentation remove macro instrumentation
* lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation):
Macros can also have edebug instrumentation, so remove that as
well (bug#38195).
2019-11-15 09:00:53 +01:00
Lars Ingebrigtsen
d9ea77af4c Allow using edebug-remove-instrumentation more fine-grained
* 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).
2019-11-14 06:20:04 +01:00
Lars Ingebrigtsen
0714d6664c Really enable setting a breakpoint without instrumenting first
* lisp/emacs-lisp/edebug.el (edebug-set-breakpoint): Really enable
setting a breakpoint without instrumenting first (bug#23469).
2019-11-01 17:42:28 +01:00
Lars Ingebrigtsen
7f5d92e643 Make edebug-eval-last-sexp interactively take a zero prefix
* 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.
2019-10-22 13:12:08 +02:00
Lars Ingebrigtsen
cf294d78a1 Tiny clean-up of previous edebug patch
* lisp/emacs-lisp/edebug.el (edebug--overlay-breakpoints): Clean
up code slightly.
2019-10-21 22:28:49 +02:00
Lars Ingebrigtsen
7e5f3a8091 Ensure we always remove the breakpoint overlays
* lisp/emacs-lisp/edebug.el (edebug--display-1): Remove the
overlays here -- this cleans up after exiting no matter how we
exited.
2019-10-21 22:22:16 +02:00
Lars Ingebrigtsen
73cea54064 Add fringe markers to edebug breakpoints
* lisp/emacs-lisp/edebug.el (edebug--overlay-breakpoints): Set a
fringe element to mark the breakpoint.
(edebug-breakpoint): Fringe marker.
2019-10-21 22:22:16 +02:00
Lars Ingebrigtsen
78cb3791fa Add a command to toggle an edebug breakpoint
* 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.
2019-10-20 23:46:50 +02:00
Lars Ingebrigtsen
cd4f707a98 Make edebug-mode-map take precedence
* 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).
2019-10-20 17:07:01 +02:00
Lars Ingebrigtsen
34963d632d Fix edebug--restore-breakpoints re-instrumentinging bug-out
* lisp/emacs-lisp/edebug.el (edebug--restore-breakpoints): Don't
bug out when instrumenting/de-instrumenting/re-instrumenting.
2019-10-20 14:27:38 +02:00
Lars Ingebrigtsen
34744278ba Add a new edebug-breakpoint face
* doc/lispref/edebug.texi (Breakpoints): Mention it.

* lisp/emacs-lisp/edebug.el (edebug-breakpoint): New face.
2019-10-20 14:09:36 +02:00
Lars Ingebrigtsen
23b3032702 New command to clear all breakpoints in a function
* doc/lispref/edebug.texi (Breakpoints): Mention it.

* lisp/emacs-lisp/edebug.el (edebug-unset-breakpoints): New
command and keystroke.
2019-10-20 13:40:03 +02:00
Lars Ingebrigtsen
a4e7c15484 Preserve breakpoints when Edebug-reinstrumenting functions
* lisp/emacs-lisp/edebug.el (edebug--overlay-breakpoints): New
function (bug#23470).

* lisp/emacs-lisp/seq.el (seq-position): Autoload.
2019-10-20 13:11:04 +02:00
Lars Ingebrigtsen
bee7beee8e Change default to cancel all edebug-on-entry in cancel-edebug-on-entry
* lisp/emacs-lisp/edebug.el (cancel-edebug-on-entry): Make the
default to cancel all edebug-on-entry.
2019-10-20 12:37:37 +02:00
Lars Ingebrigtsen
665208ce59 Use user-error in cancel-edebug-on-entry
* lisp/emacs-lisp/edebug.el (cancel-edebug-on-entry): This is a
user-class error, so use user-error.
2019-10-20 12:28:36 +02:00
Lars Ingebrigtsen
0794354b24 Instrument function if it hasn't been already in edebug-set-breakpoint
* lisp/emacs-lisp/edebug.el (edebug-set-breakpoint): Instrument
form automatically when using this function (bug#23469).
2019-10-20 12:25:59 +02:00
Lars Ingebrigtsen
4503af6c9e Fix up previous edebug breakpoint overlay change
* lisp/emacs-lisp/edebug.el (edebug--overlay-breakpoints): Only
make the overlays in edebug mode, so that we remove them when we
exit.
2019-10-20 12:17:28 +02:00
Lars Ingebrigtsen
e8b3a15cb6 Mark breakpoints in edebug with highlights
* 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.
2019-10-20 12:17:28 +02:00
Lars Ingebrigtsen
e2acf4d29d New command edebug-remove-instrumentation
* doc/lispref/edebug.texi (Instrumenting): Document it.

* lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): New
command (bug#15843).
2019-10-20 11:29:34 +02:00
Lars Ingebrigtsen
cfaecdb293 Fix doc string and interactive spec of cancel-edebug-on-entry
* 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.
2019-10-20 10:51:08 +02:00
Juanma Barranquero
2bb0703e24 lisp/*.el: Force non-nil result to t, to match docstring
* 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.
2019-10-17 02:08:43 +02:00
Lars Ingebrigtsen
a6dfd9145f Allow global-edebug-prefix to be nil
* 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).
2019-10-09 09:26:58 +02:00
Alan Mackenzie
ef0fc0bed1 New edebug-spec, nested-backquote-form. This fixes bug #31090
* 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.
2019-09-24 17:06:20 +00:00
Lars Ingebrigtsen
60511bd89d edebug.el comment fix
* lisp/emacs-lisp/edebug.el: Fix comment referring to non-existent
variable (bug#25188).
2019-07-27 13:34:17 +02:00
Lars Ingebrigtsen
02bb676a05 Rename coverage symbols in edebug to avoid collisions
* 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.
2019-07-27 12:21:30 +02:00
Paul Eggert
f744797af1 Go back to "Maintainer: emacs-devel@gnu.org"
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.
2019-05-25 14:25:18 -07:00
Paul Eggert
bef1be8730 Fixes for "Maintainer:" and related lines
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.
2019-05-19 21:34:27 -07:00
Stefan Monnier
9e8e3975ad * lisp/emacs-lisp/edebug.el: Better handle instrumentation of end-of-defun
Remove redundant :group args.
(edebug-read-top-level-form): Let-bind edebug-active.
(edebug-active): Move before this new first use.
2019-05-01 12:45:37 -04:00