aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2020-05-11 00:12:29 -0400
committerStefan Monnier2020-05-11 00:12:29 -0400
commit67bcde188f777e1f884eb46ab3123afa74d8d303 (patch)
tree5cede20663890272803717fb77cb865a5cf6c247
parentc9d7253dd1bd33c1b857203bc9a050013fcb4b34 (diff)
downloademacs-67bcde188f777e1f884eb46ab3123afa74d8d303.tar.gz
emacs-67bcde188f777e1f884eb46ab3123afa74d8d303.zip
* lisp/ielm.el: Handle corner case where */**/*** are not yet bound
Remote redundant :group args. (ielm-eval-input): Use bound-and-true-p for */**/***
-rw-r--r--lisp/ielm.el31
1 files changed, 13 insertions, 18 deletions
diff --git a/lisp/ielm.el b/lisp/ielm.el
index fc06ebfa2db..47c5158ce41 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -44,8 +44,7 @@
44 44
45(defcustom ielm-noisy t 45(defcustom ielm-noisy t
46 "If non-nil, IELM will beep on error." 46 "If non-nil, IELM will beep on error."
47 :type 'boolean 47 :type 'boolean)
48 :group 'ielm)
49 48
50(defcustom ielm-prompt-read-only t 49(defcustom ielm-prompt-read-only t
51 "If non-nil, the IELM prompt is read only. 50 "If non-nil, the IELM prompt is read only.
@@ -74,7 +73,6 @@ buffers, including IELM buffers. If you sometimes use IELM on
74text-only terminals or with `emacs -nw', you might wish to use 73text-only terminals or with `emacs -nw', you might wish to use
75another binding for `comint-kill-whole-line'." 74another binding for `comint-kill-whole-line'."
76 :type 'boolean 75 :type 'boolean
77 :group 'ielm
78 :version "22.1") 76 :version "22.1")
79 77
80(defcustom ielm-prompt "ELISP> " 78(defcustom ielm-prompt "ELISP> "
@@ -90,8 +88,7 @@ does not update the prompt of an *ielm* buffer with a running process.
90For IELM buffers that are not called `*ielm*', you can execute 88For IELM buffers that are not called `*ielm*', you can execute
91\\[inferior-emacs-lisp-mode] in that IELM buffer to update the value, 89\\[inferior-emacs-lisp-mode] in that IELM buffer to update the value,
92for new prompts. This works even if the buffer has a running process." 90for new prompts. This works even if the buffer has a running process."
93 :type 'string 91 :type 'string)
94 :group 'ielm)
95 92
96(defvar ielm-prompt-internal "ELISP> " 93(defvar ielm-prompt-internal "ELISP> "
97 "Stored value of `ielm-prompt' in the current IELM buffer. 94 "Stored value of `ielm-prompt' in the current IELM buffer.
@@ -103,8 +100,7 @@ customizes `ielm-prompt'.")
103 "Controls whether \\<ielm-map>\\[ielm-return] has intelligent behavior in IELM. 100 "Controls whether \\<ielm-map>\\[ielm-return] has intelligent behavior in IELM.
104If non-nil, \\[ielm-return] evaluates input for complete sexps, or inserts a newline 101If non-nil, \\[ielm-return] evaluates input for complete sexps, or inserts a newline
105and indents for incomplete sexps. If nil, always inserts newlines." 102and indents for incomplete sexps. If nil, always inserts newlines."
106 :type 'boolean 103 :type 'boolean)
107 :group 'ielm)
108 104
109(defcustom ielm-dynamic-multiline-inputs t 105(defcustom ielm-dynamic-multiline-inputs t
110 "Force multiline inputs to start from column zero? 106 "Force multiline inputs to start from column zero?
@@ -112,15 +108,13 @@ If non-nil, after entering the first line of an incomplete sexp, a newline
112will be inserted after the prompt, moving the input to the next line. 108will be inserted after the prompt, moving the input to the next line.
113This gives more frame width for large indented sexps, and allows functions 109This gives more frame width for large indented sexps, and allows functions
114such as `edebug-defun' to work with such inputs." 110such as `edebug-defun' to work with such inputs."
115 :type 'boolean 111 :type 'boolean)
116 :group 'ielm)
117 112
118(defvaralias 'inferior-emacs-lisp-mode-hook 'ielm-mode-hook) 113(defvaralias 'inferior-emacs-lisp-mode-hook 'ielm-mode-hook)
119(defcustom ielm-mode-hook nil 114(defcustom ielm-mode-hook nil
120 "Hooks to be run when IELM (`inferior-emacs-lisp-mode') is started." 115 "Hooks to be run when IELM (`inferior-emacs-lisp-mode') is started."
121 :options '(eldoc-mode) 116 :options '(eldoc-mode)
122 :type 'hook 117 :type 'hook)
123 :group 'ielm)
124 118
125;; We define these symbols (that are only used buffer-locally in ielm 119;; We define these symbols (that are only used buffer-locally in ielm
126;; buffers) this way to avoid having them be defined in the global 120;; buffers) this way to avoid having them be defined in the global
@@ -366,9 +360,9 @@ nonempty, then flushes the buffer."
366 ;; that same let. To avoid problems, neither of 360 ;; that same let. To avoid problems, neither of
367 ;; these buffers should be alive during the 361 ;; these buffers should be alive during the
368 ;; evaluation of form. 362 ;; evaluation of form.
369 (let* ((*1 *) 363 (let* ((*1 (bound-and-true-p *))
370 (*2 **) 364 (*2 (bound-and-true-p **))
371 (*3 ***) 365 (*3 (bound-and-true-p ***))
372 (active-process (ielm-process)) 366 (active-process (ielm-process))
373 (old-standard-output standard-output) 367 (old-standard-output standard-output)
374 new-standard-output 368 new-standard-output
@@ -453,11 +447,12 @@ nonempty, then flushes the buffer."
453 (if error-type 447 (if error-type
454 (progn 448 (progn
455 (when ielm-noisy (ding)) 449 (when ielm-noisy (ding))
456 (setq output (concat output "*** " error-type " *** ")) 450 (setq output (concat output
457 (setq output (concat output result))) 451 "*** " error-type " *** "
452 result)))
458 ;; There was no error, so shift the *** values 453 ;; There was no error, so shift the *** values
459 (setq *** **) 454 (setq *** (bound-and-true-p **))
460 (setq ** *) 455 (setq ** (bound-and-true-p *))
461 (setq * result)) 456 (setq * result))
462 (when (or (not for-effect) (not (equal output ""))) 457 (when (or (not for-effect) (not (equal output "")))
463 (setq output (concat output "\n")))) 458 (setq output (concat output "\n"))))