diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2002-02-25 07:26:15 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2002-02-25 07:26:15 +0000 |
commit | 565f89ec063da8226d29f5aa6300e72e732b89eb (patch) | |
tree | 448cffd0bea407f3c54a71a3f996b819b0ca6294 /lisp/ielm.el | |
parent | 0277b535be09ab13c023a854e498e8bf967ba0f0 (diff) | |
download | emacs-565f89ec063da8226d29f5aa6300e72e732b89eb.tar.gz |
(ielm-match-data): New var.
(inferior-emacs-lisp-mode): Make it buffer-local.
(ielm-eval-input): Use it to preserve match-data between inputs.
Diffstat (limited to 'lisp/ielm.el')
-rw-r--r-- | lisp/ielm.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/ielm.el b/lisp/ielm.el index 5db57a52b59..7000b1b265d 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -103,6 +103,9 @@ such as `edebug-defun' to work with such inputs." (defvar *** nil "Third-most-recent value evaluated in IELM.") +(defvar ielm-match-data nil + "Match data saved at the end of last command.") + ;;; System variables (defvar ielm-working-buffer nil @@ -313,6 +316,7 @@ simply inserts a newline." (let ((*save *) (**save **) (***save ***)) + (set-match-data ielm-match-data) (save-excursion (set-buffer ielm-working-buffer) (condition-case err @@ -330,7 +334,8 @@ simply inserts a newline." (error (setq ielm-result (ielm-format-error err)) (setq ielm-error-type "Eval error")) (quit (setq ielm-result "Quit during evaluation") - (setq ielm-error-type "Eval error"))))) + (setq ielm-error-type "Eval error")))) + (setq ielm-match-data (match-data))) (setq ielm-error-type "IELM error") (setq ielm-result "More than one sexp in input")))) @@ -451,6 +456,7 @@ Customised bindings may be defined in `ielm-map', which currently contains: (make-local-variable '**) (setq *** nil) (make-local-variable '***) + (set (make-local-variable 'ielm-match-data) nil) ;; font-lock support (make-local-variable 'font-lock-defaults) |