• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/emacs-lisp/

Lines Matching +defs:end +defs:of +defs:defun

10 ;; This file is part of GNU Emacs.
13 ;; it under the terms of the GNU General Public License as published by
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;; You should have received a copy of the GNU General Public License
32 ;; expressions as if outside Edebug, reevaluate and display a list of
39 ;; First evaluate a defun with C-M-x, then run the function. Step
84 This applies to `eval-defun', `eval-region', `eval-buffer', and
88 You can use the command `edebug-all-defs' to toggle the value of this
101 "*Non-nil evaluation of all forms will instrument for Edebug.
103 Use the command `edebug-all-forms' to toggle the value of this option."
133 debugging code that changes the point of a buffer which is displayed
155 "*Non-nil means display a trace of function entry and exit.
165 "*If non-nil, Edebug tests coverage of all expressions debugged.
166 This is done by comparing the result of each expression
183 "*Default value of `print-length' for printing results in Edebug."
187 "*Default value of `print-level' for printing results in Edebug."
191 "*Default value of `print-circle' for printing results in Edebug."
196 "*Non-nil if Edebug should unwrap results of expressions.
197 This is useful when debugging macros where the results of expressions
208 If the value is a list of signal names, Edebug will stop when any of
232 "*Number of seconds to pause when execution mode is `trace'."
243 (defun get-edebug-spec (symbol)
244 ;; Get the spec of symbol resolving all indirection.
255 (defun edebug-basic-spec (spec)
274 (defun edebug-gensym (&optional prefix)
290 (defun edebug-lambda-list-keywordp (object)
297 (defun edebug-last-sexp ()
308 (defun edebug-window-list ()
309 "Return a list of windows, in order of `next-window'."
316 '(defun edebug-two-window-p ()
327 (defun edebug-macrop (object)
335 (defun edebug-sort-alist (alist function)
347 BODY may change buffer outside of current restriction, unlike
351 Return the result of the last expression in BODY."
353 (edebug:s-r-end (point-max-marker)))
358 (narrow-to-region edebug:s-r-beg edebug:s-r-end)))))
363 "Name of the buffer to put trace info in.")
365 (defun edebug-pop-to-buffer (buffer &optional window)
400 (defun edebug-get-displayed-buffer-points ()
401 ;; Return a list of buffer point pairs, for all displayed buffers.
411 (defun edebug-set-buffer-points (buffer-points)
420 (defun edebug-current-windows (which-windows)
433 (defun edebug-set-windows (window-info)
458 ;; eval-defun is redefined to check edebug-all-forms and edebug-all-defs.
464 (defun edebug-read (&optional stream)
466 If STREAM is nil, use the value of `standard-input' (which see).
467 STREAM or the value of `standard-input' may be:
477 also dependent on the values of `edebug-all-defs' and
484 (or (fboundp 'edebug-original-eval-defun)
485 (defalias 'edebug-original-eval-defun (symbol-function 'eval-defun)))
488 ;; without actually replacing the eval-defun command.
489 (defun edebug-eval-defun (edebug-it)
492 If the current defun is actually a call to `defvar', then reset the
500 Setting `edebug-all-defs' to a non-nil value reverses the meaning of
504 If acting on a `defun' for FUNCTION, and the function was
508 If not acting on a `defun', the result of evaluation is displayed in
517 ;; This should be consistent with `eval-defun-1', but not the
532 ;; See comments in `eval-defun-1' for purpose of code below
546 (defalias 'edebug-defun 'edebug-eval-top-level-form)
549 (defun edebug-eval-top-level-form ()
551 This is like `eval-defun' except that it steps the code for Edebug
556 such as a defun or defmacro, it defines the function and instruments
561 If the current defun is actually a call to `defvar' or `defcustom',
575 (defun edebug-read-top-level-form ()
577 (end-of-defun)
578 (beginning-of-defun)
589 (defun edebug-all-defs ()
590 "Toggle edebugging of all definitions."
598 (defun edebug-all-forms ()
599 "Toggle edebugging of all forms."
606 (defun edebug-install-read-eval-functions ()
611 (defalias 'eval-defun 'edebug-eval-defun)))
613 (defun edebug-uninstall-read-eval-functions ()
616 (defalias 'eval-defun (symbol-function 'edebug-original-eval-defun)))
627 ;; A list of entries associating symbols with buffer regions.
629 ;; @code{(@var{symbol} @var{begin-marker} @var{end-marker}). The markers
630 ;; are at the beginning and end of an entry level form and @var{symbol} is
636 ;; list of a symbol.
638 (defun edebug-make-form-data-entry (symbol begin end)
639 (list symbol begin end))
647 (defsubst edebug-form-data-end (entry)
650 (defsubst edebug-set-form-data-entry (entry name begin end)
653 (set-marker (nth 2 entry) end))
655 (defun edebug-get-form-data-entry (pnt &optional end-point)
669 (or (not end-point)
670 (= end-point (edebug-form-data-end entry)))
671 (<= pnt (edebug-form-data-end entry)))
679 (defun edebug-form-data-symbol ()
680 ;; Return the edebug data symbol of the form where point is in.
685 (defun edebug-make-top-form-data-entry (new-entry)
690 (defun edebug-clear-form-data-entry (entry)
691 ;; If non-nil, clear ENTRY out of the form data.
695 ;; Instead of this, we could just find all contained forms.
705 (defun edebug-syntax-error (&rest args)
711 ;; Lookup table for significant characters indicating the class of the
729 ;; We treat numbers as symbols, because of confusion with -, -1, and 1-.
733 (defun edebug-next-token-class ()
749 (defun edebug-skip-whitespace ()
759 (defun edebug-read-sexp ()
782 ;; Define a structure to represent offset positions of expressions.
786 ;; including the head of a list.
789 ;; Stack of offset structures in reverse order of the nesting.
792 (defvar edebug-current-offset nil) ; Top of the stack, for convenience.
803 (defun edebug-store-before-offset (point)
813 ;; Cons the new offset to the front of the stack.
818 (defun edebug-store-after-offset (point)
822 ;; Just reverse the offsets of all subexpressions.
828 ;; That is, nconc the reverse of the rest of the offsets
829 ;; with the cdr of last offset.
840 (defun edebug-ignore-offset ()
868 (defun edebug-read-storing-offsets (stream)
877 (defun edebug-read-symbol (stream)
880 (defun edebug-read-string (stream)
883 (defun edebug-read-quote (stream)
894 (defun edebug-read-backquote (stream)
902 (defun edebug-read-comma (stream)
913 ;; Generate the same structure of offsets we would have
922 (defun edebug-read-function (stream)
937 (defun edebug-read-list (stream)
967 (defun edebug-read-vector (stream)
977 ;;; Cursors for traversal of list and vector elements with offsets.
981 (defun edebug-new-cursor (expressions offsets)
994 (defun edebug-copy-cursor (cursor)
1012 (defun edebug-top-element-required (cursor &rest error)
1024 (defun edebug-move-cursor (cursor)
1027 ;; This is a violation of the cursor encapsulation, but
1028 ;; there is plenty of that going on while matching.
1037 (defun edebug-before-offset (cursor)
1038 ;; Return the before offset of the cursor.
1047 (defun edebug-after-offset (cursor)
1048 ;; Return the after offset of the cursor object.
1059 ;; should appear to work like eval-defun.
1062 ;; the edebug debugger together with indexes into a table of positions of
1067 ;; When this is evaluated, first point is moved to the beginning of
1068 ;; exp at offset 1 of the current function. The expression is
1070 ;; moved to offset 2 after the end of exp.
1072 ;; The highest level expressions of the function are wrapped in a call to
1080 ;; Window data of the highest definition being wrapped.
1088 (defvar edebug-def-name nil) ; name of definition, used by interactive-form
1089 (defvar edebug-old-def-name nil) ; previous name of containing definition.
1095 (defun edebug-read-and-maybe-wrap-form ()
1115 ;; Do this once here instead of several times.
1127 (defun edebug-read-and-maybe-wrap-form1 ()
1146 ;; This is incorrect in general!! But OK most of the time.
1194 (defvar edebug-def-args) ; args of defining form.
1199 (defun edebug-interactive-p-name ()
1201 ;; status of interactive-p for this function.
1205 (defun edebug-wrap-def-body (forms)
1206 "Wrap the FORMS of a definition body."
1214 (defun edebug-make-enter-wrapper (forms)
1215 ;; Generate the enter wrapper for some forms of a definition.
1216 ;; This is not to be used for the body of other forms, e.g. `while',
1217 ;; since it wraps the list of forms with a call to `edebug-enter'.
1237 (defvar edebug-offset-list) ; the list of offset positions.
1239 (defun edebug-inc-offset (offset)
1249 (defun edebug-make-before-and-after-form (before-index form after-index)
1258 (defun edebug-make-after-form (form after-index)
1263 (defun edebug-unwrap (sexp)
1265 The SEXP might be the result of wrapping a body, which is a list of
1280 (defun edebug-unwrap* (sexp)
1291 (defun edebug-defining-form (cursor form-begin form-end speclist)
1300 form-begin (1- form-end)
1303 (defun edebug-make-form-wrapper (cursor form-begin form-end
1309 (let* ((form-data-entry (edebug-get-form-data-entry form-begin form-end))
1341 ;; Add this def as a dependent of containing def. Buggy.
1357 (set-marker (make-marker) form-end)
1361 form-begin form-end))
1371 ;; Side effects on the property list of edebug-def-name.
1395 (defun edebug-clear-frequency-count (name)
1402 (defun edebug-clear-coverage (name)
1409 (defun edebug-form (cursor)
1459 ;; Process the arguments of a list form given that head of form is a symbol.
1484 (defun edebug-list-form (cursor)
1511 ;; The head of a form should normally be a symbol or a lambda
1522 "Head of list form must be a symbol or lambda expression")))
1525 ;;; Matching of specs.
1530 (defconst edebug-max-depth 150) ;; maximum number of matching recursions.
1536 ;; Otherwise it signals an error. The place of the error is found
1539 (defun edebug-no-match (cursor &rest edebug-args)
1553 (defun edebug-match (cursor specs)
1555 ;; Used also at each lower level of specs.
1565 (defun edebug-match-one-spec (cursor spec)
1575 (defun edebug-match-specs (cursor specs remainder-handler)
1576 ;; Append results of matching the list of specs.
1649 (defun edebug-match-symbol (cursor symbol)
1657 ;; Otherwise it should be the symbol name of a function.
1677 (defun edebug-match-sexp (cursor)
1681 (defun edebug-match-form (cursor)
1690 (defun edebug-match-&optional (cursor specs)
1694 (defun edebug-&optional-wrapper (cursor specs remainder-handler)
1711 (defun edebug-&rest-wrapper (cursor specs remainder-handler)
1716 (defun edebug-match-&rest (cursor specs)
1724 (defun edebug-match-&or (cursor specs)
1745 (apply 'edebug-no-match cursor "Expected one of" original-specs))
1749 (defun edebug-match-&not (cursor specs)
1764 (defun edebug-match-&key (cursor specs)
1766 ;; where <name> is the name of a keyword, and spec is its spec.
1777 (defun edebug-match-gate (cursor)
1783 (defun edebug-match-list (cursor specs)
1784 ;; The spec is a list, but what kind of list, and what context?
1832 (defun edebug-match-sublist (cursor specs)
1833 ;; Match a sublist of specs.
1849 (defun edebug-match-string (cursor spec)
1859 (defun edebug-match-nil (cursor)
1866 (defun edebug-match-function (cursor)
1867 (error "Use function-form instead of function in edebug spec"))
1869 (defun edebug-match-&define (cursor specs)
1872 ;; This should only be called inside of a spec list to match the remainder
1873 ;; of the current list. e.g. ("lambda" &define args def-body)
1883 (defun edebug-match-lambda-expr (cursor)
1909 (defun edebug-match-name (cursor)
1914 (edebug-no-match cursor "Symbol expected for name of definition"))
1923 (defun edebug-match-colon-name (cursor spec)
1932 (defun edebug-match-arg (cursor)
1942 (defun edebug-match-def-form (cursor)
1944 ;; The form is assumed to be executing outside of the function context.
1950 (defun edebug-match-def-body (cursor)
1952 ;; The body is assumed to be executing inside of the function context.
1963 ;;; Out of date.
1965 (defun edebug-spec-p (object)
2002 (def-edebug-spec defun
2024 ;; form at the end could also handle "function",
2088 ;; Special version of backquote that instruments backquoted forms
2089 ;; destined to be evaluated, usually as the result of a
2096 ;; in arguments of macros should be def-forms, whether or not the macros
2110 (def-edebug-spec defsubst defun)
2141 name ;; name of advice
2165 ;; Stack of active functions evaluated via edebug.
2169 ;; Index of last edebug-stack item.
2172 ;; Stack of offset indices of visited edebug sexps.
2184 ;; Name of function to use for debugging when error or quit occurs.
2191 (defvar edebug-args) ; the arguments of the function
2193 (defvar edebug-value) ; the result of the expression
2196 (defvar edebug-freq-count) ; the count of expression visits.
2197 (defvar edebug-coverage) ; the coverage results of each expression of function.
2200 (defvar edebug-result) ; the result of the function call returned by body
2205 (defvar edebug-next-execution-mode nil) ; Use once instead of initial mode.
2207 (defvar edebug-outside-debug-on-error) ; the value of debug-on-error outside
2208 (defvar edebug-outside-debug-on-quit) ; the value of debug-on-quit outside
2220 (defun edebug-signal (edebug-signal-name edebug-signal-data)
2223 that is a list of condition names.
2224 A handler for any of those names will get to handle this signal.
2225 The symbol `error' should always be one of them.
2227 DATA should be a list. Its elements are printed as part of the error message.
2245 (defun edebug-enter (edebug-function edebug-args edebug-body)
2249 ;; Return the result of BODY.
2277 ;; Save the outside value of executing macro. (here??)
2332 (defun edebug-var-status (var)
2333 "Return a cons cell describing the status of VAR's current binding.
2334 The purpose of this function is so you can properly undo
2343 (defun edebug-restore-status (var status)
2357 (defun edebug-enter-trace (edebug-body)
2370 The result of BODY is also printed."
2378 (defun edebug-print-trace-before (msg)
2384 (defun edebug-print-trace-after (msg)
2392 (defun edebug-slow-before (edebug-before-index)
2408 (defun edebug-fast-before (edebug-before-index)
2412 (defun edebug-slow-after (edebug-before-index edebug-after-index edebug-value)
2432 (defun edebug-fast-after (edebug-before-index edebug-after-index edebug-value)
2436 (defun edebug-run-slow ()
2441 (defun edebug-run-fast ()
2448 (defun edebug-update-coverage ()
2471 (defun edebug-debugger (edebug-offset-index edebug-arg-mode edebug-value)
2479 (edebug-breakpoints (car (cdr edebug-data))) ; list of breakpoints
2527 (defvar edebug-outside-buffer) ; the current-buffer outside of edebug
2528 (defvar edebug-outside-point) ; the point outside of edebug
2529 (defvar edebug-outside-mark) ; the mark outside of edebug
2538 (defvar edebug-eval-list nil) ;; List of expressions to evaluate.
2546 (defun edebug-display ()
2553 ;; Uses local variables of edebug-enter, edebug-before, edebug-after
2632 (error "Source has changed - reevaluate definition of %s"
2678 ;; Display result of previous evaluation.
2758 ;; Since we may be in a save-excursion, in case of quit,
2778 ;; None of the following is done if quit or signal occurs.
2800 (defvar edebug-number-of-recursions 0)
2801 ;; Number of recursive edits started by edebug.
2805 ;; Value of recursion-depth when edebug was called.
2808 (defvar edebug-outside-match-data) ; match data outside of edebug
2847 (defun edebug-recursive-edit ()
2848 ;; Start up a recursive edit inside of edebug.
2850 ;; Assume that none of the variables below are buffer-local.
2858 ;;(edebug-number-of-recursions (1+ edebug-number-of-recursions))
2980 (defun edebug-adjust-window (old-start)
2999 (beginning-of-line)
3015 "Association list of arrows for each edebug mode.")
3017 (defun edebug-overlay-arrow ()
3018 ;; Set up the overlay arrow at beginning-of-line in current buffer.
3021 (let ((pos (save-excursion (beginning-of-line) (point))))
3028 (defun edebug-toggle-save-all-windows ()
3029 "Toggle the saving and restoring of all windows.
3052 (defun edebug-toggle-save-selected-window ()
3053 "Toggle the saving and restoring of the selected window.
3079 (defun edebug-toggle-save-windows (arg)
3080 "Toggle the saving and restoring of windows.
3089 (defun edebug-where ()
3101 (defun edebug-view-outside ()
3110 (message "Window configuration outside of Edebug. Return with %s"
3114 (defun edebug-bounce-point (arg)
3134 ;; Joe Wells, here is a start at your idea of adding a buffer to the internal
3138 "List of buffers that edebug will display when it is active.")
3140 '(defun edebug-display-buffer (buffer)
3141 "Toggle display of a buffer inside of edebug."
3153 (defun edebug-find-stop-point ()
3154 ;; Return (function . index) of the nearest edebug stop point.
3161 ;; pull out parts of edebug-data.
3187 (defun edebug-next-breakpoint ()
3196 ;; pull out parts of edebug-data
3226 (defun edebug-modify-breakpoint (flag &optional condition temporary)
3237 ;; pull out parts of edebug-data
3265 (defun edebug-set-breakpoint (arg)
3266 "Set the breakpoint of nearest sexp.
3271 (defun edebug-unset-breakpoint ()
3272 "Clear the breakpoint of nearest sexp."
3277 (defun edebug-set-global-break-condition (expression)
3292 (defun edebug-set-mode (mode shortmsg msg)
3308 (defun edebug-step-mode ()
3313 (defun edebug-next-mode ()
3318 (defun edebug-go-mode (arg)
3326 (defun edebug-Go-nonstop-mode ()
3333 (defun edebug-trace-mode ()
3338 (defun edebug-Trace-fast-mode ()
3344 (defun edebug-continue-mode ()
3350 (defun edebug-Continue-fast-mode ()
3360 (defun edebug-goto-here ()
3361 "Proceed to first stop-point at or after current position of point."
3366 (defun edebug-stop ()
3373 '(defun edebug-forward ()
3374 "Proceed to the exit of the next expression to be evaluated."
3381 (defun edebug-forward-sexp (arg)
3382 "Proceed from the current point to the end of the ARGth sexp ahead.
3394 (defun edebug-step-out ()
3395 "Proceed from the current point to the end of the containing sexp.
3396 If there is no containing sexp that is not the top level defun,
3397 go to the end of the last sexp, or if that is the same point, then step."
3416 (defun edebug-instrument-function (func)
3439 (defun edebug-instrument-callee ()
3440 "Instrument the definition of the function or macro about to be called.
3442 One side effect of using this command is that the next time the
3457 (defun edebug-step-in ()
3458 "Step into the definition of the function or macro about to be called.
3468 (defun edebug-on-entry (function &optional flag)
3476 (defun cancel-edebug-on-entry (function)
3486 '(defun edebug-debug-on-entry (function)
3489 Works by modifying the definition of FUNCTION,
3491 Use `cancel-debug-on-entry' to cancel the effect of this command.
3503 (defun edebug-top-level-nonstop ()
3511 ;;(defun edebug-exit-out ()
3531 '(defun edebug-set-initial-mode ()
3532 "Ask for the initial mode of the enclosing function.
3559 (error "Key must map to one of the mode changing commands")
3562 ;;; Evaluation of expressions
3568 Return the result of the last expression."
3569 `(save-excursion ; of current-buffer
3601 ;; Get the values out of the saved statuses.
3612 (save-excursion ; of edebug-buffer
3619 ;; Back to edebug-buffer. Restore rest of inside context.
3661 (defun edebug-eval (edebug-expr)
3667 (defun edebug-safe-eval (edebug-expr)
3688 (defun edebug-install-custom-print ()
3703 (defun edebug-uninstall-custom-print ()
3717 (defun edebug-report-error (edebug-value)
3733 ;; Alternatively, we could change the definition of
3736 (defun edebug-safe-prin1-to-string (value)
3746 (defun edebug-compute-previous-result (edebug-previous-value)
3755 (defun edebug-previous-result ()
3762 (defun edebug-eval-expression (edebug-expr)
3775 (defun edebug-eval-last-sexp ()
3781 (defun edebug-eval-print-last-sexp ()
3791 ;; princ the string to get rid of quotes.
3799 "*Non-nil means don't do global rebindings of C-x C-a subcommands.")
3910 "Global map of edebug commands, available from any buffer.")
3916 (defun edebug-help ()
3920 (defun edebug-mode ()
3961 (defun edebug-kill-buffer ()
3962 "Used on `kill-buffer-hook' when Edebug is operating in a buffer of Lisp code."
3969 ;; A list of expressions and their evaluations is displayed in *edebug*.
3971 (defun edebug-eval-result-list ()
3972 "Return a list of evaluations of edebug-eval-list"
3979 (defun edebug-eval-display-list (edebug-eval-result-list)
3996 (defun edebug-create-eval-buffer ()
4002 ;; Should generalize this to be callable outside of edebug
4005 (defun edebug-eval-display (edebug-eval-result-list)
4014 (defun edebug-eval-redisplay ()
4022 (defun edebug-visit-eval-list ()
4028 (defun edebug-update-eval-list ()
4055 (defun edebug-delete-eval-item ()
4063 (beginning-of-line)
4070 "Keymap for Edebug Eval mode. Superset of Lisp Interaction mode.")
4107 (defun edebug (&optional edebug-arg-mode &rest debugger-args)
4136 (defun edebug-backtrace ()
4162 (beginning-of-line)
4180 (defun edebug-trace-display (buf-name fmt &rest args)
4181 "In buffer BUF-NAME, display FMT and ARGS at the end and make it visible.
4210 (defun edebug-trace (fmt &rest args)
4218 (defun edebug-display-freq-count ()
4219 "Display the frequency count data for each line of the current definition.
4224 or the `)' after an expression, or on the last char of a symbol.
4228 If coverage is being tested, whenever all known results of an expression
4245 (start-of-line)
4246 (start-of-count-line)
4254 (beginning-of-line)
4255 (setq start-of-line (- (point) def-mark)
4260 (<= start-of-line (aref edebug-points i))))
4263 (setq start-of-count-line (point)
4276 (max 0 (- col (- (point) start-of-count-line))) ?\s)
4287 (defun edebug-temp-display-freq-count ()
4302 (defun edebug-toggle (variable)
4377 (defun edebug-mark ()
4380 (defun edebug-set-conditional-breakpoint (arg condition)
4422 ;; The body of eval-when-compile seems to get evaluated with eval-defun.
4427 (defun byte-compile-resolve-functions (funcs)
4438 '(defun byte-compile-resolve-free-references (vars)
4448 '(defun byte-compile-resolve-free-assignments (vars)
4462 edebug-original-eval-defun
4491 ;;; Autoloading of Edebug accessories
4512 ;;; Finally, hook edebug into the rest of Emacs.