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

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

[elpa] externals/eev 89d6093 1/2: New file: eev-compose-hash.el.


From: ELPA Syncer
Subject: [elpa] externals/eev 89d6093 1/2: New file: eev-compose-hash.el.
Date: Mon, 7 Jun 2021 03:57:11 -0400 (EDT)

branch: externals/eev
commit 89d609307161361699af52c4f59964e8e4af7097
Author: Eduardo Ochs <eduardoochs@gmail.com>
Commit: Eduardo Ochs <eduardoochs@gmail.com>

    New file: eev-compose-hash.el.
---
 ChangeLog           |   7 +
 VERSION             |   4 +-
 eepitch.el          |   2 +
 eev-blinks.el       |  34 +++-
 eev-compose-hash.el | 500 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 eev-intro.el        |  59 +++++--
 eev-template0.el    |   9 +-
 7 files changed, 592 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3d42334..c9c2124 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-06-07  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-compose-hash.el: new file.
+
+       * eev-blinks.el (ee-hashtable-to-string, find-ehashtable): new
+       functions.
+
 2021-05-28  Eduardo Ochs  <eduardoochs@gmail.com>
 
        * eev-pdflike.el (find-pdf-page): make it an alias to
diff --git a/VERSION b/VERSION
index 0bdc9ca..0bed689 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Sat May 29 04:31:39 GMT 2021
-Sat May 29 01:31:39 -03 2021
+Mon Jun  7 07:32:41 GMT 2021
+Mon Jun  7 04:32:42 -03 2021
diff --git a/eepitch.el b/eepitch.el
index 56311c1..f7ca025 100644
--- a/eepitch.el
+++ b/eepitch.el
@@ -249,6 +249,8 @@ This function is used by `eepitch-this-line'."
 ;;
 ;; «eepitch»  (to ".eepitch")
 ;; See: (find-eepitch-intro "2.3. `(eepitch)'")
+;; See this for a way to use red bullets insted of red stars:
+;; https://lists.gnu.org/archive/html/help-gnu-emacs/2021-05/msg01080.html
 
 (defvar eepitch-regexp "^\\(.*\\)"
 "The regexp used by `eepitch-this-line' to determine what is a red-star line.
diff --git a/eev-blinks.el b/eev-blinks.el
index 4a2b803..e69252d 100644
--- a/eev-blinks.el
+++ b/eev-blinks.el
@@ -21,7 +21,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20210516
+;; Version:    20210607
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-blinks.el>
@@ -52,6 +52,7 @@
 ;; «.find-ebuffer»             (to "find-ebuffer")
 ;; «.find-eoutput»             (to "find-eoutput")
 ;; «.find-estring»             (to "find-estring")
+;; «.find-ehashtable»          (to "find-ehashtable")
 ;; «.find-sh»                  (to "find-sh")
 ;; «.find-man»                 (to "find-man")
 ;; «.find-man-bug»             (to "find-man-bug")
@@ -588,6 +589,37 @@ The \"Local variables:\" section in the buffer is 
processed."
 
 
 
+;;;  _               _       _        _     _           
+;;; | |__   __ _ ___| |__   | |_ __ _| |__ | | ___  ___ 
+;;; | '_ \ / _` / __| '_ \  | __/ _` | '_ \| |/ _ \/ __|
+;;; | | | | (_| \__ \ | | | | || (_| | |_) | |  __/\__ \
+;;; |_| |_|\__,_|___/_| |_|  \__\__,_|_.__/|_|\___||___/
+;;;                                                     
+;; «find-ehashtable»  (to ".find-ehashtable")
+
+(defun ee-hashtable-to-string (f hashtable)
+  "Apply F to each key-value pair of HASHTABLE, and return a big string.
+The function F should be a function that expects three arguments
+- the key, the value, and the hashtable - and returns either a
+line terminated by a newline or an empty string. The lines
+returned by F are collected in a list, then sorted, and then the
+duplicates are removed; the result after that is concatenated
+into a big string, and returned. The key-value pairs for which F
+returned an empty string disappear in the concatenation.
+
+If F is nil then use a default function.
+
+I often refer to strings that may have, and usually do have,
+newlines, as \"big strings\". This is a bit childish, I know..."
+  (setq f (or f (lambda (k v h) (format "%S -> %S\n" k v))))
+  (let ((lines (cl-loop for k being the hash-keys of hashtable
+                       collect (funcall f k (gethash k hashtable) hashtable))))
+    (apply 'concat (seq-uniq (sort lines 'string<)))))
+
+(defun find-ehashtable (hashtable &rest pos-spec-list)
+  (apply 'find-estring (ee-hashtable-to-string nil hashtable) pos-spec-list))
+
+
 
 
 
diff --git a/eev-compose-hash.el b/eev-compose-hash.el
new file mode 100644
index 0000000..1407863
--- /dev/null
+++ b/eev-compose-hash.el
@@ -0,0 +1,500 @@
+;;; eev-compose-hash.el --- `M-,' as a compose key (version with hash tables)
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+;;
+;; This file is part of GNU eev.
+;;
+;; GNU eev is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; GNU eev is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+;;
+;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
+;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
+;; Version:    20210607
+;; Keywords:   e-scripts
+;;
+;; Latest version: <http://angg.twu.net/eev-current/eev-compose-hash.el>
+;;       htmlized: <http://angg.twu.net/eev-current/eev-compose-hash.el.html>
+;;       See also: <http://angg.twu.net/eev-current/eev-readme.el.html>
+;;                 <http://angg.twu.net/eev-intros/find-eev-intro.html>
+;;                 <http://angg.twu.net/eev-intros/find-here-links-intro.html>
+;;                                                (find-eev-intro)
+;;                                                (find-here-links-intro)
+
+;; «.ee-composes-do»   (to "ee-composes-do")
+;; «.to-strings»       (to "to-strings")
+;; «.compose»          (to "compose")
+;; «.faces»            (to "faces")
+;; «.bigstr-specs»     (to "bigstr-specs")
+
+;;; Commentary:
+
+;; This is a new, experimental feature that is not loaded by default.
+;; I use LaTeX a lot, and Emacs has several ways to insert non-ascii
+;; characters - like these ones:
+;;
+;;   Greek letters: (find-einsert '((900 1000)))
+;;   Some mathematical characters: (find-einsert '((8592 9000)))
+;;
+;; See:
+;;
+;;   (find-equailfile "latin-ltx.el")
+;;   (find-equailfile "sgml-input.el")
+;;   (find-enode "Inserting Text" "C-x 8 <RET> left single")
+;;   (find-enode "International Chars" "C-x 8")
+;;   (find-enode "Input Methods")
+;;
+;; I needed something that was easier to understand and easier to
+;; extend - in the sense of: adding new characters - than these
+;; standard methods, and that would let me use one face for the
+;; uppercase greek characters, another for lowercase greek, another
+;; for the standard mathematical chars, and so on... so in the late
+;; 90s I devised a very simple hack in which `M-,' followed by two
+;; characters would "compose" these two characters according to a
+;; conversion table, and I also had a very, very ugly hack that
+;; allowed me to specify this conversion table, AND THE FACES, in a
+;; somewhat human-friendly format, as lists of big strings and face
+;; names... That implementation used alists for the conversion tables,
+;; and was very hard to maintain.
+;;
+;; The implemention in this file is much simpler - because is uses
+;; hash tables for the conversion tables, and uses a big regexp built
+;; with `rx' to specify how to parse the human-readable conversion
+;; tables given in big strings... and also, as a bonus, it lets me
+;; specify how the special characters are to defined in LaTeX, both
+;; with `\catcode' and with `\DeclareUnicodeCharacter'.
+;;
+;; I decided to include this in eev because it MAY be useful in my
+;; next workshops on LaTeX (+ Emacs + eev): people can learn this,
+;; including how to extend it, in a few minutes, and then learn the
+;; standard input methods later - in more than a few minutes.
+;;
+;; This is very-new-ish code. Everything may change - ESPECIALLY the
+;; terminology and the names of the variables and functions. I am
+;; currently using these terms:
+;;
+;;   a "keys" mean "a pair of easy-to-type characters" (that have an
+;;     unicode character associated to them,
+;;
+;;   a "pos" means this unicode character,
+;;
+;;   "composes" means "all the data structures that show how each
+;;      "keys" is converted to a "pos", how each "pos" is converted to
+;;      latex code, which face is associated to each pos, etc, etc,
+;;
+;;   a "big string", or a "bigstr", is a string that may contain, and
+;;     usually contains, newlines,
+;;
+;;   a "bigstr spec" is a big string that specifies how the "pos"s are
+;;     associates to "keys", to latex code, and to faces.
+
+;;
+;; Usage:
+;;   (load "eev-compose-hash.el")
+;;   (ee-composes-do ee-composes-bigstr-accents)
+;;   (ee-composes-do ee-composes-bigstr-otheriso)
+;;   (ee-composes-do ee-composes-bigstr-math)
+;;   (define-key eev-mode-map (kbd "M-,") 'ee-compose-pair)
+
+
+
+
+;;;                                                          _       
+;;;   ___ ___  _ __ ___  _ __   ___  ___  ___  ___        __| | ___  
+;;;  / __/ _ \| '_ ` _ \| '_ \ / _ \/ __|/ _ \/ __|_____ / _` |/ _ \ 
+;;; | (_| (_) | | | | | | |_) | (_) \__ \  __/\__ \_____| (_| | (_) |
+;;;  \___\___/|_| |_| |_| .__/ \___/|___/\___||___/      \__,_|\___/ 
+;;;                     |_|                                          
+;;
+;; «ee-composes-do»  (to ".ee-composes-do")
+;;
+(defun ee-composes-initialize ()
+  (setq ee-composes-keys-to-pos  (make-hash-table :test 'equal))
+  (setq ee-composes-pos-to-latex (make-hash-table :test 'equal))
+  (setq ee-composes-current-face nil))
+
+(ee-composes-initialize)
+
+;; The regexp that is used to parse bigstrspecs.
+;; The "4" stresses that it has 4 groups.
+;; See: (find-es "emacs" "while-string-match")
+;;      (find-es "emacs" "rx")
+;;
+(setq ee-composes-regexp4
+      (rx-let ((nonblank (not (any " \t\n"))))
+        (rx (or (and (group-n 1 nonblank) ; 1: pos
+                    " "
+                    (group-n 2 nonblank nonblank) ; 2: keys
+                    (optional
+                     " "
+                     (group-n 3 nonblank (zero-or-more nonblank))) ; 3: latex
+                    )
+               (and "face: " (group-n 4 (one-or-more nonblank))) ; 4: face
+               (and ";; " (zero-or-more (not "\n")))             ; comment
+               ))))
+
+(defun ee-composes-do (bigstrspec &optional action)
+  "Parse BIGSTRSPEC and eval ACTION for each parseable part.
+The default ACTION is (ee-composes-do-default)."
+  (setq action (or action '(ee-composes-do-default)))
+  (let ((bigstrspecpos 0))
+    (while (string-match ee-composes-regexp4 bigstrspec bigstrspecpos)
+      (let ((pos   (match-string 1 bigstrspec))
+            (keys  (match-string 2 bigstrspec))
+            (latex (match-string 3 bigstrspec))
+            (face  (match-string 4 bigstrspec)))
+       (eval action)
+       (setq bigstrspecpos (match-end 0))))))
+
+(defun ee-composes-do-default ()
+  "This is the default action for `ee-composes-do'."
+  (if pos   (puthash keys pos  ee-composes-keys-to-pos))
+  (if pos   (eepitch-set-glyph0 (aref pos 0) (aref pos 0) 
ee-composes-current-face))
+  (if latex (puthash pos latex ee-composes-pos-to-latex))
+  (if face  (setq ee-composes-current-face (read face)))
+  )
+
+(defun ee-composes-do-test ()
+  "An alternative action for `ee-composes-do', for tests."
+  (insert (format "\n;; %S %S %S / %S" pos keys latex face)))
+
+;; Low-level tests:
+;; (load "eev-compose-hash.el")
+;; (ee-composes-initialize)
+;; (ee-composes-do "á 'a   é 'e   é !e EE")
+;; (ee-composes-do "á 'a   é 'e   é !e EE" '(ee-composes-do-test))
+;; (let ((pos "á") (keys "'a") (face nil) (latex "aacu")) 
(ee-composes-do-default))
+;; (let ((pos "á") (keys "'a") (face nil) (latex "aacu")) 
(ee-composes-do-test))
+;; (find-estring (ee-composes-to-string))
+
+
+
+;;;  _              _        _                 
+;;; | |_ ___    ___| |_ _ __(_)_ __   __ _ ___ 
+;;; | __/ _ \  / __| __| '__| | '_ \ / _` / __|
+;;; | || (_) | \__ \ |_| |  | | | | | (_| \__ \
+;;;  \__\___/  |___/\__|_|  |_|_| |_|\__, |___/
+;;;                                  |___/     
+;;
+;; «to-strings»  (to ".to-strings")
+;; Functions to convert the hash tables to
+;; several human-readable formats.
+;;
+;; Tests: (find-ehashtable ee-composes-pos-to-latex)
+;;        (find-ehashtable ee-composes-keys-to-pos)
+;;        (find-estring (ee-composes-to-string))
+;;        (find-estring (ee-composes-to-catcodes))
+;;        (find-estring (ee-composes-to-declareunicodes))
+;;
+(defun ee-composes-to-string ()
+  (ee-hashtable-to-string
+   (lambda (keys pos ht-keys-to-pos)
+     (let ((latex (gethash pos ee-composes-pos-to-latex)))
+       (format "%s %s %s\n" pos keys (or latex ""))))
+   ee-composes-keys-to-pos))
+
+(defun ee-composes-to-catcodes ()
+  (ee-hashtable-to-string
+   (lambda (pos latex ht-pos-to-latex)
+     (format "\\catcode`%s=13 \\def%s{%s}\n" pos pos latex))
+   ee-composes-pos-to-latex))
+
+(defun ee-composes-to-declareunicodes ()
+  (ee-hashtable-to-string
+   (lambda (pos latex ht-pos-to-latex)
+     (let* ((nnnn (format "%04X" (aref pos 0)))
+           (decl (format "\\DeclareUnicodeCharacter{%s}{%s}" nnnn latex))
+           (line (format "%-50s %% %s\n" decl pos)))
+       line))
+   ee-composes-pos-to-latex))
+
+
+
+;;;                                           
+;;;   ___ ___  _ __ ___  _ __   ___  ___  ___ 
+;;;  / __/ _ \| '_ ` _ \| '_ \ / _ \/ __|/ _ \
+;;; | (_| (_) | | | | | | |_) | (_) \__ \  __/
+;;;  \___\___/|_| |_| |_| .__/ \___/|___/\___|
+;;;                     |_|                   
+;;
+;; «compose»  (to ".compose")
+
+(defun ee-compose-pair (&optional arg)
+  "Read two keys and insert the result of their \"composition\".
+Use `ee-composes-keys-to-pos' to determine the composite char.
+When ARG is 0 show the current composes in a temporary buffer
+instead of inserting."
+  (interactive "P")
+  (if (eq arg 0)
+      (find-estring
+       (concat "  See: (find-eev \"eev-compose-hash.el\")\n\n"
+              (ee-composes-to-string)))
+    (let* ((keys (format "%c%c"
+                        (read-event "Compose key 1: " t)
+                        (read-event "Compose key 2: " t)))
+          (pos (gethash keys ee-composes-keys-to-pos)))
+      (if (not pos)
+         (error "Pair %S not in `ee-composes-keys-to-pos'" keys))
+      ;;
+      ;; Should we insert N copies when ARG is N?
+      (insert pos))))
+
+;; Tests: (eek "RET M-, 8 8")
+;;        (eek "M-0 M-,")
+
+
+
+;;;   __                     
+;;;  / _| __ _  ___ ___  ___ 
+;;; | |_ / _` |/ __/ _ \/ __|
+;;; |  _| (_| | (_|  __/\__ \
+;;; |_|  \__,_|\___\___||___/
+;;;                          
+;; «faces»  (to ".faces")
+;; Adapted from:
+;; (find-anggfile "eev-current/eev-glyphs.el" "yellow-on-red")
+;; (find-angg "eev-current/eev-math-glyphs.el" "faces")
+
+;; Define several faces for glyphs in a few lines of code.
+;; This is too rigid, but whatever.
+;; (find-ecolors)
+;; (find-efaces)
+;; (find-efaces "ee-composes")
+;;
+(defun ee-composes-set-face (face fg bg)
+  (make-face face)
+  (set-face-foreground face fg)
+  (set-face-background face bg))
+
+(ee-composes-set-face 'ee-composes-face-Greek   "orange"        "gray20")
+(ee-composes-set-face 'ee-composes-face-greek   "coral"         "gray20")
+(ee-composes-set-face 'ee-composes-face-logical "SteelBlue1"    "gray20")
+(ee-composes-set-face 'ee-composes-face-math    "RoyalBlue2"    "gray20")
+(ee-composes-set-face 'ee-composes-face-linear  "PaleVioletRed" "gray20")
+(ee-composes-set-face 'ee-composes-face-graphic "red"           "gray20")
+(ee-composes-set-face 'ee-composes-face-font    "gold"          "DarkOrange4")
+(ee-composes-set-face 'ee-composes-face-yellow-on-red "yellow"  "red")
+
+
+
+;;;  _     _           _                                  
+;;; | |__ (_) __ _ ___| |_ _ __   ___ _ __   ___  ___ ___ 
+;;; | '_ \| |/ _` / __| __| '__| / __| '_ \ / _ \/ __/ __|
+;;; | |_) | | (_| \__ \ |_| |    \__ \ |_) |  __/ (__\__ \
+;;; |_.__/|_|\__, |___/\__|_|    |___/ .__/ \___|\___|___/
+;;;          |___/                   |_|                  
+;;
+;; «bigstr-specs»  (to ".bigstr-specs")
+;; These are the default bigstr specs.
+;; I uses setq instead of defvar because this is a hack!...
+
+(setq ee-composes-bigstr-accents "
+  face: nil
+  À `A    È `E   Ì `I    Ò `O    Ù `U 
+  à `a    è `e   ì `i    ò `o    ù `u 
+  Á 'A    É 'E   Í 'I    Ó 'O    Ú 'U 
+  á 'a    é 'e   í 'i    ó 'o    ú 'u 
+  Â ^A    Ê ^E   Î ^I    Ô ^O    Û ^U 
+  â ^a    ê ^e   î ^i    ô ^o    û ^u 
+  Ã ~A                   Õ ~O     
+  ã ~a                   õ ~o     
+  Ä \"A   Ë \"E  Ï \"I   Ö \"O   Ü \"U 
+  ä \"a   ë \"e  ï \"i   ö \"o   ü \"u 
+  Ç 'C    Ç CC   Ñ ~N              
+  ç 'c    ç cc   ñ ~n              
+")
+
+(setq ee-composes-bigstr-otheriso "
+  face: nil
+  ª _a
+  º _o
+  Æ AE
+  æ ae
+  ß ss
+
+  ¼ 14
+  ½ 12
+  ¾ 34
+
+  ¿ ??
+
+  ¡ !! \\text{\\textexclamdown}
+  § SS \\S
+
+  ° 00 ^\\circ
+
+  ± +- \\pm
+  ÷ :- \\div
+  · cd \\cdot
+  × xx \\times
+  ¬ nt \\neg
+
+  face: ee-composes-face-green
+  « <<
+  » >>
+
+  face: ee-composes-face-math
+  ² 22 ^2
+  ³ 33 ^3
+  ¹ -1 ^{-1}
+  ¹ 11  
+")
+
+
+(setq ee-composes-bigstr-math "
+  face: ee-composes-face-Greek
+  Γ GG \\Gamma
+  Δ DD \\Delta
+  Θ Th \\Theta
+  Λ La \\Lambda
+  Π Pi \\Pi
+  Σ Si \\Sigma
+  Φ Ph \\Phi
+  Ψ Ps \\Psi
+  Ω Om \\Omega
+
+  face: ee-composes-face-greek
+  α aa \\alpha
+  β bb \\beta
+  γ gg \\gamma
+  δ dd \\delta
+  ε ee \\epsilon
+  ζ ze \\zeta
+  η et \\eta
+  θ th \\theta
+  ι io \\iota
+  κ kk \\kappa
+  λ ll \\lambda
+  μ mu \\mu
+  ν nu \\nu
+  ξ xi \\xi
+  π pi \\pi
+  ρ ro \\rho
+  σ si \\sigma
+  τ ta \\tau
+  φ ph \\phi
+  χ ch \\chi
+  ψ ps \\psi
+  ω om \\omega
+  ϕ vp \\origphi
+
+  face: ee-composes-face-math
+  • bu \\bullet
+  … .. \\ldots
+  ℓ el \\ell
+  ⅋ && \\bindnasrepma
+  ← <- \\ot
+  ↑ up \\upto
+  → -> \\to
+  → to  
+  ↓ dn \\dnto
+  ↔ <> \\bij
+  ↕ ud \\updownarrow
+  ↖ NW \\nwarrow
+  ↗ NE \\nearrow
+  ↘ SE \\searrow
+  ↙ SW \\swarrow
+  ↣ ep \\epito
+  ↣ >t \\twoheadrightarrow
+  ↤ mo \\mapsfrom
+  ↦ mt \\mapsto
+  ⇀ hu \\rightharpoonup
+  ⇐ <= \\Leftarrow
+  ⇒ => \\funto
+  ⇔ LR \\Leftrightarrow
+  ∀ fa \\forall
+  ∂ Pa \\partial
+  ∃ ex \\exists
+  ∅ em \\emptyset
+  ∇ Na \\nabla
+  ∈ in \\in
+  ∖ sm \\backslash
+  ∘ oo \\circ
+  √ sq \\sqrt
+  ∞ 88 \\infty
+  ∧ la \\land
+  ∨ lo \\lor
+  ∩ ca \\cap
+  ∪ cu \\cup
+  ∫ In \\int
+  ∼ ~1 \\sim
+  ≃ -~ \\simeq
+  ≅ =~ \\cong
+  ≈ ~~ \\approx
+  ≠ != \\neq
+  ≡ == \\equiv
+  ≤ le \\le
+  ≥ ge \\ge
+  ⊂ su \\subset
+  ⊃ Su \\supset
+  ⊆ se \\subseteq
+  ⊇ Se \\supseteq
+  ⊓ qa \\sqcap
+  ⊔ qu \\sqcup
+  ⊕ o+ \\oplus
+  ⊖ o- \\ominus
+  ⊗ ox \\otimes
+  ⊘ o/ \\oslash
+  ⊙ o. \\odot
+  ⊢ |- \\vdash
+  ⊣ -| \\dashv
+  ⊤ TT \\top
+  ⊥ BO \\bot
+  ⊨ |= \\vDash
+  ⊸ -o  
+  ⋀ LA \\bigwedge
+  ⋁ LO \\bigvee
+  ⋂ CA \\bigcap
+  ⋃ CU \\bigcup
+  ⋄ po \\lozenge
+  ⋅ Do \\Box
+  〈 <1 \\langle
+  〉 1> \\rangle
+  ▁ __ \\_
+  □ Bo \\Box
+  ◻ Bo \\Box
+  ◻ nc
+  ♭ fl \\flat
+  ♮ na \\natural
+  ♯ sh \\sharp
+  ✀ li
+  ⟦ [[ \\llbracket
+  ⟧ ]] \\rrbracket
+  ⠆ :: {:}
+
+  face: ee-composes-face-yellow-on-red
+  𝐛 bf \\mathbf
+  𝐢 it \\textsl
+  𝐫 rm \\mathrm
+  𝐬 sf \\mathsf
+  𝐭 tx \\text
+")
+
+
+;; Test:
+;; (load "eev-compose-hash.el")
+;; (find-estring (ee-composes-to-string))
+;;   (ee-composes-do ee-composes-bigstr-accents)
+;;   (ee-composes-do ee-composes-bigstr-otheriso)
+;;   (ee-composes-do ee-composes-bigstr-math)
+;; (find-estring (ee-composes-to-string))
+;; (define-key eev-mode-map (kbd "M-,") 'ee-compose-pair)
+
+
+
+(provide 'eev-compose-hash)
+
+
+;; Local Variables:
+;; coding:            utf-8-unix
+;; no-byte-compile:   t
+;; End:
diff --git a/eev-intro.el b/eev-intro.el
index 8ab764a..58a274e 100644
--- a/eev-intro.el
+++ b/eev-intro.el
@@ -4053,7 +4053,7 @@ Javascript code, and \"following the link\" then means 
executing
 that code. Web browsers try to make it impossible to have
 hyperlinks or webpages that will send out your private
 information, or that will put your system in a unusable state.
-Security is web browsers is achieved by restricting what the
+Security in web browsers is achieved by restricting what the
 scripts in a page can do.
 
 Sexp hyperlinks, in contrast, can do essentially anything - and,
@@ -5148,8 +5148,8 @@ can be *roughly* described as:
   b) If the target buffer does not exist, create it - by
      running `(shell)'.
 
-  c) If the target buffer is not being display then display it -
-     by creating a two-window setting with the target buffer at
+  c) If the target buffer is not being displayed then display it
+     - by creating a two-window setting with the target buffer at
      the right.
 
 This is a simplification, though... the sexp
@@ -8710,12 +8710,20 @@ print(open(\"/tmp/o\").read())
 
 
 
+
 6. Non-trivial examples
 =======================
 See:
 
-  (find-prepared-intro \"An `ee' for Python\")
-  (find-rcirc-intro \"The server buffer and the channel buffers\")
+  (find-eev-quick-intro \"6.2. Other targets\")
+  (find-eev-quick-intro \"6.2. Other targets\" \"(find-3EE\")
+  (find-rcirc-intro \"1. The example that I use in workshops\")
+  (find-prepared-intro \"3. An `ee' for Python\")
+  (find-prepared-intro \"4. `eepy'\")
+
+The examples with `find-3EE' were created using `M-#', as
+explained in the next section.
+
 
 
 
@@ -8726,9 +8734,16 @@ of red star lines - `(eepitch-target1)', 
`(eepitch-target2)',
 `(find-3EE ...)', `(find-3ee ...)', etc. We don't want to have to
 type all those by hand, so there is a hack similar to `M-T' that
 generates all those kinds from just \"target1\" and \"target2\"
-to let us just copy around the sexps we need. It is bound to
-`meta-shift-3', which Emacs sees as `M-#'. Compare the result of
-typing `M-T' here,
+to let us just copy around the sexps we need.
+
+This key binding for this hack is `meta-shift-3' - that Emacs
+sees as `M-#' - but it is disabled by default. To enable it, do
+this:
+
+  ;; See: (find-eevfile \"eev-mode.el\" \"eewrap-two-eepitches\")
+  (define-key eev-mode-map \"\\M-#\" 'eewrap-two-eepitches)
+
+Now compare the result of typing `M-T' here,
 
 python
 
@@ -8743,8 +8758,11 @@ which yield this:
  (eepitch-shell)
  (eepitch-python)
 
-Note that we use to `find-3EE' to restart targets instead of
-`eepitch-kill' (this is non-trivial - think about it =/)...
+Remember that The line with `find-3EE' restart the two targets,
+and the line with `find-3ee' just recreates the window setting
+with the two targets but without restarting them; so the line
+with `find-3EE' sort of works as two `eepitch-kill's.
+
 
 
 
@@ -9052,7 +9070,7 @@ your .emacs:
 
 
 5. `find-libera-links'
-========================
+======================
 You can generate lines like the ones above by running
 `find-libera-links'. For example:
 
@@ -9466,7 +9484,7 @@ advanced (i.e., hackish) feature explained here:
  (eepitch-python)
 import os
 def ee():
-  execfile(os.getenv(\"HOME\")+\"/.eev/ee.py\", globals())
+  exec(open(os.getenv(\"HOME\")+\"/.eev/ee.py\").read(), globals())
 
  (eepitch-shell)
 cat > ~/.eev/ee.py <<'%%%'
@@ -9481,7 +9499,7 @@ cat > ~/.eev/ee.py <<'%%%'
 def foo (x):
     return x*x
 
-print foo(5)
+print(foo(5))
 %%%
 
  (eepitch-python)
@@ -9505,7 +9523,7 @@ A call to
 writes \"print(1+2)\" (with an added trailing newline, but that's
 a technical detail) into the \"alternative file\"
 \"~/.eev/ee.py\" - the default would be \"~/.eev/ee.sh\". We can
-that to simplify our demo a bit:
+use that to simplify our demo a bit:
 
  (eek \"C-x 1\")
  (eepitch-python)
@@ -9513,11 +9531,11 @@ that to simplify our demo a bit:
  (eepitch-python)
 import os
 def ee():
-  execfile(os.getenv(\"HOME\")+\"/.eev/ee.py\", globals())
+  exec(open(os.getenv(\"HOME\")+\"/.eev/ee.py\").read(), globals())
 
  (eev \"print(1+2)\" nil \"~/.eev/ee.py\")
 ee()
- (eev \"def foo (x):\\n    return x*x\\n\\nprint foo(5)\" nil 
\"~/.eev/ee.py\")
+ (eev \"def foo (x):\\n    return x*x\\n\\nprint(foo(5))\" nil 
\"~/.eev/ee.py\")
 ee()
 print(foo(6))
 
@@ -9532,11 +9550,11 @@ print(foo(6))
  (eepitch-python)
 import os
 def ee():
-  execfile(os.getenv(\"HOME\")+\"/.eev/ee.py\", globals())
+  exec(open(os.getenv(\"HOME\")+\"/.eev/ee.py\").read(), globals())
 
  (eepy \"print(1+2)\")
 ee()
- (eepy \"def foo (x):\\n    return x*x\\n\\nprint foo(5)\")
+ (eepy \"def foo (x):\\n    return x*x\\n\\nprint(foo(5))\")
 ee()
 print(foo(6))
 
@@ -13197,7 +13215,10 @@ See:
 
 Try:
 
-  (setq y 2)
+                      (setq y 2)
+                            y
+  (let  ((y 1))             y)
+  (let  ( y   )             y)
   (let  ((y 1) (z y)) (list y z))
   (let* ((y 1) (z y)) (list y z))
 
diff --git a/eev-template0.el b/eev-template0.el
index 8d7a38f..77b8a7a 100644
--- a/eev-template0.el
+++ b/eev-template0.el
@@ -76,7 +76,13 @@
 ;; binding - it is common to have `{VAR}'s in the string referring to
 ;; names of arguments of a `defun's, or to names of variables defined
 ;; in an enclosing `let' block, or to names of global variables.
-
+;;
+;; Here are some messages in help-gnu-emacs about dynamic binding
+;; being deprecated:
+;;   https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00054.html
+;;   https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00085.html
+;;   https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00095.html
+;;   https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00096.html
 
 
 
@@ -89,6 +95,7 @@
 ;;   (find-eev-quick-intro "9.3. Hyperlinks to PDF files")
 
 
+
 (defvar ee-template00-re "{\\([^{}]+\\)}"
   "To make `ee-template0' use other delimiters instead of `{}'s
 set this variable temporarily in a `let'.")



reply via email to

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