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

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

[elpa] externals/eev 9d39df9 36/64: Several clean-ups in eev-elinks.el a


From: Stefan Monnier
Subject: [elpa] externals/eev 9d39df9 36/64: Several clean-ups in eev-elinks.el and eev-tlinks.el.
Date: Sun, 7 Apr 2019 16:59:08 -0400 (EDT)

branch: externals/eev
commit 9d39df979904ca8a6d720ba1cdca591e6482010d
Author: Eduardo Ochs <address@hidden>
Commit: Eduardo Ochs <address@hidden>

    Several clean-ups in eev-elinks.el and eev-tlinks.el.
---
 ChangeLog     |  30 ++++++++++
 VERSION       |   4 +-
 eev-elinks.el |  45 +++++++++-----
 eev-intro.el  |   4 ++
 eev-mode.el   |   7 ++-
 eev-tlinks.el | 187 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 eev-wrap.el   | 138 ++++++++++++++++++++++++-------------------
 7 files changed, 322 insertions(+), 93 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 252bf78..e5d7587 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2019-02-10  Eduardo Ochs  <address@hidden>
+
+       * eev-intro.el (find-eev-quick-intro): small changes.
+
+2019-02-09  Eduardo Ochs  <address@hidden>
+
+       * eev-wrap.el: commented out all the `define-key's - they are now
+       all in eev-mode.el (but `M-Z' and `M-#' are inactive by default).
+
+       * eev-mode.el (eev-mode-map-set): commented out the binding for `M-Z'.
+       (eev-mode-map-set): added the binding for `M-B' 
(`eewrap-escript-block').
+       (eev-mode-map-set): added the binding for `M-V' (`eewrap-audiovideo').
+
+       * eev-tlinks.el: deleted the key binding for `find-intro-links'.
+
+2019-02-08  Eduardo Ochs  <address@hidden>
+
+       * eev-tlinks.el (ee-copy-rest): added (lots of) comments.
+       (ee-untabify-string): new function.
+       (ee-ss-strings): new variable.
+       (ee-ss-width): new variable.
+       (ee-ss-mode-line): new variable.
+       (ee-ss-echo-area): new variable.
+       (ee-ss-linefmt): new variable.
+       (ee-ss-string-pad): new function.
+       (ee-ss-screenshot0): new function.
+       (ee-ss-screenshot): new function.
+       (find-escreenshot0-links): new function.
+       (find-escreenshot-links): new function.
+
 2019-02-07  Eduardo Ochs  <address@hidden>
 
        * eev-elinks.el: added lots of comments, and moved all
diff --git a/VERSION b/VERSION
index d5c6757..a086b13 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Fri Feb  8 12:12:07 GMT 2019
-Fri Feb  8 10:12:07 -02 2019
+Sun Feb 10 05:37:55 GMT 2019
+Sun Feb 10 03:37:55 -02 2019
diff --git a/eev-elinks.el b/eev-elinks.el
index 28904bc..301b082 100644
--- a/eev-elinks.el
+++ b/eev-elinks.el
@@ -572,7 +572,8 @@ Actually return a list of `(F elt)'s."
   (ee-remove-nils (mapcar f list)))
 
 (defun ee-code-c-d-filter-1 (code)
-  "For debugging. See the comments in the source."
+  "Run CODE on each `c-d' of `ee-code-c-d-pairs' and return a list of results.
+This is a simpler version of `ee-code-c-d-filter-1', used for debugging."
   (ee-filter
    (lambda (c-d)
      (let* ((c (car c-d))
@@ -582,8 +583,8 @@ Actually return a list of `(F elt)'s."
    ee-code-c-d-pairs))
 
 (defun ee-code-c-d-filter-2 (fname code)
-  "For debugging. See the comments in the source.
-Run CODE on each `c-d' of `ee-code-c-d-pairs' and return a list of results."
+  "Run CODE on each `c-d' of `ee-code-c-d-pairs' and return a list of results.
+Only eval CODE when (ee-expand D) is a prefix of (ee-expand FNAME)."
   (let ((efname (ee-expand fname)))
     (ee-filter
      (lambda (c-d)
@@ -624,25 +625,37 @@ Run CODE on each `c-d' of `ee-code-c-d-pairs' and return 
a list of results."
 (defun ee-intern (fmt &rest args)
   (intern (apply 'format fmt args)))
 
-(defun ee-code-c-d-pairs-eval (fname code)
-  "For each entry (C D) in `ee-code-c-d-pairs' for which D is a prefix of 
FNAME,
-evaluate f in the context of a big `let', and return the result."
-  (let ((efname (ee-expand fname)))
-    (ee-filter (lambda (c-d)
-                (let* ((c (car c-d))
-                       (d (cadr c-d))
-                       (ed (ee-expand d)))
-                  (if (ee-prefixp ed efname)
-                      (let ((fname- (ee-remove-prefix ed efname)))
-                        (eval code)))))
-              ee-code-c-d-pairs)))
+;; (defun ee-code-c-d-pairs-eval (fname code)
+;;   "For each entry (C D) in `ee-code-c-d-pairs' for which D is a prefix of 
FNAME,
+;; evaluate f in the context of a big `let', and return the result."
+;;   (let ((efname (ee-expand fname)))
+;;     (ee-filter (lambda (c-d)
+;;                  (let* ((c (car c-d))
+;;                         (d (cadr c-d))
+;;                         (ed (ee-expand d)))
+;;                    (if (ee-prefixp ed efname)
+;;                        (let ((fname- (ee-remove-prefix ed efname)))
+;;                          (eval code)))))
+;;                ee-code-c-d-pairs)))
 
 ;; �ee-find-xxxfile-sexps�  (to ".ee-find-xxxfile-sexps")
 (defun ee-find-xxxfile-sexps (fname)
+  "For each (C D) in ee-code-c-d-pairs test if D is a prefix of FNAME;
+when this is true remove the prefix D from FNAME, and put the sexp
+(find-Cfile \"FNAME-\") in the list of results. Return that list."
   (ee-code-c-d-pairs-eval
    fname
    '(list (ee-intern "find-%sfile" c) fname-)))
 
+;; Experimental:
+(defun ee-find-xxxfile-sexps (fname)
+  (;; ee-code-c-d-pairs-eval
+   ee-code-c-d-filter-2
+   fname
+   '(list (ee-intern "find-%sfile" c) fname-)))
+
+
+
 
 
 ;;;   __ _           _        __ _ _            _ _       _        
@@ -719,7 +732,7 @@ evaluate f in the context of a big `let', and return the 
result."
 
 (defun ee-find-grep-functions (dir)
   "An internal function used by `find-grep-links'."
-  (ee-code-c-d-pairs-eval dir '(ee-intern "find-%sgrep" c)))
+  (ee-code-c-d-filter-2 dir '(ee-intern "find-%sgrep" c)))
 
 (defun ee-find-grep-commands ()
   "An internal function used by `find-grep-links'."
diff --git a/eev-intro.el b/eev-intro.el
index ea9e704..0fc7337 100644
--- a/eev-intro.el
+++ b/eev-intro.el
@@ -991,6 +991,10 @@ the other ones are similar.
   execute the three defuns for `c', `d', and `e', and jump to
   \"/tmp/foo.tex\" from anywhere with `M-x e'.
 
+  A detailed explanation of `ee-copy-rest' can be found here:
+
+    (find-eev \"eev-tlinks.el\" \"ee-copy-rest\")
+
 
 
 
diff --git a/eev-mode.el b/eev-mode.el
index 1400f2f..f8d7326 100644
--- a/eev-mode.el
+++ b/eev-mode.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <address@hidden>
 ;; Maintainer: Eduardo Ochs <address@hidden>
-;; Version:    2019feb01
+;; Version:    2019feb09
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-mode.el>
@@ -83,6 +83,7 @@ and: (find-eval-intro \"`M-k'\")"
   ;;      (find-wrap-intro "all wrapping functions")
   ;;      Source: (find-eev "eev-wrap.el")
   (define-key eev-mode-map "\M-A" 'eewrap-anchor)
+  (define-key eev-mode-map "\M-B" 'eewrap-escript-block)
   (define-key eev-mode-map "\M-C" 'eewrap-code-c-d)
   (define-key eev-mode-map "\M-D" 'eewrap-debian)
   (define-key eev-mode-map "\M-F" 'eewrap-find-fline)
@@ -91,7 +92,9 @@ and: (find-eval-intro \"`M-k'\")"
   (define-key eev-mode-map "\M-P" 'eewrap-pdflike)
   (define-key eev-mode-map "\M-R" 'eewrap-rm/mkdir/cd)
   (define-key eev-mode-map "\M-S" 'eewrap-sh)
-  (define-key eev-mode-map "\M-Z" 'eewrap-zsh)
+  (define-key eev-mode-map "\M-V" 'eewrap-audiovideo)
+  ;; (define-key eev-mode-map "\M-Z" 'eewrap-zsh)
+  ;; (define-key eev-mode-map "\M-#" 'eewrap-two-eepitches)
   ;;
   ;; Keys for creating temporary buffers with elisp hyperlinks:
   ;; The highest-level command is `M-h M-h', described here:
diff --git a/eev-tlinks.el b/eev-tlinks.el
index 53a815b..da4f9a2 100644
--- a/eev-tlinks.el
+++ b/eev-tlinks.el
@@ -1,6 +1,7 @@
 ;;; eev-tlinks.el --- hyperlinks to temporary buffers generated by templates
 
-;; Copyright (C) 2013,2014,2016,2017,2018 Free Software Foundation, Inc.
+;; Copyright (C) 2013,2014,2016,2017,2018,2019 Free Software
+;; Foundation, Inc.
 ;;
 ;; This file is (not yet?) part of GNU eev.
 ;;
@@ -19,7 +20,7 @@
 ;;
 ;; Author:     Eduardo Ochs <address@hidden>
 ;; Maintainer: Eduardo Ochs <address@hidden>
-;; Version:    2019jan08
+;; Version:    2019feb10
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-tlinks.el>
@@ -32,14 +33,22 @@
 
 ;;; Commentary:
 
-;; (find-eev "eev-elinks.el")
+;; The functions defined here - `find-latex-links' and other ones -
+;; produce buffers made of a series of hyperlinks followed by a
+;; templated text. The templated text is usually preceded by a line
+;; like `(ee-copy-rest NLINES CODE)'; see the explanation of
+;; `ee-copy-rest' below to understand how this is used.
+
+;; The functions here are one complexity step above the functions in:
+;;   (find-eev "eev-elinks.el")
+
 ;; (find-efunctiondescr 'ee-upload-links)
 ;; (find-eev "eev-wrap.el" "eewrap-eewrap")
 
 
 
 
-;; �.ee-copy-after-and�                (to "ee-copy-after-and")
+;; �.ee-copy-rest�             (to "ee-copy-rest")
 ;;
 ;; �.find-find-links-links�    (to "find-find-links-links")
 ;; �.find-intro-links�         (to "find-intro-links")
@@ -60,6 +69,7 @@
 ;;
 ;; �.find-latex-links�         (to "find-latex-links")
 ;; �.find-lua-links�           (to "find-lua-links")
+;; �.find-escreenshot-links�   (to "find-escreenshot-links")
 
 
 
@@ -67,19 +77,83 @@
 
 
 
-;; �ee-copy-after-and� (to ".ee-copy-after-and")
-;; A hack for template-based find-*-links functions in which the
-;; second half of the buffer in meant to be copied to somewhere else.
+;;;                                                            _   
+;;;   ___  ___        ___ ___  _ __  _   _       _ __ ___  ___| |_ 
+;;;  / _ \/ _ \_____ / __/ _ \| '_ \| | | |_____| '__/ _ \/ __| __|
+;;; |  __/  __/_____| (_| (_) | |_) | |_| |_____| | |  __/\__ \ |_ 
+;;;  \___|\___|      \___\___/| .__/ \__, |     |_|  \___||___/\__|
+;;;                           |_|    |___/                         
+;;
+;; �ee-copy-rest� (to ".ee-copy-rest")
+;; Some hyperlinks buffers - for example those generated by:
+;;
+;;   (find-latex-links)
+;;   (find-eev-install-links)
+;;
+;; are composed of a series of hyperlinks, then a sexp like
+;; `(ee-copy-rest NLINES CODE)', then some templated text. When we run
+;; the `(ee-copy-rest ...)' the templated text is flashed for a
+;; fraction of a second and copied to the kill ring, and the window is
+;; split in two like this:
+;;
+;;    ____________________________
+;;   |              |             |
+;;   |  hyperlinks  |  target of  |
+;;   |    buffer    |    CODE     |
+;;   |              |             |
+;;   |______________|_____________|
+;;
+;; For example,
+;;
+;;   (find-latex-links "/tmp/foo")
+;;
+;; generates this hyperlinks buffer:
 ;;
+;;    _________________________________________________________________ 
+;;   |# (find-latex-links "/tmp/foo")                                  |
+;;   |# (find-latex-links "/tmp/teste1")                               |
+;;   |# (find-latex-links "~/2019-CLG/teste2")                         |
+;;   |# (find-eev-quick-intro "`find-latex-links'")                    |
+;;   |# (ee-copy-rest 1 '(find-fline "/tmp/foo.tex"))                  |
+;;   |                                                                 |
+;;   |% (defun c () (interactive) (find-sh "pdflatex foo.tex"))        |
+;;   |% (defun d () (interactive) (find-pdf-page "/tmp/foo.pdf"))      |
+;;   |% (defun e () (interactive) (find-fline "/tmp/foo.tex"))         |
+;;   |% (defun w () (interactive) (find-texworks "/tmp/foo.tex"))      |
+;;   |%                                                                |
+;;   |\documentclass{article}                                          |
+;;   |\begin{document}                                                 |
+;;   |                                                                 |
+;;   |\end{document}                                                   |
+;;   |                                                                 |
+;;   |                                                                 |
+;;   |                                                                 |
+;;   | -:**-  *Elisp hyperlinks*   All L1     (Fundamental)  ----------|
+;;   |_________________________________________________________________|
+;;
+;; in which CODE is `(find-fline "/tmp/foo.tex")'. When we execute the
+;; `ee-copy-rest' line all the material from "% (defun c..." downwards
+;; - the "templated text" - is flashed, copied to the kill ring, the
+;; file "/tmp/foo.tex" is opened in the right window, and the
+;; following message is displayed in the echo area:
+;;
+;;   "(Copied 9 lines to the kill ring - use C-y to paste)"
+;;
+;; If the file "/tmp/foo.tex" is empty and we want to initialize it
+;; with the templated string we only need to go to the right window
+;; and type `C-y'; if it is non-empty its present contents will be
+;; displayed and we can decide what to do.
+;;
+;; TO DO: update the decumentation here:
+;;   (find-eev-quick-intro "7.5. `find-latex-links'")
+;;   (find-links-intro "10. The rest of the buffer")
+
 (defvar eeflash-copy '(highlight 0.5))
 
 (defun ee-count-lines (str)
   "Count the number of lines in STR (which should be newline-terminated)."
   (length (replace-regexp-in-string "[^\n]" "" str)))
 
-(defun ee-copy-rest  (skip code)
-  (ee-copy-rest0 skip `(find-2a nil ',code)))
-
 (defun ee-copy-rest0 (skip code)
   "Copy the rest of this buffer to the kill ring and execute CODE.
 The rest of this buffer is everything from the beginning of the next line -
@@ -96,6 +170,14 @@ optionally moving down SKIP lines - to the end of the 
buffer."
     (eval code)
     msg))
 
+(defun ee-copy-rest  (skip code)
+  "Copy the rest of this buffer to the kill ring and execute CODE.
+See: (find-eev \"eev-tlinks.el\" \"ee-copy-rest\")"
+  (ee-copy-rest0 skip `(find-2a nil ',code)))
+
+
+;; Obsolete:
+;;
 ;; (defun ee-copy-after-and (nlines code)
 ;;   "Copy into the kill ring everything from NLINES down on, and run CODE."
 ;;   (move-beginning-of-line (- nlines 1))
@@ -189,7 +271,6 @@ This is an internal function used by `find-{stem}-links'.\"
 ;; �find-intro-links�  (to ".find-intro-links")
 ;; (find-find-links-links "i" "intro" "stem")
 ;; A test: (find-intro-links)
-(define-key eev-mode-map "\M-hi" 'find-intro-links)
 
 (defun ee-intro-stem (&optional bufname)
   (setq bufname (or bufname (buffer-name)))
@@ -244,8 +325,8 @@ Hello
 ;;; |_|                                          
 ;;
 ;; �find-pdflikedef-links� (to ".find-pdflikedef-links")
-;; Used in: (find-eev "eev-pdflike.el")
-;;    e.g.: (find-efunction 'find-xdvi-page)
+;; Obsolete! Was used in: (find-eev "eev-pdflike-old.el")
+;;   e.g. (find-eev "eev-pdflike-old.el" "defalias 'find-xdvipage")
 ;; (find-find-links-links "pdflikedef" "stem firstargs")
 ;;
 (defun find-pdflikedef-links (&optional stem firstargs &rest rest)
@@ -628,6 +709,9 @@ sudo dpkg -i *.deb
 ;;
 ;; �find-eev-update-links� (to ".find-eev-update-links")
 ;; A test: (find-eev-update-links)
+;; TODO: Check that this has been superseded by
+;;   (find-eev-install-links)
+;; and flag this as obsolete.
 
 (defun find-eev-update-links (&optional dir script &rest pos-spec-list)
 "Visit a temporary buffer with scripts for installing and updating eev."
@@ -1611,6 +1695,8 @@ echo     'http://angg.twu.net/eev-videos/{anggstem}.mp4' 
>> ~/.psne.log
 ;;; |_| |_|_| |_|\__,_|     |_|\__,_|\__\___/_/\_\    |_|_|_| |_|_|\_\___/
 ;;;                                                                       
 ;; �find-latex-links� (to ".find-latex-links")
+;; See:
+;;   (find-eev-quick-intro "7.5. `find-latex-links'")
 
 (defun find-latex-links (&optional stem &rest pos-spec-list)
 "Visit a temporary buffer containing a template for creating a LaTeX document."
@@ -1703,6 +1789,81 @@ dofile \"{fname0}\"
 
 
 
+;;;                                         _           _   
+;;;   ___  ___  ___ _ __ ___  ___ _ __  ___| |__   ___ | |_ 
+;;;  / _ \/ __|/ __| '__/ _ \/ _ \ '_ \/ __| '_ \ / _ \| __|
+;;; |  __/\__ \ (__| | |  __/  __/ | | \__ \ | | | (_) | |_ 
+;;;  \___||___/\___|_|  \___|\___|_| |_|___/_| |_|\___/ \__|
+;;;                                                         
+;; �find-escreenshot-links� (to ".find-escreenshot-links")
+;; Produce an ascii screenshot of an emacs window.
+;; To test this, copy a block of lines to the kill ring and do:
+;;
+;;   (setq ee-ss-width 80)
+;;   (find-escreenshot-links)
+;;
+;; Tests: (ee-ss-string-pad "" "_" " ")
+;;        (ee-ss-string-pad "foo")
+;;        (ee-ss-string-pad ee-ss-mode-line "-")
+;;        (ee-ss-string-pad "M-x foo" "_")
+;;        (find-estring (ee-ss-screenshot ";;  %s\n"))
+;;        (find-escreenshot0-links)
+;;        (find-escreenshot-links)
+;;
+(defun ee-untabify-string (string)
+  (with-temp-buffer
+    (insert string)
+    (untabify 0 (point-max))
+    (buffer-substring 0 (point-max))))
+
+(defvar ee-ss-strings '("foo" "bar") "A list of strings, for screenshots.")
+(defvar ee-ss-width 70 "The intended width of the screenshot.")
+(defvar ee-ss-mode-line "-:**-" "The mode line of the screenshot.")
+(defvar ee-ss-echo-area "" "The acho area or mode line of the screenshot.")
+(defvar ee-ss-linefmt ";; %s\n" "??")
+
+(defun ee-ss-string-pad (str &optional padchar barchar)
+  (setq barchar (or barchar "|"))
+  (let* ((padc   (if padchar (aref padchar 0) 32))
+         (padlen (- ee-ss-width (length str)))
+        (padstr (make-string padlen padc)))
+    (concat barchar str padstr barchar)))
+
+(defun ee-ss-screenshot0 ()
+  `(,(ee-ss-string-pad "" "_" " ")
+    ,@(mapcar 'ee-ss-string-pad ee-ss-strings)
+    ,(ee-ss-string-pad ee-ss-mode-line "-")
+    ,(ee-ss-string-pad ee-ss-echo-area "_")
+    ))
+
+(defun ee-ss-screenshot (linefmt)
+  (mapconcat (lambda (li) (format linefmt li))
+            (ee-ss-screenshot0) ""))
+
+(defun find-escreenshot0-links (&rest pos-spec-list)
+"Visit a temporary buffer containing hyperlinks for an ascii screenshot."
+  ;; (interactive)
+  (apply 'find-elinks
+   `((find-escreenshot0-links ,@pos-spec-list)
+     ;; Convention: the first sexp always regenerates the buffer.
+     (find-efunction 'find-escreenshot0-links)
+     (setq ee-ss-strings '(split-string (ee-last-kill) "\n"))
+     (setq ee-ss-width ,ee-ss-width)
+     (setq ee-ss-mode-line ,ee-ss-mode-line)
+     (setq ee-ss-echo-area ,ee-ss-echo-area)
+     (setq ee-ss-linefmt ,ee-ss-linefmt)
+     ""
+     ,(ee-ss-screenshot ee-ss-linefmt))
+   pos-spec-list))
+
+(defun find-escreenshot-links (&rest pos-spec-list)
+  (interactive)
+  (setq ee-ss-mode-line (format-mode-line mode-line-format 0))
+  (setq ee-ss-strings (split-string (ee-last-kill) "\n"))
+  (apply 'find-escreenshot0-links pos-spec-list))
+
+
+
 (provide 'eev-tlinks)
 
 
diff --git a/eev-wrap.el b/eev-wrap.el
index 78da0a9..c7a6fa2 100644
--- a/eev-wrap.el
+++ b/eev-wrap.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <address@hidden>
 ;; Maintainer: Eduardo Ochs <address@hidden>
-;; Version:    2019jan29
+;; Version:    2019feb09
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-wrap.el>
@@ -32,8 +32,15 @@
 
 ;;; Commentary:
 
-;; This module installs new key bindings into eev-mode-keymap, so:
-(require 'eev-mode)                    ; (find-eev "eev-mode.el")
+;; 2019: all the `define-key's in this file are now commented out.
+;; They were moved to:
+;; (find-eevfile "eev-mode.el" "eewrap-anchor")
+
+
+;; �.ee-template0�             (to "ee-template0")
+;; �.ee-S�                     (to "ee-S")
+;; �.ee-this-line-wrapn�       (to "ee-this-line-wrapn")
+
 
 
 (defvar ee-hyperlink-prefix "# "
@@ -45,44 +52,22 @@ The best way to change this variable interactively is by 
running
 
 
 
-;;;                  _                       _       _        ___  
-;;;   ___  ___      | |_ ___ _ __ ___  _ __ | | __ _| |_ ___ / _ \ 
-;;;  / _ \/ _ \_____| __/ _ \ '_ ` _ \| '_ \| |/ _` | __/ _ \ | | |
-;;; |  __/  __/_____| ||  __/ | | | | | |_) | | (_| | ||  __/ |_| |
-;;;  \___|\___|      \__\___|_| |_| |_| .__/|_|\__,_|\__\___|\___/ 
-;;;                                   |_|                          
-;;
-(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)))
-
-
 ;;;                 ____  
 ;;;   ___  ___     / ___| 
 ;;;  / _ \/ _ \____\___ \ 
 ;;; |  __/  __/_____|__) |
 ;;;  \___|\___|    |____/ 
 ;;;                       
-;; ee-S and ee-HS, for pretty-printing of sexps
-;; (mainly for use in ee-template0)
+;;; �ee-S� (to ".ee-S")
+;; ee-S and ee-HS, for pretty-printing of sexps (mainly for use in
+;; ee-template0).
+;; Tests:
+;;   (find-estring (ee-S  '(foo   "bar\nplic")))
+;;   (find-estring (ee-HS '(foo   "bar\nplic")))
+;;   (find-estring (ee-H  "Some string")
+;;         `(setq a ,(ee-add-quote "foo"))
+;;         `(setq a ,(ee-add-quote '(+ 1 2)))
+;;   (ee-S `(setq a ,(ee-add-quote '(+ 1 2))))
 ;;
 (defun ee-S (object)
   "Convert OBJECT (usually a sexp) into a string, for use in hyperlinks.
@@ -107,6 +92,47 @@ The name of this function comes from the \"S\" in `(format 
\"%S\" <obj>)'."
 
 
 
+;;;                  _                       _       _        ___  
+;;;   ___  ___      | |_ ___ _ __ ___  _ __ | | __ _| |_ ___ / _ \ 
+;;;  / _ \/ _ \_____| __/ _ \ '_ ` _ \| '_ \| |/ _` | __/ _ \ | | |
+;;; |  __/  __/_____| ||  __/ | | | | | |_) | | (_| | ||  __/ |_| |
+;;;  \___|\___|      \__\___|_| |_| |_| .__/|_|\__,_|\__\___|\___/ 
+;;;                                   |_|                          
+;;
+;; �ee-template0� (to ".ee-template0")
+;; Tests:
+;;   (ee-template00 "a{(+ 2 3)}b")
+;;     -->  "a5b"
+;; 
+;;   (let ((hi "Here: ") (a 22) (b 33)) (ee-template00 "{hi}{a}+{b}={(+ a 
b)}"))
+;;       -->  "22 + 33 = 55"
+;;
+;;   (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)))
+
 
 
 ;;;  _   _     _           _ _            
@@ -115,6 +141,7 @@ The name of this function comes from the \"S\" in `(format 
\"%S\" <obj>)'."
 ;;; | |_| | | | \__ \_____| | | | | |  __/
 ;;;  \__|_| |_|_|___/     |_|_|_| |_|\___|
 ;;;                                       
+;; �ee-this-line-wrapn� (to ".ee-this-line-wrapn")
 ;; The main function in this block is `ee-this-line-wrapn' -
 ;; all the `eewrap-*' functions defined below call it.
 
@@ -162,8 +189,9 @@ have to run an \"undo\"."
 ;;; | |  | |_____/ ___ \ _  | (_| | | | | (__| | | | (_) | |   
 ;;; |_|  |_|    /_/   \_(_)  \__,_|_| |_|\___|_| |_|\___/|_|   
 ;;;                                                            
-;; See: (find-anchors-intro "Creating index/section anchor pairs")
-(define-key eev-mode-map "\M-A" 'eewrap-anchor)
+;; See: (find-eev-quick-intro "8.3. Creating index/section anchor pairs")
+;;      (find-anchors-intro "Creating index/section anchor pairs")
+;; (define-key eev-mode-map "\M-A" 'eewrap-anchor)
 
 (defun  eewrap-anchor () (interactive)
   (ee-this-line-wrapn 1 'ee-wrap-anchor))
@@ -187,7 +215,8 @@ have to run an \"undo\"."
 ;;; | |  | |_____| |_) |  |  __/\__ \ (__| |  | | |_) | |_  | |_) | |   < 
 ;;; |_|  |_|     |_.__(_)  \___||___/\___|_|  |_| .__/ \__| |_.__/|_|_|\_\
 ;;;                                             |_|                       
-(define-key eev-mode-map "\M-B" 'eewrap-escript-block)
+;;
+;; (define-key eev-mode-map "\M-B" 'eewrap-escript-block)
 
 (defun  eewrap-escript-block () (interactive)
   (ee-this-line-wrapn 2 'ee-wrap-escript-block))
@@ -217,7 +246,7 @@ have to run an \"undo\"."
 ;;; |_|  |_|      \____(_)  \___\___/ \__,_|\___|      \___|     \__,_|
 ;;;                                                                    
 ;; See: (find-code-c-d-intro)
-(define-key eev-mode-map "\M-C" 'eewrap-code-c-d)
+;; (define-key eev-mode-map "\M-C" 'eewrap-code-c-d)
 
 (defun  eewrap-code-c-d () (interactive)
   (ee-this-line-wrapn 2 'ee-wrap-code-c-d))
@@ -234,7 +263,7 @@ have to run an \"undo\"."
 ;;; | |  | |_____| |_| |_  | (_| |  __/ |_) | | (_| | | | |
 ;;; |_|  |_|     |____/(_)  \__,_|\___|_.__/|_|\__,_|_| |_|
 ;;;                                                        
-(define-key eev-mode-map "\M-D" 'eewrap-debian)
+;; (define-key eev-mode-map "\M-D" 'eewrap-debian)
 
 (defun  eewrap-debian () (interactive)
   (ee-this-line-wrapn 1 'ee-wrap-debian))
@@ -252,7 +281,7 @@ have to run an \"undo\"."
 ;;; |_|  |_|     |_|  (_) |_| |_|_|\___|
 ;;;                                     
 ;; See: (find-wrap-intro "<M-F>")
-(define-key eev-mode-map "\M-F" 'eewrap-find-fline)
+;; (define-key eev-mode-map "\M-F" 'eewrap-find-fline)
 
 (defun  eewrap-find-fline () (interactive)
   (ee-this-line-wrapn 1 'ee-wrap-find-fline))
@@ -271,7 +300,7 @@ have to run an \"undo\"."
 ;; See: (find-eev-quick-intro "7.1. eejump")
 ;;      (find-eev-quick-intro "7.1. eejump" "meta-uppercase-j")
 ;; Old: (find-eejump-intro "Producing `eejump-nnn's and `eejump-nnn*'s")
-(define-key eev-mode-map "\M-J" 'eewrap-eejump)
+;; (define-key eev-mode-map "\M-J" 'eewrap-eejump)
 
 (defun  eewrap-eejump () (interactive)
   (ee-this-line-wrapn 2 'ee-wrap-eejump))
@@ -299,7 +328,7 @@ have to run an \"undo\"."
 ;;; |_|  |_|     |_|  |_(_) |_| |_| |_|\__,_|_| |_|
 ;;;                                                
 ;; See: (find-wrap-intro "<M-M>")
-(define-key eev-mode-map "\M-M" 'eewrap-man)
+;; (define-key eev-mode-map "\M-M" 'eewrap-man)
 
 (defun  eewrap-man () (interactive)
   (ee-this-line-wrapn 1 'ee-wrap-man))
@@ -316,7 +345,7 @@ have to run an \"undo\"."
 ;;; |_|  |_|     |_|   (_) | .__/ \__,_|_| |_|_|_|\_\___|
 ;;;                        |_|                           
 ;; See: (find-pdf-like-intro)
-(define-key eev-mode-map "\M-P" 'eewrap-pdflike)
+;; (define-key eev-mode-map "\M-P" 'eewrap-pdflike)
 
 (defun  eewrap-pdflike () (interactive)
   (ee-this-line-wrapn 2 'ee-wrap-pdflike))
@@ -363,7 +392,7 @@ have to run an \"undo\"."
 ;;; | |  | |_____|  _ < _  | |  | | | | | |/ /| | | | | |   < (_| | | |   
 ;;; |_|  |_|     |_| \_(_) |_|  |_| |_| |_/_/ |_| |_| |_|_|\_\__,_|_|_|   
 ;;;                                                                       
-(define-key eev-mode-map "\M-R" 'eewrap-rm/mkdir/cd)
+;; (define-key eev-mode-map "\M-R" 'eewrap-rm/mkdir/cd)
 
 (defun  eewrap-rm/mkdir/cd () (interactive)
   (ee-this-line-wrapn 1 'ee-wrap-rm/mkdir/cd))
@@ -383,7 +412,7 @@ cd     {dir}"))
 ;;; |_|  |_|    |____(_) |_| |_|_| |_|\__,_|     |___/_| |_|
 ;;;                                                         
 ;; See: (find-wrap-intro "<M-S>")
-(define-key eev-mode-map "\M-S" 'eewrap-sh)
+;; (define-key eev-mode-map "\M-S" 'eewrap-sh)
 
 (defun  eewrap-sh () (interactive)
   (ee-this-line-wrapn 1 'ee-wrap-sh))
@@ -416,7 +445,7 @@ cd     {dir}"))
 ;;; |_|  |_|      \_/ (_)  \__,_|\__,_|\__,_|_|\___/ \_/ |_|\__,_|\___|\___/ 
 ;;;                                                                          
 ;; See: (find-audiovideo-intro)
-(define-key eev-mode-map "\M-V" 'eewrap-audiovideo)
+;; (define-key eev-mode-map "\M-V" 'eewrap-audiovideo)
 
 (defun  eewrap-audiovideo () (interactive)
   (ee-this-line-wrapn 2 'ee-wrap-audiovideo))
@@ -424,16 +453,6 @@ cd     {dir}"))
   "An internal function used by `eewrap-audiovideo'."
   (ee-template0 "\
 ;; (find-fline {(ee-S (file-name-directory fname))})
-\(code-audio \"{stem}\" \"{fname}\")
-\(code-video \"{stem}\" \"{fname}\")
-;; \(find-{stem})
-"))
-
-;; 2013nov15:
-(defun ee-wrap-audiovideo (stem fname)
-  "An internal function used by `eewrap-audiovideo'."
-  (ee-template0 "\
-;; (find-fline {(ee-S (file-name-directory fname))})
 ;; (find-audio \"{fname}\")
 ;; (find-video \"{fname}\")
 \(code-audio \"{stem}\" \"{fname}\")
@@ -452,7 +471,7 @@ cd     {dir}"))
 ;;; | |  | |_____/ /_ _  |  _| | | | | (_| |_____/ /\__ \ | | |
 ;;; |_|  |_|    /____(_) |_| |_|_| |_|\__,_|    /___|___/_| |_|
 ;;;                                                            
-(define-key eev-mode-map "\M-Z" 'eewrap-zsh)
+;; (define-key eev-mode-map "\M-Z" 'eewrap-zsh)
 
 (defun  eewrap-zsh () (interactive)
   (ee-this-line-wrapn 1 'ee-wrap-zsh))
@@ -471,7 +490,7 @@ cd     {dir}"))
 ;; See: (find-multiwindow-intro "Several eepitch targets")
 ;; (find-eewrap-links "#" "two-eepitches" "b c")
 ;; M-#: two-eepitches
-(define-key eev-mode-map "\M-#" 'eewrap-two-eepitches)
+;; (define-key eev-mode-map "\M-#" 'eewrap-two-eepitches)
 
 (defun  eewrap-two-eepitches () (interactive)
   (ee-this-line-wrapn 2 'ee-wrap-two-eepitches))
@@ -561,6 +580,5 @@ cd     {dir}"))
 
 ;; Local Variables:
 ;; coding:            raw-text-unix
-;; ee-anchor-format:  "defun  %s "
 ;; no-byte-compile:   t
 ;; End:



reply via email to

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