diff options
| author | Glenn Morris | 2012-03-31 12:58:05 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-03-31 12:58:05 -0700 |
| commit | 0b0210946b093bcabae9b6bbd06b28b494d1188d (patch) | |
| tree | 3252291c0b4f2af3789ebcffd57e8f67cab1dc95 | |
| parent | 979022ef177beb0022838f6b49da6632cd0d3414 (diff) | |
| download | emacs-0b0210946b093bcabae9b6bbd06b28b494d1188d.tar.gz emacs-0b0210946b093bcabae9b6bbd06b28b494d1188d.zip | |
Edebug doc fixes
* doc/lispref/edebug.texi (Instrumenting Macro Calls):
Mention defining macros at instrumentation time.
(Edebug Options): Mention edebug-unwrap-results.
* lisp/emacs-lisp/edebug.el (edebug-unwrap-results): Doc fix.
Comments.
* admin/FOR-RELEASE: Markup.
| -rw-r--r-- | admin/FOR-RELEASE | 4 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/lispref/edebug.texi | 44 | ||||
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/edebug.el | 13 |
5 files changed, 65 insertions, 6 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 1f498e06c31..ec12b977b9e 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE | |||
| @@ -183,7 +183,7 @@ xresources.texi cyd | |||
| 183 | abbrevs.texi rgm | 183 | abbrevs.texi rgm |
| 184 | advice.texi cyd | 184 | advice.texi cyd |
| 185 | anti.texi | 185 | anti.texi |
| 186 | back.texi | 186 | back.texi rgm |
| 187 | backups.texi cyd | 187 | backups.texi cyd |
| 188 | buffers.texi cyd | 188 | buffers.texi cyd |
| 189 | commands.texi cyd | 189 | commands.texi cyd |
| @@ -192,7 +192,7 @@ control.texi cyd | |||
| 192 | customize.texi cyd | 192 | customize.texi cyd |
| 193 | debugging.texi cyd | 193 | debugging.texi cyd |
| 194 | display.texi cyd | 194 | display.texi cyd |
| 195 | edebug.texi | 195 | edebug.texi rgm |
| 196 | elisp.texi | 196 | elisp.texi |
| 197 | errors.texi rgm | 197 | errors.texi rgm |
| 198 | eval.texi cyd | 198 | eval.texi cyd |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index b0f9b7c586e..cb7a5c48e15 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-03-31 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * edebug.texi (Instrumenting Macro Calls): | ||
| 4 | Mention defining macros at instrumentation time. | ||
| 5 | (Edebug Options): Mention edebug-unwrap-results. | ||
| 6 | |||
| 1 | 2012-03-31 Eli Zaretskii <eliz@gnu.org> | 7 | 2012-03-31 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * text.texi (Special Properties): Clarify the description of the | 9 | * text.texi (Special Properties): Clarify the description of the |
diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index 33e5e54f1c6..245aaf94c6d 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi | |||
| @@ -1113,6 +1113,15 @@ definition, but specifications are much more general than macro | |||
| 1113 | arguments. @xref{Defining Macros}, for more explanation of | 1113 | arguments. @xref{Defining Macros}, for more explanation of |
| 1114 | the @code{declare} form. | 1114 | the @code{declare} form. |
| 1115 | 1115 | ||
| 1116 | @c See eg http://debbugs.gnu.org/10577 | ||
| 1117 | @c FIXME Maybe there should be an Edebug option to get it to | ||
| 1118 | @c automatically load the entire source file containing the function | ||
| 1119 | @c being instrumented. That would avoid this. | ||
| 1120 | Take care to ensure that the specifications are known to Edebug when | ||
| 1121 | you instrument code. If you are instrumenting a function from a file | ||
| 1122 | that uses @code{eval-when-compile} to require another file containing | ||
| 1123 | macro definitions, you may need to explicitly load that file. | ||
| 1124 | |||
| 1116 | You can also define an edebug specification for a macro separately | 1125 | You can also define an edebug specification for a macro separately |
| 1117 | from the macro definition with @code{def-edebug-spec}. Adding | 1126 | from the macro definition with @code{def-edebug-spec}. Adding |
| 1118 | @code{debug} declarations is preferred, and more convenient, for macro | 1127 | @code{debug} declarations is preferred, and more convenient, for macro |
| @@ -1255,6 +1264,8 @@ Each of the following elements is matched as alternatives as if by using | |||
| 1255 | of them match, nothing is matched, but the @code{¬} specification | 1264 | of them match, nothing is matched, but the @code{¬} specification |
| 1256 | succeeds. | 1265 | succeeds. |
| 1257 | 1266 | ||
| 1267 | @c FIXME &key? | ||
| 1268 | |||
| 1258 | @item &define | 1269 | @item &define |
| 1259 | @c @kindex &define @r{(Edebug)} | 1270 | @c @kindex &define @r{(Edebug)} |
| 1260 | Indicates that the specification is for a defining form. The defining | 1271 | Indicates that the specification is for a defining form. The defining |
| @@ -1422,7 +1433,15 @@ of the bindings is either a symbol or a sublist with a symbol and | |||
| 1422 | optional expression. In the specification below, notice the @code{gate} | 1433 | optional expression. In the specification below, notice the @code{gate} |
| 1423 | inside of the sublist to prevent backtracking once a sublist is found. | 1434 | inside of the sublist to prevent backtracking once a sublist is found. |
| 1424 | 1435 | ||
| 1425 | @c FIXME? The actual definition in edebug.el does not have a gate. | 1436 | @ignore |
| 1437 | @c FIXME? The actual definition in edebug.el looks like this (and always | ||
| 1438 | @c has AFAICS). In fact, nothing in edebug.el uses gate. So maybe | ||
| 1439 | @c this is just an example for illustration? | ||
| 1440 | (def-edebug-spec let | ||
| 1441 | ((&rest | ||
| 1442 | &or (symbolp &optional form) symbolp) | ||
| 1443 | body)) | ||
| 1444 | @end ignore | ||
| 1426 | @example | 1445 | @example |
| 1427 | (def-edebug-spec let | 1446 | (def-edebug-spec let |
| 1428 | ((&rest | 1447 | ((&rest |
| @@ -1566,7 +1585,28 @@ debugged. | |||
| 1566 | @xref{Edebug Execution Modes}. | 1585 | @xref{Edebug Execution Modes}. |
| 1567 | @end defopt | 1586 | @end defopt |
| 1568 | 1587 | ||
| 1569 | @c FIXME edebug-unwrap-results | 1588 | @defopt edebug-unwrap-results |
| 1589 | If non-@code{nil}, Edebug tries to remove any of its own | ||
| 1590 | instrumentation when showing the results of expressions. This is | ||
| 1591 | relevant when debugging macros where the results of expressions are | ||
| 1592 | themselves instrumented expressions. As a very artificial example, | ||
| 1593 | suppose that the example function @code{fac} has been instrumented, | ||
| 1594 | and consider a macro of the form: | ||
| 1595 | |||
| 1596 | @c FIXME find a less silly example. | ||
| 1597 | @smallexample | ||
| 1598 | (defmacro test () "Edebug example." | ||
| 1599 | (if (symbol-function 'fac) | ||
| 1600 | @dots{})) | ||
| 1601 | @end smallexample | ||
| 1602 | |||
| 1603 | If you instrument the @code{test} macro and step through it, then by | ||
| 1604 | default the result of the @code{symbol-function} call has numerous | ||
| 1605 | @code{edebug-after} and @code{edebug-before} forms, which can make it | ||
| 1606 | difficult to see the ``actual'' result. If | ||
| 1607 | @code{edebug-unwrap-results} is non-@code{nil}, Edebug tries to remove | ||
| 1608 | these forms from the result. | ||
| 1609 | @end defopt | ||
| 1570 | 1610 | ||
| 1571 | @defopt edebug-on-error | 1611 | @defopt edebug-on-error |
| 1572 | Edebug binds @code{debug-on-error} to this value, if | 1612 | Edebug binds @code{debug-on-error} to this value, if |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2def7e4c934..970c74bf50f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-03-31 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/edebug.el (edebug-unwrap-results): Doc fix. | ||
| 4 | |||
| 1 | 2012-03-30 Thierry Volpiatto <thierry.volpiatto@gmail.com> | 5 | 2012-03-30 Thierry Volpiatto <thierry.volpiatto@gmail.com> |
| 2 | 6 | ||
| 3 | * dired-aux.el (dired-copy-file-recursive, dired-create-files): | 7 | * dired-aux.el (dired-copy-file-recursive, dired-create-files): |
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index c241ac710cf..67ffd6d5d31 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; edebug.el --- a source-level debugger for Emacs Lisp | 1 | ;;; edebug.el --- a source-level debugger for Emacs Lisp |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1988-1995, 1997, 1999-2012 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1988-1995, 1997, 1999-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Daniel LaLiberte <liberte@holonexus.org> | 5 | ;; Author: Daniel LaLiberte <liberte@holonexus.org> |
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| @@ -191,6 +191,7 @@ Use this with caution since it is not debugged." | |||
| 191 | 191 | ||
| 192 | (defcustom edebug-unwrap-results nil | 192 | (defcustom edebug-unwrap-results nil |
| 193 | "Non-nil if Edebug should unwrap results of expressions. | 193 | "Non-nil if Edebug should unwrap results of expressions. |
| 194 | That is, Edebug will try to remove its own instrumentation from the result. | ||
| 194 | This is useful when debugging macros where the results of expressions | 195 | This is useful when debugging macros where the results of expressions |
| 195 | are instrumented expressions. But don't do this when results might be | 196 | are instrumented expressions. But don't do this when results might be |
| 196 | circular or an infinite loop will result." | 197 | circular or an infinite loop will result." |
| @@ -2028,7 +2029,10 @@ expressions; a `progn' form will be returned enclosing these forms." | |||
| 2028 | (def-edebug-spec apply (function-form &rest form)) | 2029 | (def-edebug-spec apply (function-form &rest form)) |
| 2029 | (def-edebug-spec funcall (function-form &rest form)) | 2030 | (def-edebug-spec funcall (function-form &rest form)) |
| 2030 | 2031 | ||
| 2031 | ;; FIXME? The manual has a gate here. | 2032 | ;; FIXME? The manual uses this form (maybe that's just for illustration?): |
| 2033 | ;; (def-edebug-spec let | ||
| 2034 | ;; ((&rest &or symbolp (gate symbolp &optional form)) | ||
| 2035 | ;; body)) | ||
| 2032 | (def-edebug-spec let | 2036 | (def-edebug-spec let |
| 2033 | ((&rest &or (symbolp &optional form) symbolp) | 2037 | ((&rest &or (symbolp &optional form) symbolp) |
| 2034 | body)) | 2038 | body)) |
| @@ -4157,6 +4161,8 @@ You must include newlines in FMT to break lines, but one newline is appended." | |||
| 4157 | ;;; Frequency count and coverage | 4161 | ;;; Frequency count and coverage |
| 4158 | 4162 | ||
| 4159 | ;; FIXME should this use overlays instead? | 4163 | ;; FIXME should this use overlays instead? |
| 4164 | ;; Definitely, IMO. The current business with undo in | ||
| 4165 | ;; edebug-temp-display-freq-count is horrid. | ||
| 4160 | (defun edebug-display-freq-count () | 4166 | (defun edebug-display-freq-count () |
| 4161 | "Display the frequency count data for each line of the current definition. | 4167 | "Display the frequency count data for each line of the current definition. |
| 4162 | The frequency counts are inserted as comment lines after each line, | 4168 | The frequency counts are inserted as comment lines after each line, |
| @@ -4226,6 +4232,8 @@ reinstrument it." | |||
| 4226 | (insert "\n") | 4232 | (insert "\n") |
| 4227 | (setq i first-index))))) | 4233 | (setq i first-index))))) |
| 4228 | 4234 | ||
| 4235 | ;; FIXME this does not work very well. Eg if you press an arrow key, | ||
| 4236 | ;; or make a mouse-click, it fails with "Non-character input-event". | ||
| 4229 | (defun edebug-temp-display-freq-count () | 4237 | (defun edebug-temp-display-freq-count () |
| 4230 | "Temporarily display the frequency count data for the current definition. | 4238 | "Temporarily display the frequency count data for the current definition. |
| 4231 | It is removed when you hit any char." | 4239 | It is removed when you hit any char." |
| @@ -4235,6 +4243,7 @@ It is removed when you hit any char." | |||
| 4235 | (undo-boundary) | 4243 | (undo-boundary) |
| 4236 | (edebug-display-freq-count) | 4244 | (edebug-display-freq-count) |
| 4237 | (setq unread-command-char (read-char)) | 4245 | (setq unread-command-char (read-char)) |
| 4246 | ;; Yuck! This doesn't seem to work at all for me. | ||
| 4238 | (undo))) | 4247 | (undo))) |
| 4239 | 4248 | ||
| 4240 | 4249 | ||