emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eev 39a2cea 60/64: New file: eev-template0.el.


From: Stefan Monnier
Subject: [elpa] externals/eev 39a2cea 60/64: New file: eev-template0.el.
Date: Sun, 7 Apr 2019 16:59:14 -0400 (EDT)

branch: externals/eev
commit 39a2ceaad8b4e30e5368825328f2060de9985693
Author: Eduardo Ochs <address@hidden>
Commit: Eduardo Ochs <address@hidden>

    New file: eev-template0.el.
---
 ChangeLog   |  7 +++++++
 VERSION     |  4 ++--
 eev-load.el |  3 ++-
 eev-wrap.el | 66 ++++++-------------------------------------------------------
 4 files changed, 17 insertions(+), 63 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 93bcd72..8a3075c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2019-03-29  Eduardo Ochs  <address@hidden>
 
+       * eev-template0.el: new file.
+
+       * eev-load.el: added a "(require 'eev-template0)".
+
+       * eev-wrap.el (ee-template00, ee-template0): deleted - moved to
+       the file eev-template0.el.
+
        * eev-brxxx.el: made this file compatible with lexical binding.
        Made the argument `f' explicit in many functions and moved the
        functionality of `ee-tail-call' into the functions
diff --git a/VERSION b/VERSION
index 0b044b3..5620afa 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Fri Mar 29 22:04:58 GMT 2019
-Fri Mar 29 19:04:58 -03 2019
+Fri Mar 29 22:48:34 GMT 2019
+Fri Mar 29 19:48:34 -03 2019
diff --git a/eev-load.el b/eev-load.el
index 410e725..5992a0d 100644
--- a/eev-load.el
+++ b/eev-load.el
@@ -20,7 +20,7 @@
 ;;
 ;; Author:     Eduardo Ochs <address@hidden>
 ;; Maintainer: Eduardo Ochs <address@hidden>
-;; Version:    2019mar02
+;; Version:    2019mar29
 ;; Keywords:   e-scripts
 ;;
 ;; Supersedes: (find-eev "eev-all.el")
@@ -51,6 +51,7 @@
 (require 'eev-eval)           ; (find-eev "eev-eval.el")
 (require 'eev-mode)           ; (find-eev "eev-mode.el")
 (require 'eev-anchors)        ; (find-eev "eev-anchors.el")
+(require 'eev-template0)       ; (find-eev "eev-template0.el")
 ;;
 ;; Support for many kinds of hyperlink functions. See:
 ;;   (find-eev-quick-intro "3. Elisp hyperlinks")
diff --git a/eev-wrap.el b/eev-wrap.el
index e0ab95c..0c7f00a 100644
--- a/eev-wrap.el
+++ b/eev-wrap.el
@@ -1,6 +1,6 @@
 ;;; eev-wrap.el --- wrap the current line into a hyperlink
 
-;; Copyright (C) 2013,2016,2017 Free Software Foundation, Inc.
+;; Copyright (C) 2013,2016,2017,2019 Free Software Foundation, Inc.
 ;;
 ;; This file is part of GNU eev.
 ;;
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <address@hidden>
 ;; Maintainer: Eduardo Ochs <address@hidden>
-;; Version:    2019mar02
+;; Version:    2019mar29
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-wrap.el>
@@ -43,6 +43,8 @@
 ;; «.find-eewrap-links»                (to "find-eewrap-links")
 
 
+(require 'eev-template0)      ; (find-eev "eev-template0.el")
+
 
 (defvar ee-hyperlink-prefix "# "
   "Hyperlinks created by `ee-HS' are prefixed with this.
@@ -92,65 +94,9 @@ The name of this function comes from the \"S\" in `(format 
\"%S\" <obj>)'."
     (list 'quote obj)))
 
 
-
-;;;                  _                       _       _        ___  
-;;;   ___  ___      | |_ ___ _ __ ___  _ __ | | __ _| |_ ___ / _ \ 
-;;;  / _ \/ _ \_____| __/ _ \ '_ ` _ \| '_ \| |/ _` | __/ _ \ | | |
-;;; |  __/  __/_____| ||  __/ | | | | | |_) | | (_| | ||  __/ |_| |
-;;;  \___|\___|      \__\___|_| |_| |_| .__/|_|\__,_|\__\___|\___/ 
-;;;                                   |_|                          
-;;
 ;; «ee-template0» (to ".ee-template0")
-;; The functions `ee-template00' and `ee-template0' are used by
-;; several functions of the `eewrap-*' family and also by functions
-;; like `find-latex-links', that create a temporary buffer with elisp
-;; hyperlinks followed by a "templated string". In low-level terms,
-;;
-;;   (ee-template00 STR)
-;;
-;; replace substrings enclosed by `{}'s in STR by the result of
-;; evaluating them; in particular, it replaces each `{VAR}' in STR by
-;; the contents of the variable VAR. Here are some examples/tests:
-;;
-;;   (ee-template00 "a{(+ 2 3)}b")
-;;     -->  "a5b"
-;; 
-;;   (let ((hi "Here: ") (a 22) (b 33)) (ee-template00 "{hi}{a}+{b}={(+ a 
b)}"))
-;;       -->  "Here: 22+33=55"
-;;
-;;   (defun foo (a b) (ee-template00 "{a}+{b}={(+ a b)}"))
-;;   (foo 22 33)
-;;       -->  "22+33=55"
-;;
-;; `ee-template0' is like `ee-template00' but it adds a trick that
-;; makes each "{<}" and each "{>}" in STR be replaced by "{" and "}"
-;; respectively. For example:
-;;
-;;   (ee-template0 "{<} a{(+ 2 3)} {>}")
-;;       -->  "{ a5 }"
-
-(defun ee-template00 (str)
-"Replace substrings enclosed by `{}'s in STR by the result of evaluating them.
-Examples:\n
-  (ee-template00 \"a{(+ 2 3)}b\")
-    -->  \"a5b\"\n
-  (let ((hi \"Here:\") (a 22) (b 33))
-    (ee-template00 \"{hi} {a} + {b} = {(+ a b)}\"))  
-    -->  \"22 + 33 = 55\""
-  (replace-regexp-in-string
-   "{\\([^{}]+\\)}"
-   (lambda (_code_) (format "%s" (eval (read (substring _code_ 1 -1)))))
-   str 'fixedcase 'literal))
-
-(defun ee-template0 (str)
-"Replace substrings enclosed by `{}'s in STR by the result of evaluating them.
-Substrings of the form `{<}' and `{>}' in STR are replaced by `{'
-and `}' respectively; apart from that, this is the same as
-`ee-template00'.
-Example:  (ee-template0 \"{<} a{(+ 2 3)} {>}\")
-             -->  \"{ 5 }\""
-  (let ((< "{") (> "}"))
-    (ee-template00 str)))
+;; Moved to: (find-eev "eev-template0.el")
+
 
 
 



reply via email to

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