[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/ielm.el
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/ielm.el |
Date: |
Wed, 18 Sep 2002 12:01:43 -0400 |
Index: emacs/lisp/ielm.el
diff -c emacs/lisp/ielm.el:1.27 emacs/lisp/ielm.el:1.28
*** emacs/lisp/ielm.el:1.27 Mon Aug 19 01:03:38 2002
--- emacs/lisp/ielm.el Wed Sep 18 12:01:43 2002
***************
*** 110,115 ****
--- 110,136 ----
(defvar ielm-match-data nil
"Match data saved at the end of last command.")
+ (defvar ielm-*1 nil
+ "During IELM evaluation, most recent value evaluated in IELM.
+ Normally identical to `*'. However, if the working buffer is an IELM
+ buffer, distinct from the process buffer, then `*' gives the value in
+ the working buffer, `*1' the value in the process buffer.
+ The intended value is only accessible during IELM evaluation.")
+
+ (defvar *2 nil
+ "During IELM evaluation, second-most-recent value evaluated in IELM.
+ Normally identical to `**'. However, if the working buffer is an IELM
+ buffer, distinct from the process buffer, then `**' gives the value in
+ the working buffer, `*2' the value in the process buffer.
+ The intended value is only accessible during IELM evaluation.")
+
+ (defvar *3 nil
+ "During IELM evaluation, third-most-recent value evaluated in IELM.
+ Normally identical to `***'. However, if the working buffer is an IELM
+ buffer, distinct from the process buffer, then `***' gives the value in
+ the working buffer, `*3' the value in the process buffer.
+ The intended value is only accessible during IELM evaluation.")
+
;;; System variables
(defvar ielm-working-buffer nil
***************
*** 299,328 ****
ielm-error-type "IELM Error"
ielm-wbuf (current-buffer))
(if (ielm-is-whitespace (substring ielm-string ielm-pos))
! ;; need this awful let convolution to work around
! ;; an Emacs bug involving local vbls and let binding
! (let ((*save *)
! (**save **)
! (***save ***))
(set-match-data ielm-match-data)
(save-excursion
! (set-buffer ielm-working-buffer)
! (condition-case err
! (let ((* *save)
! (** **save)
! (*** ***save)
! (ielm-obuf (current-buffer)))
! (setq ielm-result (eval ielm-form))
! (setq ielm-wbuf (current-buffer))
! ;; The eval may have changed current-buffer;
! ;; need to set it back here to avoid a bug
! ;; in let. Don't want to use save-excursion
! ;; because we want to allow changes in point.
! (set-buffer ielm-obuf))
! (error (setq ielm-result (error-message-string err))
! (setq ielm-error-type "Eval error"))
! (quit (setq ielm-result "Quit during evaluation")
! (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"))))
--- 320,370 ----
ielm-error-type "IELM Error"
ielm-wbuf (current-buffer))
(if (ielm-is-whitespace (substring ielm-string ielm-pos))
! ;; To correctly handle the ielm-local variables *,
! ;; ** and ***, we need a temporary buffer to be
! ;; current at entry to the inner of the next two let
! ;; forms. We need another temporary buffer to exit
! ;; that same let. To avoid problems, neither of
! ;; these buffers should be alive during the
! ;; evaluation of ielm-form.
! (let ((*1 *)
! (*2 **)
! (*3 ***)
! ielm-temp-buffer)
(set-match-data ielm-match-data)
(save-excursion
! (with-temp-buffer
! (condition-case err
! (unwind-protect
! ;; The next let form creates default
! ;; bindings for *, ** and ***. But
! ;; these default bindings are
! ;; identical to the ielm-local
! ;; bindings. Hence, during the
! ;; evaluation of ielm-form, the
! ;; ielm-local values are going to be
! ;; used in all buffers except for
! ;; other ielm buffers, which override
! ;; them. Normally, the variables *1,
! ;; *2 and *3 also have default
! ;; bindings, which are not overridden.
! (let ((* *1)
! (** *2)
! (*** *3))
! (kill-buffer (current-buffer))
! (set-buffer ielm-wbuf)
! (setq ielm-result (eval ielm-form))
! (setq ielm-wbuf (current-buffer))
! (setq
! ielm-temp-buffer
! (generate-new-buffer " *ielm-temp*"))
! (set-buffer ielm-temp-buffer))
! (when ielm-temp-buffer
! (kill-buffer ielm-temp-buffer)))
! (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-match-data (match-data)))
(setq ielm-error-type "IELM error")
(setq ielm-result "More than one sexp in input"))))
***************
*** 388,397 ****
* \\[comint-dynamic-complete] completes Lisp symbols (or filenames, within
strings),
or indents the line if there is nothing to complete.
- During evaluations, the values of the variables `*', `**', and `***'
- are the results of the previous, second previous and third previous
- evaluations respectively.
-
The current working buffer may be changed (with a call to
`set-buffer', or with \\[ielm-change-working-buffer]), and its value
is preserved between successive evaluations. In this way, expressions
--- 430,435 ----
***************
*** 399,404 ****
--- 437,448 ----
Display the name of the working buffer with \\[ielm-print-working-buffer],
or the buffer itself with \\[ielm-display-working-buffer].
+ During evaluations, the values of the variables `*', `**', and `***'
+ are the results of the previous, second previous and third previous
+ evaluations respectively. If the working buffer is another IELM
+ buffer, then the values in the working buffer are used. The variables
+ `*1', `*2' and `*3', yield the process buffer values.
+
Expressions evaluated by IELM are not subject to `debug-on-quit' or
`debug-on-error'.
***************
*** 438,449 ****
(setq fill-paragraph-function 'lisp-fill-paragraph)
;; Value holders
- (setq * nil)
(make-local-variable '*)
! (setq ** nil)
(make-local-variable '**)
! (setq *** nil)
(make-local-variable '***)
(set (make-local-variable 'ielm-match-data) nil)
;; font-lock support
--- 482,493 ----
(setq fill-paragraph-function 'lisp-fill-paragraph)
;; Value holders
(make-local-variable '*)
! (setq * nil)
(make-local-variable '**)
! (setq ** nil)
(make-local-variable '***)
+ (setq *** nil)
(set (make-local-variable 'ielm-match-data) nil)
;; font-lock support
- [Emacs-diffs] Changes to emacs/lisp/ielm.el,
Richard M. Stallman <=