; Improve correctness of 'eshell-do-eval' in some edge cases
* lisp/eshell/esh-cmd.el (eshell-do-eval): Make sure that replacing 'if' forms returns the correct result, and evaluate to 'nil' for 'progn' forms with no body.
This commit is contained in:
parent
e8f38d1364
commit
8bfdee8689
1 changed files with 2 additions and 2 deletions
|
@ -1159,7 +1159,7 @@ have been replaced by constants."
|
|||
(t
|
||||
(caddr args))))) ; Zero or one ELSE forms
|
||||
(unless (consp new-form)
|
||||
(setq new-form (cons 'progn new-form)))
|
||||
(setq new-form `(progn ,new-form)))
|
||||
(setcar form (car new-form))
|
||||
(setcdr form (cdr new-form))))
|
||||
(eshell-do-eval form synchronous-p))
|
||||
|
@ -1261,7 +1261,7 @@ have been replaced by constants."
|
|||
(setq args (cdr args)))))
|
||||
(cond
|
||||
((eq (car form) 'progn)
|
||||
(car (last form)))
|
||||
(car (last (cdr form))))
|
||||
((eq (car form) 'prog1)
|
||||
(cadr form))
|
||||
(t
|
||||
|
|
Loading…
Add table
Reference in a new issue