[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
rcd-template-eval, much is in Org mode
From: |
Jean Louis |
Subject: |
rcd-template-eval, much is in Org mode |
Date: |
Fri, 30 Apr 2021 22:48:56 +0300 |
User-agent: |
Mutt/2.0.6 (2021-03-06) |
* Jorge P. de Morais Neto <jorge+list@disroot.org> [2021-04-30 17:29]:
> Hi all!
>
> Em [2021-04-22 qui 10:46:59-0400], Stefan Monnier escreveu:
>
> >> Is there a way to avoid these warnings?
> >
> > Yes: don't abuse `eval` ;-)
>
> Jean Louis, could you provide a little more detail on what are you using
> ~eval~ for? Some tasks accomplished by eval can be done more safely by
> other means. For example, if you just want symbol indirection, you can
> use ~symbol-value~ (there is also ~symbol-function~). If you want to
> apply a function object to a sequence of arguments, you can use ~apply~
> or ~funcall~.
>
> I know little about Elisp; more experienced hackers may know about other
> mechanisms that avoid the need for ~eval~.
Org mode is one of popular modes, and it has 52 matches for "(eval "
on my computer. See below.
For almost 2 decades I use that for WWW publishing. Imagine:
<html>
<body>
<title>⟦ (xml-escape "My new <title>") ⟧</title>
</body>
</html>
it would expand into:
<html>
<body>
<title>My new <title></title>
</body>
</html>
and I like it that way more than CL-EMB, where I had to do something like:
<html>
<body>
<title><% @var title -escape-xml %></title>
</body>
</html>
We are eval-ing in Emacs more than we think when we use Org mode.
-*- mode: grep; default-directory: "~/.emacs.d/elpa/org-20201216/" -*-
Grep started at Fri Apr 30 22:43:55
grep --color=auto -nH --null -e "(eval " *.el
ob-core.el 231: (eval (or (cdr (assq :eval headers))
ob-core.el 617: (and (boundp lang-headers) (eval lang-headers t))
ob-core.el 870: (when (boundp lang-headers) (eval lang-headers t))))
ob-core.el 908: (lang-headers (when (boundp lang-headers-var) (eval
lang-headers-var t)))
ob-core.el 1617: (eval raw-result t)))
ob-core.el 2710: (if (stringp value) value
(eval value t))))))
ob-core.el 2990: (eval (read cell) t))
ob-emacs-lisp.el 70: (result (eval (read (if (or (member "code"
result-params)
ob-shell.el 51: (eval `(defun ,(intern (concat "org-babel-execute:" name))
ob-shell.el 56: (eval `(defalias ',(intern (concat
"org-babel-variable-assignments:" name))
ob-shell.el 61: (eval `(defvar ,(intern (concat
"org-babel-default-header-args:" name)) '()))))
ob-table.el 127: (eval `(org-babel-parse-header-arguments
ol-bbdb.el 412: ((listp form) (eval form))
ol.el 1324: (eval (read path))
org-agenda.el 2910: (setq type (nth 2 entry) org-match (eval (nth 3
entry))
org-agenda.el 3241: (setq match (eval (nth 1 org-cmd)))
org-agenda.el 3400: (eval (list 'org-batch-store-agenda-views)))
org-agenda.el 3710: (eval form)))
org-agenda.el 4128: (eval form)))))))
org-agenda.el 6728: (setq rtn (concat (eval formatter) txt))
org-agenda.el 7257: (eval (cons 'or org-agenda-sorting-strategy-selected))
org-agenda.el 7511: (eval series-redo-cmd)
org-agenda.el 8114: (unless (eval org-agenda-filter-form)
org-agenda.el 8228: (eval org-agenda-jump-prefer-future))
org.el 8421: (eval `(let ,binds
org.el 9329: (or (eval checklist)
org.el 12473: (setq scope (eval scope)))
org.el 14231: (eval form)
org.el 14645: (result (if calendar-debug-sexp (eval sexp)
org.el 14647: (eval sexp)
org.el 16525: (eval org-speed-command))
org.el 18337: (not (equal (symbol-value v) (eval (car (get v
'standard-value)))))))
org-macro.el 152: '("n" . "(eval (org-macro--counter-increment $1 $2))")
org-macro.el 153: '("keyword" . "(eval (org-macro--find-keyword-value
$1))")
org-macro.el 154: '("time" . "(eval (format-time-string $1))")
org-macro.el 155: '("property" . "(eval (org-macro--get-property $1
$2))")))))
org-macro.el 180: (setq value (eval (condition-case nil (read value)
org-macro.el 334: (format "(eval (if (org-string-nw-p $1) %s %S))"
org-macs.el 176: `(eval (list 'let ,environment ',form)))
org-macs.el 626: (eval (cons 'let (cons list body))))
org-macs.el 630: (eval (cons 'let (cons list1 (list (cons 'let (cons list2
body)))))))
org-macs.el 636: (eval form)
org-mouse.el 522: (eval `(org-agenda nil (string-to-char ,key))))
org-pcomplete.el 429: (and (boundp lang-headers) (eval
lang-headers t)))))
org-table.el 2600: (eval (eval (read form)))
ox.el 1572: (let ((value (eval (nth 3 cell))))
ox.el 3107: (mapconcat #'identity (eval (nth 3
entry)) " ")
ox.el 3108: (eval (nth 3 entry)))))
ox.el 3111: (push (cons option (eval (nth 3 entry)))
options))))))
ox-odt.el 538: (eval (car (widget-get w :args)))))
ox-odt.el 627: (eval (car (widget-get w :args)))))
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/
- How to tame compiler?, Jean Louis, 2021/04/22
- Re: How to tame compiler?, Stefan Monnier, 2021/04/22
- Re: How to tame compiler?, Jean Louis, 2021/04/22
- Re: How to tame compiler?, Jean Louis, 2021/04/22
- Re: How to tame compiler?, Jorge P . de Morais Neto, 2021/04/30
- rcd-template-eval - was Re: How to tame compiler?, Jean Louis, 2021/04/30
- rcd-template-eval, much is in Org mode,
Jean Louis <=
- 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, 2021/04/30
- Re: How to tame compiler?, Stefan Monnier, 2021/04/30