diff options
| author | Mark Oteiza | 2017-01-17 00:48:00 -0500 |
|---|---|---|
| committer | Mark Oteiza | 2017-01-17 00:48:00 -0500 |
| commit | 5362ef79cbb195f9df38f71b4d64e290cd7d9f50 (patch) | |
| tree | 7b50f8d0271c323b7994837e33e8d64c2db3df37 | |
| parent | 922850bcc7ccc24601c27598dbae3520d5f9943d (diff) | |
| download | emacs-5362ef79cbb195f9df38f71b4d64e290cd7d9f50.tar.gz emacs-5362ef79cbb195f9df38f71b4d64e290cd7d9f50.zip | |
Nix some uses of eval
* lisp/play/dunnet.el: Fix triple negative.
(dun-doverb): Use funcall instead of eval.
(dun-echo): Just call dun-mprinc.
(dun-save-val): Just bind value without eval.
| -rw-r--r-- | lisp/play/dunnet.el | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index f219f871ec8..37dcba61426 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el | |||
| @@ -1113,7 +1113,7 @@ for a moment, then straighten yourself up. | |||
| 1113 | (dun-doverb dun-ignore dun-verblist (car rest) (cdr rest))) | 1113 | (dun-doverb dun-ignore dun-verblist (car rest) (cdr rest))) |
| 1114 | (if (not (cdr (assq (intern verb) dun-verblist))) -1 | 1114 | (if (not (cdr (assq (intern verb) dun-verblist))) -1 |
| 1115 | (setq dun-numcmds (1+ dun-numcmds)) | 1115 | (setq dun-numcmds (1+ dun-numcmds)) |
| 1116 | (eval (list (cdr (assq (intern verb) dun-verblist)) (quote rest))))))) | 1116 | (funcall (cdr (assq (intern verb) dun-verblist)) rest))))) |
| 1117 | 1117 | ||
| 1118 | 1118 | ||
| 1119 | ;;; Function to take a string and change it into a list of lowercase words. | 1119 | ;;; Function to take a string and change it into a list of lowercase words. |
| @@ -2687,7 +2687,7 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..") | |||
| 2687 | (dun-mprinc var) | 2687 | (dun-mprinc var) |
| 2688 | (dun-mprinc ": Permission denied") | 2688 | (dun-mprinc ": Permission denied") |
| 2689 | (setq nomore t)) | 2689 | (setq nomore t)) |
| 2690 | (eval (list 'dun-mprinc var)) | 2690 | (dun-mprinc var) |
| 2691 | (dun-mprinc " "))))))) | 2691 | (dun-mprinc " "))))))) |
| 2692 | (dun-mprinc "\n"))) | 2692 | (dun-mprinc "\n"))) |
| 2693 | 2693 | ||
| @@ -3177,9 +3177,7 @@ File not found"))) | |||
| 3177 | 3177 | ||
| 3178 | 3178 | ||
| 3179 | (defun dun-save-val (varname) | 3179 | (defun dun-save-val (varname) |
| 3180 | (let (value) | 3180 | (let ((value (symbol-value (intern varname)))) |
| 3181 | (setq varname (intern varname)) | ||
| 3182 | (setq value (eval varname)) | ||
| 3183 | (dun-minsert "(setq ") | 3181 | (dun-minsert "(setq ") |
| 3184 | (dun-minsert varname) | 3182 | (dun-minsert varname) |
| 3185 | (dun-minsert " ") | 3183 | (dun-minsert " ") |
| @@ -3329,7 +3327,7 @@ File not found"))) | |||
| 3329 | (dun-mprinc "\n") | 3327 | (dun-mprinc "\n") |
| 3330 | (dun-batch-loop)) | 3328 | (dun-batch-loop)) |
| 3331 | 3329 | ||
| 3332 | (unless (not noninteractive) | 3330 | (when noninteractive |
| 3333 | (fset 'dun-mprinc 'dun-batch-mprinc) | 3331 | (fset 'dun-mprinc 'dun-batch-mprinc) |
| 3334 | (fset 'dun-mprincl 'dun-batch-mprincl) | 3332 | (fset 'dun-mprincl 'dun-batch-mprincl) |
| 3335 | (fset 'dun-vparse 'dun-batch-parse) | 3333 | (fset 'dun-vparse 'dun-batch-parse) |