• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/emacs-lisp/

Lines Matching +defs:read +defs:expression +defs:map

31 ;; breakpoints, trace (stopping at each expression), evaluate
166 This is done by comparing the result of each expression
226 "*If non-nil, an expression to test for at every stop point.
301 (read-from-string
351 Return the result of the last expression in BODY."
456 ;;; Redefine read and eval functions
457 ;; read is redefined to maybe instrument forms.
460 ;; Save the original read function
461 (or (fboundp 'edebug-original-read)
462 (defalias 'edebug-original-read (symbol-function 'read)))
464 (defun edebug-read (&optional stream)
465 "Read one Lisp expression as text from STREAM, return as Lisp object.
468 a buffer (read from point and advance it)
469 a marker (read from where it points and advance it)
473 t (read text line using minibuffer and use it).
475 This version, from Edebug, maybe instruments the expression. But the
481 (edebug-read-and-maybe-wrap-form)
482 (edebug-original-read stream)))
493 variable using its initial value expression even if the variable
516 (edebug-read-top-level-form))))
553 using `eval-expression' (which see).
563 expression even if the variable already has some other value.
567 (eval-expression
572 (edebug-read-top-level-form))))
575 (defun edebug-read-top-level-form ()
580 (edebug-read-and-maybe-wrap-form)
606 (defun edebug-install-read-eval-functions ()
609 (unless load-read-function
610 (setq load-read-function 'edebug-read)
613 (defun edebug-uninstall-read-eval-functions ()
615 (setq load-read-function nil)
706 ;; Signal an invalid-read-syntax with ARGS.
707 (signal 'invalid-read-syntax args))
710 (defconst edebug-read-syntax-table
741 (or (and (eq (aref edebug-read-syntax-table (following-char))
746 (aref edebug-read-syntax-table (following-char))))
759 (defun edebug-read-sexp ()
767 ;; read goes one too far if a (possibly quoted) string or symbol
769 ((eq class 'symbol) (edebug-original-read (current-buffer)))
770 ((eq class 'string) (edebug-original-read (current-buffer)))
772 (list 'quote (edebug-read-sexp)))
774 (list '\` (edebug-read-sexp)))
776 (list '\, (edebug-read-sexp)))
777 (t ; anything else, just read it.
778 (edebug-original-read (current-buffer))))))
794 ;; We must store whether we just read a list with a dotted form that
797 (defvar edebug-read-dotted-list nil)
812 edebug-read-dotted-list nil))
821 (if (not edebug-read-dotted-list)
825 ;; We just read a list after a dot, which will be abbreviated out.
826 (setq edebug-read-dotted-list nil)
857 (defconst edebug-read-alist
858 '((symbol . edebug-read-symbol)
859 (lparen . edebug-read-list)
860 (string . edebug-read-string)
861 (quote . edebug-read-quote)
862 (backquote . edebug-read-backquote)
863 (comma . edebug-read-comma)
864 (lbracket . edebug-read-vector)
865 (hash . edebug-read-function)
868 (defun edebug-read-storing-offsets (stream)
869 (let (edebug-read-dotted-list) ; see edebug-store-after-offset
872 (or (cdr (assq (edebug-next-token-class) edebug-read-alist))
873 ;; anything else, just read it.
874 'edebug-original-read)
877 (defun edebug-read-symbol (stream)
878 (edebug-original-read stream))
880 (defun edebug-read-string (stream)
881 (edebug-original-read stream))
883 (defun edebug-read-quote (stream)
888 (edebug-read-storing-offsets stream)))
890 (defvar edebug-read-backquote-level 0
892 It should never be negative. This controls how we read comma constructs.")
894 (defun edebug-read-backquote (stream)
899 (let ((edebug-read-backquote-level (1+ edebug-read-backquote-level)))
900 (edebug-read-storing-offsets stream))))
902 (defun edebug-read-comma (stream)
915 (if (zerop edebug-read-backquote-level)
919 (let ((edebug-read-backquote-level (1- edebug-read-backquote-level)))
920 (edebug-read-storing-offsets stream)))))))
922 (defun edebug-read-function (stream)
930 (edebug-read-storing-offsets stream)))
934 (edebug-original-read stream))
937 (defun edebug-read-list (stream)
944 (zerop edebug-read-backquote-level))
952 (push (edebug-read-storing-offsets stream) elements)))
957 (setq dotted-form (edebug-read-storing-offsets stream))
961 (setq edebug-read-dotted-list (listp dotted-form))
967 (defun edebug-read-vector (stream)
972 (push (edebug-read-storing-offsets stream) elements))
1057 ;; edebug-read-and-maybe-wrap-form; it calls all the rest. It checks the
1061 ;; The basic plan is to surround each expression with a call to
1063 ;; all expressions. Thus an expression "exp" becomes:
1068 ;; exp at offset 1 of the current function. The expression is
1095 (defun edebug-read-and-maybe-wrap-form ()
1120 (setq result (edebug-read-and-maybe-wrap-form1))
1127 (defun edebug-read-and-maybe-wrap-form1 ()
1133 ;; calls to edebug-read, they need to be here.
1142 (setq def-kind (edebug-original-read (current-buffer))
1150 (edebug-original-read (current-buffer))))))
1158 (list (edebug-read-storing-offsets (current-buffer)))
1176 (edebug-read-sexp)))
1181 (list (edebug-read-storing-offsets (current-buffer)))
1190 (t (edebug-read-sexp)))
1307 ;; Otherwise it is being called from edebug-read-and-maybe-wrap-form1.
1404 ;; Only need one per expression, but it is simpler to use stop points.
1512 ;; expression but it can also be an unquote form to be filled
1522 "Head of list form must be a symbol or lambda expression")))
1884 ;; The expression must be a function.
1890 cursor "Expected lambda expression"))
1905 (edebug-no-match cursor "Expected lambda expression")
2028 ;; function expects a symbol or a lambda or macro expression
2038 ;; A macro expression is a lambda expression with "macro" prepended.
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.
2210 (defvar edebug-outside-overriding-local-map)
2211 (defvar edebug-outside-overriding-terminal-local-map)
2273 (edebug-outside-overriding-local-map overriding-local-map)
2274 (edebug-outside-overriding-terminal-local-map
2275 overriding-terminal-local-map)
2291 (overriding-local-map nil)
2292 (overriding-terminal-local-map nil)
2379 "Function called to print trace info before expression evaluation.
2385 "Function called to print trace info after expression evaluation.
2813 (defvar edebug-outside-map)
2851 (let ((edebug-buffer-read-only buffer-read-only)
2867 (edebug-outside-map (current-local-map))
2923 (setq buffer-read-only t)
2949 (setq buffer-read-only edebug-buffer-read-only)
2950 (use-local-map edebug-outside-map)
3111 (substitute-command-keys "\\<global-map>\\[edebug-where]")))
3182 (message "Point is not on an expression in %s."
3277 (defun edebug-set-global-break-condition (expression)
3282 (read-from-minibuffer
3283 "Global Condition: " initial read-expression-map t
3284 (if (equal (car read-expression-history) initial)
3285 '(read-expression-history . 1)
3286 'read-expression-history)))))
3287 (setq edebug-global-break-condition expression))
3374 "Proceed to the exit of the next expression to be evaluated."
3378 "Edebug will stop after exiting the next expression."))
3403 ;; Is there still a containing expression?
3453 (edebug-original-read (current-buffer))))))
3537 (keymap (if (eq edebug-mode-map (current-local-map))
3538 edebug-mode-map))
3541 (key (read-key-sequence
3559 (error "Key must map to one of the mode changing commands")
3567 "Evaluate an expression list in the outside context.
3568 Return the result of the last expression."
3580 ;; (use-local-map edebug-outside-map)
3583 (let (;; (edebug-inside-map (current-local-map)) ;; restore map??
3620 ;; (use-local-map edebug-inside-map)
3753 (eval-expression-print-format edebug-previous-value))))
3762 (defun edebug-eval-expression (edebug-expr)
3763 "Evaluate an expression in the outside environment.
3764 If interactive, prompt for the expression.
3766 (interactive (list (read-from-minibuffer
3767 "Eval: " nil read-expression-map t
3768 'read-expression-history)))
3773 (eval-expression-print-format (car values))))))
3779 (edebug-eval-expression (edebug-last-sexp)))
3803 (define-key emacs-lisp-mode-map "\C-x\C-a\C-s" 'edebug-step-mode)
3804 (define-key emacs-lisp-mode-map "\C-x\C-a\C-n" 'edebug-next-mode)
3805 (define-key emacs-lisp-mode-map "\C-x\C-a\C-c" 'edebug-go-mode)
3806 (define-key emacs-lisp-mode-map "\C-x\C-a\C-l" 'edebug-where))
3808 (defvar edebug-mode-map
3809 (let ((map (copy-keymap emacs-lisp-mode-map)))
3811 (define-key map " " 'edebug-step-mode)
3812 (define-key map "n" 'edebug-next-mode)
3813 (define-key map "g" 'edebug-go-mode)
3814 (define-key map "G" 'edebug-Go-nonstop-mode)
3815 (define-key map "t" 'edebug-trace-mode)
3816 (define-key map "T" 'edebug-Trace-fast-mode)
3817 (define-key map "c" 'edebug-continue-mode)
3818 (define-key map "C" 'edebug-Continue-fast-mode)
3820 ;;(define-key map "f" 'edebug-forward) not implemented
3821 (define-key map "f" 'edebug-forward-sexp)
3822 (define-key map "h" 'edebug-goto-here)
3824 (define-key map "I" 'edebug-instrument-callee)
3825 (define-key map "i" 'edebug-step-in)
3826 (define-key map "o" 'edebug-step-out)
3829 (define-key map "q" 'top-level)
3830 (define-key map "Q" 'edebug-top-level-nonstop)
3831 (define-key map "a" 'abort-recursive-edit)
3832 (define-key map "S" 'edebug-stop)
3835 (define-key map "b" 'edebug-set-breakpoint)
3836 (define-key map "u" 'edebug-unset-breakpoint)
3837 (define-key map "B" 'edebug-next-breakpoint)
3838 (define-key map "x" 'edebug-set-conditional-breakpoint)
3839 (define-key map "X" 'edebug-set-global-break-condition)
3842 (define-key map "r" 'edebug-previous-result)
3843 (define-key map "e" 'edebug-eval-expression)
3844 (define-key map "\C-x\C-e" 'edebug-eval-last-sexp)
3845 (define-key map "E" 'edebug-visit-eval-list)
3848 (define-key map "w" 'edebug-where)
3849 (define-key map "v" 'edebug-view-outside) ;; maybe obsolete??
3850 (define-key map "p" 'edebug-bounce-point)
3851 (define-key map "P" 'edebug-view-outside) ;; same as v
3852 (define-key map "W" 'edebug-toggle-save-windows)
3855 (define-key map "?" 'edebug-help)
3856 (define-key map "d" 'edebug-backtrace)
3858 (define-key map "-" 'negative-argument)
3861 (define-key map "=" 'edebug-temp-display-freq-count)
3864 (define-key map "\C-c\C-s" 'edebug-step-mode)
3865 (define-key map "\C-c\C-n" 'edebug-next-mode)
3866 (define-key map "\C-c\C-c" 'edebug-go-mode)
3868 (define-key map "\C-x " 'edebug-set-breakpoint)
3869 (define-key map "\C-c\C-d" 'edebug-unset-breakpoint)
3870 (define-key map "\C-c\C-t"
3872 (define-key map "\C-c\C-l" 'edebug-where)
3873 map))
3881 (defvar global-edebug-map
3882 (let ((map (make-sparse-keymap)))
3884 (define-key map " " 'edebug-step-mode)
3885 (define-key map "g" 'edebug-go-mode)
3886 (define-key map "G" 'edebug-Go-nonstop-mode)
3887 (define-key map "t" 'edebug-trace-mode)
3888 (define-key map "T" 'edebug-Trace-fast-mode)
3889 (define-key map "c" 'edebug-continue-mode)
3890 (define-key map "C" 'edebug-Continue-fast-mode)
3893 (define-key map "b" 'edebug-set-breakpoint)
3894 (define-key map "u" 'edebug-unset-breakpoint)
3895 (define-key map "x" 'edebug-set-conditional-breakpoint)
3896 (define-key map "X" 'edebug-set-global-break-condition)
3899 (define-key map "w" 'edebug-where)
3900 (define-key map "W" 'edebug-toggle-save-windows)
3903 (define-key map "q" 'top-level)
3904 (define-key map "Q" 'edebug-top-level-nonstop)
3905 (define-key map "a" 'abort-recursive-edit)
3908 (define-key map "=" 'edebug-display-freq-count)
3909 map)
3910 "Global map of edebug commands, available from any buffer.")
3913 (global-set-key global-edebug-prefix global-edebug-map)
3926 in the Edebug buffer and \\<global-map>\\[edebug-step-mode] in any buffer.
3931 \\{edebug-mode-map}
3934 \\{global-edebug-map}
3959 (use-local-map edebug-mode-map))
4034 ;; get the first expression
4069 (defvar edebug-eval-mode-map nil
4072 (unless edebug-eval-mode-map
4073 (setq edebug-eval-mode-map (make-sparse-keymap))
4074 (set-keymap-parent edebug-eval-mode-map lisp-interaction-mode-map)
4076 (define-key edebug-eval-mode-map "\C-c\C-w" 'edebug-where)
4077 (define-key edebug-eval-mode-map "\C-c\C-d" 'edebug-delete-eval-item)
4078 (define-key edebug-eval-mode-map "\C-c\C-u" 'edebug-update-eval-list)
4079 (define-key edebug-eval-mode-map "\C-x\C-e" 'edebug-eval-last-sexp)
4080 (define-key edebug-eval-mode-map "\C-j" 'edebug-eval-print-last-sexp))
4090 buffer and \\<global-map>\\[edebug-step-mode] in any buffer.
4093 \\{edebug-eval-mode-map}
4096 \\{global-edebug-map}")
4223 The counts are inserted starting under the `(' before an expression
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
4230 for that expression. Note that this is always the case for an
4231 expression only evaluated once.
4252 ;; Start at last expression in line.
4292 (let ((buffer-read-only nil))
4295 (setq unread-command-char (read-char))
4349 ["Expression" edebug-eval-expression t]
4399 (read-from-minibuffer
4400 "Condition: " initial read-expression-map t
4401 (if (equal (car read-expression-history) initial)
4402 '(read-expression-history . 1)
4403 'read-expression-history)))))))
4406 (easy-menu-define edebug-menu edebug-mode-map "Edebug menus" edebug-mode-menus)
4463 edebug-original-read
4481 '(read-expression-history
4482 read-expression-map))
4485 '(read-expression-history))
4500 ;;; edebug-cl-read and cl-read are available from liberte@cs.uiuc.edu
4501 (if (featurep 'cl-read)
4503 (function (lambda () (require 'edebug-cl-read))))
4504 ;; The following causes edebug-cl-read to be loaded when you load cl-read.el.
4505 (add-hook 'cl-read-load-hooks
4506 (function (lambda () (require 'edebug-cl-read)))))
4515 ;; Install edebug read and eval functions.
4516 (edebug-install-read-eval-functions)