Commit graph

337 commits

Author SHA1 Message Date
Stefan Kangas
6640942221 Use format-prompt for many more prompts
* lisp/bookmark.el (bookmark-completing-read):
* lisp/calc/calc-prog.el (calc-user-define-formula):
* lisp/calc/calc-store.el (calc-permanent-variable):
* lisp/calc/calc-units.el (calc-convert-units)
(calc-convert-exact-units, calc-convert-temperature):
* lisp/cedet/semantic/complete.el
(semantic-complete-read-tag-engine):
* lisp/cus-edit.el (customize-read-group):
* lisp/dired-aux.el (dired-do-chxxx):
* lisp/dired-x.el (dired-mark-unmarked-files):
* lisp/emacs-lisp/debug.el (cancel-debug-on-entry)
(cancel-debug-on-variable-change):
* lisp/emacs-lisp/edebug.el (edebug-cancel-on-entry)
(edebug-remove-instrumentation):
* lisp/epa.el (epa-read-file-name, epa-export-keys):
* lisp/faces.el (read-face-name):
* lisp/format.el (format-decode-buffer, format-decode-region):
* lisp/gnus/gnus-art.el (gnus-read-save-file-name):
* lisp/gnus/gnus-util.el (gnus-completing-read):
* lisp/gnus/message.el (message-check-news-header-syntax):
* lisp/info.el (Info-follow-reference):
* lisp/international/mule-diag.el (describe-font)
(describe-fontset):
* lisp/international/quail.el (quail-show-keyboard-layout):
* lisp/language/cyril-util.el
(standard-display-cyrillic-translit):
* lisp/mail/rmailkwd.el (rmail-read-label):
* lisp/mail/rmailmm.el (rmail-mime-save):
* lisp/mail/rmailout.el (rmail-output-read-file-name):
* lisp/man.el (Man-goto-section, Man-follow-manual-reference):
* lisp/menu-bar.el (emacs-index--prompt):
* lisp/net/ange-ftp.el (ange-ftp-get-passwd):
* lisp/proced.el (proced-send-signal):
* lisp/progmodes/cpp.el (cpp-choose-face):
* lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation):
* lisp/progmodes/etags.el (visit-tags-table)
(visit-tags-table-buffer):
* lisp/progmodes/grep.el (grep-read-files):
* lisp/progmodes/hideif.el (hide-ifdef-define):
* lisp/progmodes/pascal.el (pascal-goto-defun):
* lisp/progmodes/prolog.el (prolog-read-predicate):
* lisp/progmodes/sql.el (sql-get-login-ext):
* lisp/ses.el (ses-define-local-printer):
* lisp/textmodes/artist.el (artist-figlet-choose-font):
* lisp/textmodes/tex-mode.el (tex-compile):
* lisp/vc/diff.el (diff):
* lisp/vc/ediff-ptch.el (ediff-prompt-for-patch-file):
* lisp/vc/ediff-util.el (ediff-read-file-name):
* lisp/vc/pcvs.el (cvs-mode-mark-on-state):
* lisp/vc/vc.el (vc-diff-build-argument-list-internal)
(vc-revision-other-window, vc-retrieve-tag):
* lisp/wid-edit.el: Prefer format-prompt unconditionally.

* lisp/org/org-capture.el (org-capture-fill-template):
* lisp/org/org-refile.el (org-refile-get-location):
* lisp/progmodes/python.el (python-eldoc-at-point):
* lisp/progmodes/verilog-mode.el (verilog-surelint-off)
(verilog-goto-defun):
* lisp/progmodes/xref.el (xref--read-identifier): Prefer format-prompt
when it is fboundp.
2021-10-05 03:44:56 +02:00
Stefan Kangas
dd1220b969 ; More stylistic docfixes in emacs-lisp/*.el found by checkdoc 2021-09-18 13:14:50 +02:00
akater
6535fd1fa9 Evaluate eql specializers
* lisp/emacs-lisp/cl-generic.el (cl-generic-generalizers): Evaluate
forms that are eql specializers.  Provide backward compatibility
with a warning.

* test/lisp/emacs-lisp/cl-generic-tests.el: Add a test.
* lisp/emacs-lisp/bindat.el (bindat--type): Adhere to the new rule.
* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Adhere to the new rule.
* lisp/emacs-lisp/map.el (map-into): Adhere to the new rule.
* lisp/emacs-lisp/radix-tree.el (map-into): Adhere to the new rule.
* lisp/frame.el (cl-generic-define-context-rewriter): Adhere to the new rule.
* lisp/gnus/gnus-search.el
(gnus-search-transform-expression): Adhere to the new rule.
* lisp/image/image-converter.el
(image-converter--probe image-converter--convert): Adhere to the new rule.
* lisp/mail/smtpmail.el (smtpmail-try-auth-method): Adhere to the new rule.
* lisp/progmodes/elisp-mode.el
(xref-backend-definitions)
(xref-backend-apropos): Adhere to the new rule.
* lisp/progmodes/etags.el (xref-backend-identifier-at-point)
(xref-backend-identifier-completion-table)
(xref-backend-identifier-completion-ignore-case)
(xref-backend-definitions)(xref-backend-apropos): Adhere to the new rule.
* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-cl-defmethod-with-types-ok)
(checkdoc-cl-defmethod-qualified-ok)
(checkdoc-cl-defmethod-with-extra-qualifier-ok): Adhere to the new rule.

* etc/NEWS: Describe the change.
2021-08-03 18:26:15 -04:00
Lars Ingebrigtsen
af529f777c Reintroduce autoloads for edebug-all-defs/edebug-all-forms
* lisp/emacs-lisp/edebug.el (edebug-all-defs, edebug-all-forms):
Reintroduce ;;;###autoload of these user options that were removed
in bae2cfe63c, because this leads to errors in a common (and
recommended) use case (bug#47516).
2021-05-09 11:47:01 +02:00
Stefan Monnier
5c07cd0f15 * lisp/emacs-lisp/debug.el (debug): Fix (bug#47588)
Don't bind `load-read-function` to nil but to its actual default value.
Actually, I'm not sure it's worth the trouble rebinding this var, but
if we do, then we should bind it to a valid value rather than to nil.

* lisp/emacs-lisp/edebug.el (edebug--eval-defun): Re-install our advice
if needed.
2021-04-18 01:03:43 -04:00
Stefan Monnier
0e2cf3b985 * lisp/emacs-lisp/edebug.el (edebug--frame): Move docstring where it belongs 2021-04-12 12:51:28 -04:00
Philipp Stephani
53dfd85a7f Edebug: Disable backtracking when hitting a &define keyword.
Edebug doesn't deal well with backtracking out of definitions, see
Bug#41988.  Rather than trying to support this rare situation (e.g. by
implementing a multipass parser), prevent it by adding an implicit
gate.

* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Disable
backtracking when hitting a &define keyword.

* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests-duplicate-&define): New unit test.
(edebug-tests--duplicate-&define): New helper macro.

* doc/lispref/edebug.texi (Backtracking): Mention &define in the list
of constructs that disable backtracking.

* etc/NEWS: Document new behavior.
2021-04-10 18:19:49 +02:00
Mattias Engdegård
a0854f939c ; Fix typos in doc strings 2021-03-12 12:12:14 +01:00
Stefan Kangas
54af0d4298 Remove redundant requires of easymenu
* lisp/allout.el:
* lisp/emacs-lisp/edebug.el:
* lisp/emacs-lisp/ert.el:
* lisp/erc/erc-menu.el:
* lisp/help-mode.el:
* lisp/net/dictionary.el:
* lisp/nxml/rng-nxml.el:
* lisp/progmodes/ebrowse.el:
* lisp/progmodes/meta-mode.el:
* lisp/progmodes/prolog.el:
* lisp/progmodes/ps-mode.el:
* lisp/progmodes/vera-mode.el:
* lisp/wid-browse.el: Remove redundant require of easymenu.  We only
use the autoloaded macro 'easy-menu-define' here.
2021-02-26 15:52:26 +01:00
Stefan Monnier
bae2cfe63c * lisp/emacs-lisp/edebug.el (eval-defun): Simplify
(edebug-all-defs, edebug-all-forms): Don't autoload since the problem
it was working around has been fixed a while back.
(edebug--eval-defun): Rename from `edebug-eval-defun` and simplify by
making it an `:around` advice.
(edebug-install-read-eval-functions)
(edebug-uninstall-read-eval-functions): Adjust accordingly.
(edebug-eval-defun): Redefine as an obsolete wrapper.

* lisp/progmodes/elisp-mode.el (elisp--eval-defun):
Use `load-read-function` so it obeys `edebug-all-(defs|forms)`.
(elisp--eval-defun): Fix recent regression introduced with
`elisp--eval-defun-result`.
2021-02-18 10:27:36 -05:00
Lars Ingebrigtsen
6735bb3d22 Adjust the edebug spec for `interactive'
* lisp/emacs-lisp/edebug.el: Adjust the edebug spec for
`interactive' for the new syntax.
2021-02-17 20:59:44 +01:00
Stefan Monnier
54e577fbc1 * lisp/emacs-lisp/edebug.el (edebug-&optional, edebug-&rest): Remove vars
According to my tests, `edebug-&optional` never has any effect.
And `edebug-&rest` can be replaced with a closure.

(edebug-&rest-wrapper): Remove function.
(edebug--match-&-spec-op): Use a closure to remember the `specs`.
2021-02-14 23:56:42 -05:00
Stefan Monnier
b939f7ad35 * Edebug: Generalize &lookup, use it for cl-macrolet and cl-generic
This allows the use of (declare (debug ...)) in the lexical macros
defined with `cl-macrolet`.  It also fixes the names used by Edebug
for the methods of `cl-generic` so it doesn't need to use gensym
and so they don't include the formal arg names any more.

* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op):
Rename from `edebug--handle-&-spec-op`.
(edebug--match-&-spec-op <&interpose>): Rename from `&lookup` and
generalize so it can let-bind dynamic variables around the rest of the parse.
(edebug-lexical-macro-ctx): Rename from `edebug--cl-macrolet-defs` and
make it into an alist.
(edebug-list-form-args): Use the specs from `edebug-lexical-macro-ctx`
when available.
(edebug--current-cl-macrolet-defs): Delete var.
(edebug-match-cl-macrolet-expr, edebug-match-cl-macrolet-name)
(edebug-match-cl-macrolet-body): Delete functions.
(def-declarations): Use new `&interpose`.
(edebug--match-declare-arg): Rename from `edebug--get-declare-spec` and
adjust to new calling convention.

* lisp/subr.el (def-edebug-elem-spec): Fix docstring.
(eval-after-load): Use `declare`.

* lisp/emacs-lisp/cl-generic.el: Fix Edebug names so we don't need
gensym any more and we only include the specializers but not the formal
arg names.
(cl--generic-edebug-name): New var.
(cl--generic-edebug-remember-name, cl--generic-edebug-make-name): New funs.
(cl-defgeneric, cl-defmethod): Use them.

* lisp/emacs-lisp/cl-macs.el: Add support for `debug` declarations in
`cl-macrolet`.
(cl-declarations-or-string):
Fix use of `lambda-doc` and allow use of `declare`.
(edebug-lexical-macro-ctx): Declare var.
(cl--edebug-macrolet-interposer): New function.
(cl-macrolet): Use it to pass the right `lexical-macro-ctx` to the body.

* lisp/emacs-lisp/pcase.el (pcase-PAT): Use new `&interpose`.
(pcase--edebug-match-pat-args): Rename from `pcase--get-edebug-spec` and
adjust to new calling convention.

* test/lisp/emacs-lisp/cl-generic-tests.el (cl-defgeneric/edebug/method):
Adjust to the new names.

* test/lisp/emacs-lisp/edebug-tests.el (edebug-cl-defmethod-qualifier)
(edebug-tests-cl-flet): Adjust to the new names.

* doc/lispref/edebug.texi (Specification List): Document &interpose.
2021-02-14 21:34:09 -05:00
Stefan Monnier
103039b06c * lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Reinstate.
Removed by accident.
2021-02-13 19:24:33 -05:00
Stefan Monnier
2d9ff601ab * lisp/emacs-lisp/edebug.el: Fix called-interactively-p
And get rid of the old special-case handling of `interactive-p`, which
is now redundant.

(edebug--called-interactively-skip): Fix lexical-binding case,
and adjust to some formerly missed call patterns.
(edebug-def-interactive, edebug-interactive-p): Remove vars.
(edebug-interactive-p-name, edebug-wrap-def-body)
(edebug-make-enter-wrapper): Remove functions.
(edebug-list-form): Don't special-case `interactive-p`.
2021-02-13 19:22:17 -05:00
Stefan Monnier
39a401ddae * lisp/emacs-lisp/edebug.el (edebug-match-lambda-expr): Delete function
(lambda-expr): Define with `def-edebug-elem-spec` instead.
(edebug--handle-&-spec-op): Remove left over code.
(interactive): Re-add mistakenly removed spec elem.

* doc/lispref/edebug.texi (Specification List): Remove `function-form`.
2021-02-13 17:50:31 -05:00
Stefan Monnier
2007afd21b * lisp/emacs-lisp/edebug.el (edebug--handle-&-spec-op <&name>): New method
(edebug--concat-name): New function.
(edebug-match-name, edebug-match-cl-generic-method-qualifier)
(edebug-match-cl-generic-method-args): Delete functions.

* doc/lispref/edebug.texi (Specification List): Document it.

* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Use `&name`.
(cl-generic--method-qualifier-p): New predicate.
(cl-defmethod): Use it and `&name`.
* lisp/emacs-lisp/cl-macs.el (cl-defun, cl-iter-defun, cl-flet):
* lisp/emacs-lisp/eieio-compat.el (defmethod):
* lisp/emacs-lisp/gv.el (gv-define-setter):
* lisp/emacs-lisp/ert.el (ert-deftest): Use `&name`.
* lisp/erc/erc-backend.el (define-erc-response-handler): Use `declare`
and `&name`.
2021-02-13 16:21:53 -05:00
Stefan Monnier
f65402f851 (backtrace-goto-source-functions): Make it a normal abnormal hook
* lisp/emacs-lisp/backtrace.el (backtrace-goto-source-functions):
Don't mark it as buffer-local any more.
(backtrace-goto-source): Use `run-hook-with-args-until-success`.

* lisp/emacs-lisp/edebug.el (edebug-pop-to-backtrace): Clarify that the
hook is only intended to be modified buffer-locally.
2021-02-13 10:41:45 -05:00
Stefan Monnier
ca0842347e Edebug: Make it possible to debug gv-expanders in declare
Arrange for declarations to be able to specify their own specs via
the `edebug-declaration-spec` property.

* lisp/emacs-lisp/edebug.el: (edebug--get-declare-spec): New function.
(def-declarations): New spec element.
(defun, defmacro): Use it in their spec.

* lisp/emacs-lisp/gv.el (gv-expander, gv-setter):
Set `edebug-declaration-spec`.

* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-gv-expander): New test.

* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
(edebug-test-code-use-gv-expander): New test case.
2021-02-12 22:53:38 -05:00
Stefan Monnier
d1be48fded Edebug: Overload edebug-form-spec even less
The `edebug-form-spec` symbol property was used both to map forms's
head symbol to the corresponding spec, and to map spec element names
to their expansion.

This lead to name conflicts which break instrumentation of examples such as

    (cl-flet ((gate (x) x)) (gate 4))

because of the Edebug spec element `gate`.
So introduce a new symbol property `edebug-elem-spec`.

* lisp/subr.el (def-edebug-elem-spec): New function.

* lisp/emacs-lisp/edebug.el (edebug--get-elem-spec): New function.
(edebug-match-symbol): Use it.
(Core Edebug elems): Put them on `edebug-elem-spec` instead of
`edebug-form-spec`.
(ELisp special forms): Set their `edebug-form-spec` via dolist.
(Other non-core Edebug elems): Use `def-edebug-elem-spec`.
(edebug-\`): Use `declare`.

* lisp/emacs-lisp/pcase.el (pcase-PAT, pcase-FUN, pcase-QPAT):
* lisp/skeleton.el (skeleton-edebug-spec):
* lisp/emacs-lisp/cl-macs.el: Use `def-edebug-elem-spec`.

* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests--conflicting-internal-names): New test.
* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
(edebug-test-code-cl-flet1): New test case.

* doc/lispref/edebug.texi (Specification List): Add `def-edebug-elem-spec`.
(Specification Examples): Use it.

* doc/lispref/loading.texi (Hooks for Loading): Avoid the use of
`def-edebug-spec` in example (better use `debug` declaration).
2021-02-12 19:28:25 -05:00
Stefan Monnier
c7b35ea306 * lisp/emacs-lisp/edebug.el (edebug--handle-&-spec-op) <&lookup>: New method
* doc/lispref/edebug.texi (Specification List): Document it.

* lisp/emacs-lisp/pcase.el (pcase-PAT): Use it.
(pcase-MACRO): Remove Edebug element.
(pcase--get-edebug-spec): New function.
(pcase--edebug-match-macro): Remove function.
2021-02-12 12:17:40 -05:00
Stefan Monnier
1d2487b1fc * lisp/emacs-lisp/edebug.el: Misc cleanups.
Move all definitions under the `edebug-` prefix.

(edebug-get-spec): Rename from `get-edebug-spec`.
(edebug-move-cursor): Use `cl-callf`.
(edebug-spec-p): Remove unused function.
(def-edebug-spec, edebug-spec-list, edebug-spec): Remove unused specs
(nothing in there gets instrumented anyway).
(edebug-tracing): Use `declare`.
(edebug-cancel-on-entry): Rename from `cancel-edebug-on-entry`.
(edebug-global-prefix): Rename from `global-edebug-prefix`.
(edebug-global-map): Rename from `global-edebug-map`.

* lisp/emacs-lisp/pcase.el (pcase-PAT): Remove `let`.
(let): Use `declare` instead.
(pcase--edebug-match-macro): Use new name `edebug-get-spec`.
2021-02-12 11:13:39 -05:00
Stefan Monnier
2e5d400ca6 * lisp/emacs-lisp/edebug.el: Tweak last change
Use generic functions i.s.o `edebug--spec-op-function`.

<toplevel>: No need to register the &foo and :foo handler any more.
(edebug--handle-&-spec-op, edebug--handle-:-spec-op): New generic functions.
(edebug-match-specs): Use them.
(edebug--get-spec-op): Remove function.
(edebug-match-&optional, edebug-match-&rest, edebug-match-&or)
(edebug-match-&not, edebug-match-&key, edebug-match-&error)
(edebug-match-&define): Turn functions into methods of
`edebug--handle-&-spec-op`.
(edebug-match-:name, edebug-match-:unique): Turn functions into methods of
`edebug--handle-:-spec-op`.
2021-02-10 13:12:09 -05:00
Stefan Monnier
d6eddf2c07 * list/emacs-lisp/edebug.el: Don't overload edebug-form-spec
The `edebug-form-spec` symbol property was used to store two different things:
the handlers for spec elements like `body` and the handlers for
spec operators like `&or`.  But these two sets use different calling
conventions, so they're fundamentally incompatible.

So, move the handlers to spec operators to the new property
`edebug--spec-op-function`.  This unbreaks Edebugging of:

    (cl-flet ((f (&rest x) x)) 3)

* lisp/emacs-lisp/edebug.el <toplevel>: Split the alist of built in
spec elements into normal spec element and spec ops.
(edebug--get-spec-op): New function.
(edebug-match-specs): Use it.
(edebug-match-:name): Rename from `edebug-match-colon-name`.
2021-02-10 12:36:36 -05:00
Lars Ingebrigtsen
0cc35e1431 Move all usages of values' to values--store-value'
* lisp/simple.el (eval-expression):
* lisp/progmodes/elisp-mode.el (eval-last-sexp):
* lisp/emacs-lisp/pp.el (pp-eval-expression):
* lisp/emacs-lisp/edebug.el (edebug-eval-expression):
* lisp/emacs-lisp/pp.el (pp-eval-expression):
* lisp/emacs-lisp/edebug.el (edebug-eval-expression):
* lisp/cedet/data-debug.el (data-debug-eval-expression): Use it
instead of pushing to `values' directly (bug#22066).

* lisp/subr.el (values--store-value): New function.
2021-02-09 09:04:47 +01:00
Stefan Kangas
fd9516238a Remove XEmacs compat code from edebug.el
* lisp/emacs-lisp/edebug.el (edebug-window-live-p, edebug-mark):
Make obsolete.  Update callers.
2021-02-04 05:27:45 +01:00
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