From: Jean Louis <bugs@gnu.support>
To: help-gnu-emacs@gnu.org
Subject: rcd-template-eval, much is in Org mode
Date: Fri, 30 Apr 2021 22:48:56 +0300 [thread overview]
Message-ID: <YIxfKFyYgKYPQSUh@protected.localdomain> (raw)
In-Reply-To: <874kfn292f.fsf@disroot.org>
* 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\0231: (eval (or (cdr (assq :eval headers))
ob-core.el\0617: (and (boundp lang-headers) (eval lang-headers t))
ob-core.el\0870: (when (boundp lang-headers) (eval lang-headers t))))
ob-core.el\0908: (lang-headers (when (boundp lang-headers-var) (eval lang-headers-var t)))
ob-core.el\01617: (eval raw-result t)))
ob-core.el\02710: (if (stringp value) value (eval value t))))))
ob-core.el\02990: (eval (read cell) t))
ob-emacs-lisp.el\070: (result (eval (read (if (or (member "code" result-params)
ob-shell.el\051: (eval `(defun ,(intern (concat "org-babel-execute:" name))
ob-shell.el\056: (eval `(defalias ',(intern (concat "org-babel-variable-assignments:" name))
ob-shell.el\061: (eval `(defvar ,(intern (concat "org-babel-default-header-args:" name)) '()))))
ob-table.el\0127: (eval `(org-babel-parse-header-arguments
ol-bbdb.el\0412: ((listp form) (eval form))
ol.el\01324: (eval (read path))
org-agenda.el\02910: (setq type (nth 2 entry) org-match (eval (nth 3 entry))
org-agenda.el\03241: (setq match (eval (nth 1 org-cmd)))
org-agenda.el\03400: (eval (list 'org-batch-store-agenda-views)))
org-agenda.el\03710: (eval form)))
org-agenda.el\04128: (eval form)))))))
org-agenda.el\06728: (setq rtn (concat (eval formatter) txt))
org-agenda.el\07257: (eval (cons 'or org-agenda-sorting-strategy-selected))
org-agenda.el\07511: (eval series-redo-cmd)
org-agenda.el\08114: (unless (eval org-agenda-filter-form)
org-agenda.el\08228: (eval org-agenda-jump-prefer-future))
org.el\08421: (eval `(let ,binds
org.el\09329: (or (eval checklist)
org.el\012473: (setq scope (eval scope)))
org.el\014231: (eval form)
org.el\014645: (result (if calendar-debug-sexp (eval sexp)
org.el\014647: (eval sexp)
org.el\016525: (eval org-speed-command))
org.el\018337: (not (equal (symbol-value v) (eval (car (get v 'standard-value)))))))
org-macro.el\0152: '("n" . "(eval (org-macro--counter-increment $1 $2))")
org-macro.el\0153: '("keyword" . "(eval (org-macro--find-keyword-value $1))")
org-macro.el\0154: '("time" . "(eval (format-time-string $1))")
org-macro.el\0155: '("property" . "(eval (org-macro--get-property $1 $2))")))))
org-macro.el\0180: (setq value (eval (condition-case nil (read value)
org-macro.el\0334: (format "(eval (if (org-string-nw-p $1) %s %S))"
org-macs.el\0176: `(eval (list 'let ,environment ',form)))
org-macs.el\0626: (eval (cons 'let (cons list body))))
org-macs.el\0630: (eval (cons 'let (cons list1 (list (cons 'let (cons list2 body)))))))
org-macs.el\0636: (eval form)
org-mouse.el\0522: (eval `(org-agenda nil (string-to-char ,key))))
org-pcomplete.el\0429: (and (boundp lang-headers) (eval lang-headers t)))))
org-table.el\02600: (eval (eval (read form)))
ox.el\01572: (let ((value (eval (nth 3 cell))))
ox.el\03107: (mapconcat #'identity (eval (nth 3 entry)) " ")
ox.el\03108: (eval (nth 3 entry)))))
ox.el\03111: (push (cons option (eval (nth 3 entry))) options))))))
ox-odt.el\0538: (eval (car (widget-get w :args)))))
ox-odt.el\0627: (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/
next prev parent reply other threads:[~2021-04-30 19:48 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-22 14:43 How to tame compiler? Jean Louis
2021-04-22 14:46 ` Stefan Monnier
2021-04-22 15:47 ` Jean Louis
2021-04-22 16:06 ` Jean Louis
2021-04-30 13:31 ` Jorge P. de Morais Neto
2021-04-30 19:38 ` rcd-template-eval - was " Jean Louis
2021-04-30 19:48 ` Jean Louis [this message]
2021-04-30 20:06 ` rcd-template-eval, much is in Org mode Tassilo Horn
2021-04-30 22:08 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-30 23:04 ` Org mode rant Jean Louis
2021-05-01 0:46 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-01 6:10 ` Jean Louis
2021-05-01 6:34 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-01 9:41 ` On markdown images Jean Louis
2021-05-01 9:59 ` Yuri Khan
2021-05-01 10:18 ` Jean Louis
2021-05-01 11:09 ` Yuri Khan
2021-05-01 11:25 ` Jean Louis
2021-05-02 19:30 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-03 5:43 ` Yuri Khan
2021-05-03 17:08 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-03 23:22 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-04 2:39 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-01 5:00 ` Org mode rant Bastien
2021-05-01 5:10 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-01 9:16 ` Jean Louis
2021-05-01 10:06 ` Bastien
2021-05-01 10:42 ` Jean Louis
2021-05-01 10:10 ` Bastien
2021-05-01 11:19 ` Jean Louis
2021-05-01 13:48 ` [External] : " Drew Adams
2021-05-01 14:05 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-01 10:10 ` Bastien
2021-04-30 20:23 ` eval myths - Re: How to tame compiler? Jean Louis
2021-04-30 22:11 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-30 23:07 ` Jean Louis
2021-05-01 0:28 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-01 8:13 ` tomas
2021-04-30 22:06 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-30 22:20 ` Stefan Monnier
2021-04-30 22:31 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-04-30 22:50 ` Stefan Monnier
2021-04-30 22:56 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-01 0:44 ` Michael Heerdegen
2021-05-01 3:49 ` Stefan Monnier
2021-05-01 4:55 ` Michael Heerdegen
2021-05-01 6:34 ` Jean Louis
2021-05-01 13:38 ` Stefan Monnier
2021-05-01 16:19 ` Jean Louis
2021-05-02 5:41 ` Michael Heerdegen
2021-05-02 7:37 ` Jean Louis
2021-05-02 7:45 ` Jean Louis
2021-05-02 9:06 ` tomas
2021-05-02 11:18 ` Jean Louis
2021-05-02 12:24 ` tomas
2021-05-02 18:17 ` Jean Louis
2021-05-02 12:06 ` Stages of WWW development compared to Emacs Lisp development Jean Louis
2021-05-02 16:51 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-02 18:37 ` Jean Louis
2021-05-02 16:45 ` How to tame compiler? Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-02 22:29 ` Stefan Monnier
2021-05-02 23:14 ` Jean Louis
2021-05-03 1:58 ` Eduardo Ochs
2021-05-03 6:51 ` Eval in templates - " Jean Louis
2021-05-01 4:53 ` Michael Heerdegen
2021-05-01 7:05 ` Jean Louis
2021-05-01 7:59 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-01 6:03 ` Jean Louis
2021-05-01 6:17 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-02 5:58 ` Michael Heerdegen
2021-05-02 6:54 ` Jean Louis
2021-05-03 21:39 ` Jean Louis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YIxfKFyYgKYPQSUh@protected.localdomain \
--to=bugs@gnu.support \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.