[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to tame compiler?
From: |
Emanuel Berg |
Subject: |
Re: How to tame compiler? |
Date: |
Sat, 01 May 2021 00:06:30 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Jorge P. de Morais Neto wrote:
>>> Is there a way to avoid these warnings?
>>
>> Yes: don't abuse `eval` ;-)
Stefan Monnier who wrote that last part, or anyone else for
that matter, what is the rule of thumb when to and when not to
use `eval'?
Maybe something for the docstring?
I have used eval 2 times in all my Elisp. If we apply the rule
of thumb, what will that tell me, is that abuse or not?
For the record I don't get any warnings from either.
(defun wrap-search-again (&optional new-options)
"Repeat the previous `wrap-search' with NEW-OPTIONS.
NEW-OPTIONS can be supplied with \\[universal-argument].
Otherwise options from the previous search are used."
(interactive "p")
(let ((cmd (cl-find-if (lambda (c)
(and (eq (car c) #'wrap-search)
(not (string= (cl-caddr c) "")) ))
command-history) ))
(if cmd
(if (= new-options 1)
(eval cmd)
(let*((search-str (cl-caddr cmd))
(final-cmd (list #'wrap-search new-options search-str)) )
(setq command-history (cons final-cmd command-history))
(apply final-cmd) ))
(message "no previous search") )))
(defun do-repeat-complex-command ()
(interactive)
(eval (car command-history) ))
full source:
https://dataswamp.org/~incal/emacs-init/ide/lisp-incal.el
https://dataswamp.org/~incal/emacs-init/wrap-search.el
--
underground experts united
https://dataswamp.org/~incal
- rcd-template-eval - was Re: How to tame compiler?, (continued)
- rcd-template-eval - was Re: How to tame compiler?, Jean Louis, 2021/04/30
- rcd-template-eval, much is in Org mode, Jean Louis, 2021/04/30
- Re: rcd-template-eval, much is in Org mode, Tassilo Horn, 2021/04/30
- Re: rcd-template-eval, much is in Org mode, Emanuel Berg, 2021/04/30
- Org mode rant, Jean Louis, 2021/04/30
- Re: Org mode rant, Emanuel Berg, 2021/04/30
- eval myths - Re: How to tame compiler?, Jean Louis, 2021/04/30
- Re: eval myths - Re: How to tame compiler?, Emanuel Berg, 2021/04/30
- Re: eval myths - Re: How to tame compiler?, Jean Louis, 2021/04/30
- Re: eval myths - Re: How to tame compiler?, Emanuel Berg, 2021/04/30
- Re: How to tame compiler?,
Emanuel Berg <=
- Re: How to tame compiler?, Stefan Monnier, 2021/04/30
- Re: How to tame compiler?, Emanuel Berg, 2021/04/30
- Re: How to tame compiler?, Stefan Monnier, 2021/04/30
- Re: How to tame compiler?, Emanuel Berg, 2021/04/30
Re: How to tame compiler?, Michael Heerdegen, 2021/04/30