From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: rcd-template-eval, much is in Org mode Date: Fri, 30 Apr 2021 22:48:56 +0300 Message-ID: References: <874kfn292f.fsf@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13396"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.6 (2021-03-06) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 30 21:52:39 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lcZBm-0003MA-5d for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 30 Apr 2021 21:52:38 +0200 Original-Received: from localhost ([::1]:58784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcZBl-00052N-81 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 30 Apr 2021 15:52:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcZBH-00051w-9Y for help-gnu-emacs@gnu.org; Fri, 30 Apr 2021 15:52:07 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:57003) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcZBC-00024M-BF for help-gnu-emacs@gnu.org; Fri, 30 Apr 2021 15:52:06 -0400 Original-Received: from localhost ([::ffff:154.231.162.22]) (AUTH: PLAIN securesender, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000046239.00000000608C5FDF.0000557C; Fri, 30 Apr 2021 12:51:56 -0700 Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <874kfn292f.fsf@disroot.org> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, CONTENT_AFTER_HTML=1.47, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:129223 Archived-At: * Jorge P. de Morais Neto [2021-04-30 17:29]: > Hi all! >=20 > Em [2021-04-22 qui 10:46:59-0400], Stefan Monnier escreveu: >=20 > >> Is there a way to avoid these warnings? > > > > Yes: don't abuse `eval` ;-) >=20 > 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~. >=20 > 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: =E2=9F=A6 (xml-escape "My new <title>") =E2=9F=A7 it would expand into: My new <title> and I like it that way more than CL-EMB, where I had to do something like: <% @var title -escape-xml %> 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=3Dauto -nH --null -e "(eval " *.el ob-core.el=00231: (eval (or (cdr (assq :eval headers)) ob-core.el=00617: (and (boundp lang-headers) (eval lang-headers t)) ob-core.el=00870: (when (boundp lang-headers) (eval lang-headers t)))) ob-core.el=00908: (lang-headers (when (boundp lang-headers-var) (ev= al lang-headers-var t))) ob-core.el=001617: (eval raw-result t))) ob-core.el=002710: (if (stringp value) value (eval value t)))))) ob-core.el=002990: (eval (read cell) t)) ob-emacs-lisp.el=0070: (result (eval (read (if (or (member "code" result-p= arams) ob-shell.el=0051: (eval `(defun ,(intern (concat "org-babel-execute:" na= me)) ob-shell.el=0056: (eval `(defalias ',(intern (concat "org-babel-variable= -assignments:" name)) ob-shell.el=0061: (eval `(defvar ,(intern (concat "org-babel-default-hea= der-args:" name)) '())))) ob-table.el=00127: (eval `(org-babel-parse-header-ar= guments ol-bbdb.el=00412: ((listp form) (eval form)) ol.el=001324: (eval (read path)) org-agenda.el=002910: (setq type (nth 2 entry) org-match (eval (nth 3= entry)) org-agenda.el=003241: (setq match (eval (nth 1 org-cmd))) org-agenda.el=003400: (eval (list 'org-batch-store-agenda-views))) org-agenda.el=003710: (eval form))) org-agenda.el=004128: (eval form))))))) org-agenda.el=006728: (setq rtn (concat (eval formatter) txt)) org-agenda.el=007257: (eval (cons 'or org-agenda-sorting-strategy-selecte= d)) org-agenda.el=007511: (eval series-redo-cmd) org-agenda.el=008114: (unless (eval org-agenda-filter-form) org-agenda.el=008228: (eval org-agenda-jump-prefer-future)) org.el=008421: (eval `(let ,binds org.el=009329: (or (eval checklist) org.el=0012473: (setq scope (eval scope))) org.el=0014231: (eval form) org.el=0014645: (result (if calendar-debug-sexp (eval sexp) org.el=0014647: (eval sexp) org.el=0016525: (eval org-speed-command)) org.el=0018337: (not (equal (symbol-value v) (eval (car (get v 'standard-= value))))))) org-macro.el=00152: '("n" . "(eval (org-macro--counter-increment $1 $2))") org-macro.el=00153: '("keyword" . "(eval (org-macro--find-keyword-value $= 1))") org-macro.el=00154: '("time" . "(eval (format-time-string $1))") org-macro.el=00155: '("property" . "(eval (org-macro--get-property $1 $2)= )"))))) org-macro.el=00180: (setq value (eval (condition-case nil (read va= lue) org-macro.el=00334: (format "(eval (if (org-string-nw-p $1) %s %S))" org-macs.el=00176: `(eval (list 'let ,environment ',form))) org-macs.el=00626: (eval (cons 'let (cons list body)))) org-macs.el=00630: (eval (cons 'let (cons list1 (list (cons 'let (cons lis= t2 body))))))) org-macs.el=00636: (eval form) org-mouse.el=00522: (eval `(org-agenda nil (string-to-char ,key)))) org-pcomplete.el=00429: (and (boundp lang-headers) (eval lang-headers t= ))))) org-table.el=002600: (eval (eval (read form))) ox.el=001572: (let ((value (eval (nth 3 cell)))) ox.el=003107: (mapconcat #'identity (eval (nt= h 3 entry)) " ") ox.el=003108: (eval (nth 3 entry))))) ox.el=003111: (push (cons option (eval (nth 3 entry))) op= tions)))))) ox-odt.el=00538: (eval (car (widget-get w :args))))) ox-odt.el=00627: (eval (car (widget-get w :args))))) --=20 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/