help-gnu-emacs
[Top][All Lists]
Advanced

[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 &lt;title&gt;</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.el231:  (eval (or (cdr  (assq :eval headers))
ob-core.el617:               (and (boundp lang-headers) (eval lang-headers t))
ob-core.el870:            (when (boundp lang-headers) (eval lang-headers t))))
ob-core.el908:         (lang-headers (when (boundp lang-headers-var) (eval 
lang-headers-var t)))
ob-core.el1617:                                          (eval raw-result t)))
ob-core.el2710:                                   (if (stringp value) value 
(eval value t))))))
ob-core.el2990:         (eval (read cell) t))
ob-emacs-lisp.el70:     (result (eval (read (if (or (member "code" 
result-params)
ob-shell.el51:    (eval `(defun ,(intern (concat "org-babel-execute:" name))
ob-shell.el56:    (eval `(defalias ',(intern (concat 
"org-babel-variable-assignments:" name))
ob-shell.el61:    (eval `(defvar ,(intern (concat 
"org-babel-default-header-args:" name)) '()))))
ob-table.el127:                        (eval `(org-babel-parse-header-arguments
ol-bbdb.el412:                       ((listp form) (eval form))
ol.el1324:                (eval (read path))
org-agenda.el2910:           (setq type (nth 2 entry) org-match (eval (nth 3 
entry))
org-agenda.el3241:      (setq match (eval (nth 1 org-cmd)))
org-agenda.el3400:  (eval (list 'org-batch-store-agenda-views)))
org-agenda.el3710:    (eval form)))
org-agenda.el4128:            (eval form)))))))
org-agenda.el6728:     (setq rtn (concat (eval formatter) txt))
org-agenda.el7257:       (eval (cons 'or org-agenda-sorting-strategy-selected))
org-agenda.el7511:     (eval series-redo-cmd)
org-agenda.el8114:       (unless (eval org-agenda-filter-form)
org-agenda.el8228:       (eval org-agenda-jump-prefer-future))
org.el8421:    (eval `(let ,binds
org.el9329:                           (or (eval checklist)
org.el12473:         (setq scope (eval scope)))
org.el14231:    (eval form)
org.el14645:    (result (if calendar-debug-sexp (eval sexp)
org.el14647:                  (eval sexp)
org.el16525:      (eval org-speed-command))
org.el18337:                   (not (equal (symbol-value v) (eval (car (get v 
'standard-value)))))))
org-macro.el152:         '("n" . "(eval (org-macro--counter-increment $1 $2))")
org-macro.el153:         '("keyword" . "(eval (org-macro--find-keyword-value 
$1))")
org-macro.el154:         '("time" . "(eval (format-time-string $1))")
org-macro.el155:         '("property" . "(eval (org-macro--get-property $1 
$2))")))))
org-macro.el180:          (setq value (eval (condition-case nil (read value)
org-macro.el334:       (format "(eval (if (org-string-nw-p $1) %s %S))"
org-macs.el176:  `(eval (list 'let ,environment ',form)))
org-macs.el626:  (eval (cons 'let (cons list body))))
org-macs.el630:  (eval (cons 'let (cons list1 (list (cons 'let (cons list2 
body)))))))
org-macs.el636:      (eval form)
org-mouse.el522:           (eval `(org-agenda nil (string-to-char ,key))))
org-pcomplete.el429:              (and (boundp lang-headers) (eval 
lang-headers t)))))
org-table.el2600:                       (eval (eval (read form)))
ox.el1572:              (let ((value (eval (nth 3 cell))))
ox.el3107:                               (mapconcat #'identity (eval (nth 3 
entry)) " ")
ox.el3108:                             (eval (nth 3 entry)))))
ox.el3111:                   (push (cons option (eval (nth 3 entry))) 
options))))))
ox-odt.el538:                    (eval (car (widget-get w :args)))))
ox-odt.el627:                    (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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]