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

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

[elpa] externals/eev 620f58f0e2 6/7: Trying to merge the branches.


From: ELPA Syncer
Subject: [elpa] externals/eev 620f58f0e2 6/7: Trying to merge the branches.
Date: Tue, 2 Jan 2024 12:57:48 -0500 (EST)

branch: externals/eev
commit 620f58f0e250dc92b111c93399d4c3e9a4415e9e
Merge: 79ae496a2e 17c1bcbdd9
Author: Eduardo Ochs <eduardoochs@gmail.com>
Commit: Eduardo Ochs <eduardoochs@gmail.com>

    Trying to merge the branches.
---
 ChangeLog      |  26 +++++-
 README         |  14 +--
 VERSION        |   4 +-
 eev-hlinks.el  |  91 ++++++++----------
 eev-htests.el  | 137 +++++++++++++++++++++++++++
 eev-intro.el   | 146 ++++++++++++++++++++++++++++-
 eev-kl-here.el | 288 ++++++++++++++++++++++++++++++++++++++++++---------------
 eev-kla.el     |  14 ++-
 eev-load.el    |   3 +-
 eev-tlinks.el  |  43 +++++++++
 10 files changed, 622 insertions(+), 144 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0826df98e7..b72ad1a59a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2023-12-28  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-kl-here.el: rewritten completely.
+
+       * eev-tlinks.el (find-linki-links): new function.
+
+       * eev-kla.el (ee-kl-line): new function.
+
+       * eev-htests.el: new file.
+       (find-tlhs, find-tlhi): new functions.
+
+2023-12-27  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-hlinks.el (ee-find-here-debug-links): rewritten.
+
+       * eev-intro.el (find-here-links-intro): rewrote the section "8.
+       Debugging"; wrote the sections "9. The hlang" and "9.1. A
+       historical note".
+
+       * eev-hlinks.el (ee-find-here-links0): renamed to
+       `ee-find-here-links-header'.
+
 2023-12-26  Eduardo Ochs  <eduardoochs@gmail.com>
 
        * eev-videolinks.el (ee-1stclassvideos-info): added an indication
@@ -5,7 +27,7 @@
 
 2023-12-25  Eduardo Ochs  <eduardoochs@gmail.com>
 
-       * eev-videolinks.el (ee-1stclassvideos-info): added an extry for
+       * eev-videolinks.el (ee-1stclassvideos-info): added an entry for
        "eev2023replsb".
        (find-eev2023replsbvideo): new function.
 
@@ -13,7 +35,7 @@
 
        * eev-kl-here.el: added a provide.
 
-       * eev-qrl.el:  added a provide.
+       * eev-qrl.el: added a provide.
 
        * eev-intro.el (find-templates-intro): rewrote the section "5.
        Debugging the meat".
diff --git a/README b/README
index 4fd9ef1709..35f5891ba7 100644
--- a/README
+++ b/README
@@ -10,19 +10,19 @@ To run the tutorial: install this package, then type `M-x
 eev-beginner'. This will load all the main modules, activate the
 eev-mode keybindings, and open this tutorial,
 
-  http://angg.twu.net/eev-intros/find-eev-quick-intro.html
+  http://anggtwu.net/eev-intros/find-eev-quick-intro.html
   (find-eev-quick-intro)
 
 in a sandboxed buffer. The URL aboves points to an HTMLized version of
 the sandboxed tutorial, and the `(find-*-intro)' sexp opens it in
 Emacs. You can find an index of the other sandboxed tutorials here:
 
-  http://angg.twu.net/eev-intros/find-eev-intro.html
+  http://anggtwu.net/eev-intros/find-eev-intro.html
   (find-eev-intro)
 
 The home page of eev is:
 
-  http://angg.twu.net/#eev
+  http://anggtwu.net/#eev
 
 
 
@@ -31,9 +31,9 @@ Autoloads
 Eev handles autoloads in a very atypical way, explained in these three
 places:
 
-  http://angg.twu.net/eev-current/eev-load.el.html#autoloads
-  http://angg.twu.net/eev-intros/find-eev-install-intro.html#7.3
-  http://angg.twu.net/eev-intros/find-eev-intro.html#4
+  http://anggtwu.net/eev-current/eev-load.el.html#autoloads
+  http://anggtwu.net/eev-intros/find-eev-install-intro.html#7.3
+  http://anggtwu.net/eev-intros/find-eev-intro.html#4
   (find-eev "eev-load.el" "autoloads")
   (find-eev-install-intro "7.3. Autoloads")
   (find-eev-intro "4. The prefix `find-'")
@@ -56,7 +56,7 @@ Eev mode
 Eev mode only activates some keybindings and adds a reminder saying
 "eev" to the mode line, as explained here:
 
-  http://angg.twu.net/eev-intros/find-eev-intro.html#1
+  http://anggtwu.net/eev-intros/find-eev-intro.html#1
   (find-eev-intro "1. `eev-mode'")
 
 It is possible to use eev's elisp hyperlink functions with eev-mode
diff --git a/VERSION b/VERSION
index 1b2719f58b..2dc27b8a16 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Tue Dec 26 04:13:57 GMT 2023
-Tue Dec 26 01:13:57 -03 2023
+Thu Dec 28 07:18:37 GMT 2023
+Thu Dec 28 04:18:37 -03 2023
diff --git a/eev-hlinks.el b/eev-hlinks.el
index 578934ddae..9e4e844258 100644
--- a/eev-hlinks.el
+++ b/eev-hlinks.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20230127
+;; Version:    20231227
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-hlinks.el>
@@ -64,35 +64,8 @@
 ;;
 ;; Debug mode
 ;; ==========
-;; The best way to understand how this works is to run
-;; `find-here-links' with a prefix argument. When we run
-;; `find-here-links' _without_ a prefix argument it displays a header
-;; and then the links to "here"; _with_ a prefix argument it displays
-;; the header and then a lot of internal information about "here". For
-;; example, if you run
-;;
-;;   (eek "M-h M-h  ;; find-here-links")
-;;
-;; then "here" is a file, and `find-here-links' displays a header and
-;; then the result of:
-;;
-;;   (ee-find-file-links)
-;;
-;; If you run, say,
-;;
-;;   (eek "M-0 M-h M-h  ;; M-0 find-here-links")
-;;
-;; then `find-here-links' will detect which kind of "here" is "here",
-;; and will display the header and then the result of
-;; `(ee-find-here-debug-links)'. Most of that will be static text, but
-;; that output will also contain lines like these ones,
-;;
-;;   (find-efunction 'ee-file-bufferp)
-;;   (find-efunction 'ee-find-file-links)
-;;
-;; that display information about the results that were generated and
-;; saved in the last time that the function `ee-detect-here' was
-;; called.
+;; See:
+;;   (find-here-links-intro "8. Debugging")
 
 
 ;; TODO
@@ -159,12 +132,12 @@ See: (find-here-links-intro)"
      `(;; The first line of a find-here-links buffer DOES NOT
        ;; regenerates the buffer - instead the first lines point to
        ;; help pages.
-       ,@(ee-find-here-links0)
-       ,@(ee-find-here-links arg)
+       ,@(ee-find-here-links-header)
+       ,@(ee-find-here-links arg)      ; note the arg
        )
      pos-spec-list)))
 
-(defun ee-find-here-links0 ()
+(defun ee-find-here-links-header ()
   "The header used by `find-here-links'."
   `(,(ee-H "See: ")
     (find-eev-quick-intro "4.1. `find-here-links'")
@@ -173,6 +146,8 @@ See: (find-here-links-intro)"
     ))
 
 ;; «ee-find-here-links»  (to ".ee-find-here-links")
+;; Tests: (find-elinks (ee-find-here-links))
+;;        (find-elinks (ee-find-here-links 'debug))
 ;;
 (defun ee-find-here-links (&optional arg)
   "Generate the non-header part of the \"*(find-here-links)*\" buffer.
@@ -207,30 +182,33 @@ which kind \"here\" the current buffer is."
     (cons "" (eval ee-hlang-sexp2))))
 
 ;; «ee-find-here-debug-links»  (to ".ee-find-here-debug-links")
-;; See: (find-eevfile "eev-hlinks.el" "Debug mode")
-;;      (find-eev     "eev-hlinks.el" "find-here-links" "If ARG")
+;; See: (find-here-links-intro "8. Debugging")
+;;      (find-eev "eev-hlinks.el" "find-here-links" "If ARG")
 ;;
 (defun ee-find-here-debug-links ()
-  `("# The last call to"
-    "#     '(find-here-links ARG)"
-    "#  -> '(ee-detect-here)"
-    "#  -> '(ee-hlang-run ee-hprog-find-here-links)"
-    "# produced this:"
-    ,(format "#   ee-hlang-sexp1  =>  %s" (ee-S ee-hlang-sexp1))
-    ,(format "#   ee-hlang-sexp2  =>  %s" (ee-S ee-hlang-sexp2))
-    "# See:"
-    "#   ee-hlang-sexp1"
-    "#   ee-hlang-sexp2"
-    ,(format "#   (find-efunction '%s)" (car ee-hlang-sexp1))
-    ,(format "#   (find-efunction '%s)" (car ee-hlang-sexp2))
-    "#   (find-eev \"eev-hlinks.el\" \"find-here-links\")"
-    "#   (find-eev \"eev-hlinks.el\" \"find-here-links\" \"If ARG\")"
-    "#   (find-eev \"eev-hlinks.el\" \"ee-find-here-links\")"
-    "#   (find-eev \"eev-hlinks.el\" \"ee-find-here-debug-links\")"
-    "#   (find-eev \"eev-hlinks.el\" \"ee-hlang-run\")"
-    "#   (find-eev \"eev-hlinks.el\" \"ee-hlang-run\" \"ee-detect-here\")"
-    "#   (find-eev \"eev-hlinks.el\" \"ee-hprog-find-here-links\")"
-    ))
+  (list (ee-template0 "\
+# (find-here-links-intro \"8. Debugging\")
+
+# The last call to
+#     '(find-here-links ARG)
+#  -> '(ee-detect-here)
+#  -> '(ee-hlang-run ee-hprog-find-here-links)
+# produced this:
+#   ee-hlang-sexp1  =>  {(ee-S ee-hlang-sexp1)}
+#   ee-hlang-sexp2  =>  {(ee-S ee-hlang-sexp2)}
+# See:
+#   ee-hlang-sexp1
+#   ee-hlang-sexp2
+#   (find-efunction '{(car ee-hlang-sexp1)})
+#   (find-efunction '{(car ee-hlang-sexp2)})
+#   (find-eev \"eev-hlinks.el\" \"find-here-links\")
+#   (find-eev \"eev-hlinks.el\" \"find-here-links\" \"If ARG\")
+#   (find-eev \"eev-hlinks.el\" \"ee-find-here-links\")
+#   (find-eev \"eev-hlinks.el\" \"ee-find-here-debug-links\")
+#   (find-eev \"eev-hlinks.el\" \"ee-hlang-run\")
+#   (find-eev \"eev-hlinks.el\" \"ee-hlang-run\" \"ee-detect-here\")
+#   (find-eev \"eev-hlinks.el\" \"ee-hprog-find-here-links\")")))
+
 
 
 ;; 2023jan16: removed all the functions and variables with "fhl" in
@@ -336,6 +314,9 @@ which kind \"here\" the current buffer is."
 ;; (ee-hlang-eval  '(:if (> 1 2) (list 'gt)))
 ;; (ee-hlang-eval  '(:or (:if (< 1 2) (list 'lt)) (:if (> 1 2) (list 'gt))))
 ;; (ee-hlang-eval  '(:or (:if (> 1 2) (list 'gt)) (:if (< 1 2) (list 'lt))))
+;;
+;; For better tests, with explanations, see:
+;;   (find-here-links-intro "9. The hlang")
 
 ;; The Three Variables.
 (defvar ee-hlang-sexp1-result nil "See `ee-hlang-:if'.")
diff --git a/eev-htests.el b/eev-htests.el
new file mode 100644
index 0000000000..8ee1794891
--- /dev/null
+++ b/eev-htests.el
@@ -0,0 +1,137 @@
+;;; eev-htests.el -- Tests for eev-hlinks.el.  -*- lexical-binding: nil; -*-
+
+;; Copyright (C) 2022-2023 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:    20231228
+;; Keywords:   e-scripts
+;;
+;; Latest version: <http://anggtwu.net/eev-current/eev-htests.el>
+;;       htmlized: <http://anggtwu.net/eev-current/eev-htests.el.html>
+;;       See also: <http://anggtwu.net/eev-current/eev-beginner.el.html>
+;;                 <http://anggtwu.net/eev-intros/find-kla-intro.html>
+;;                                               (find-kla-intro)
+
+;;; Comment:
+
+;; This file implements a way to test each case of `find-here-links'.
+;; See:
+;;   (find-eev "eev-hlinks.el" "hprog")
+
+;; «.find-tlh»         (to "find-tlh")
+;; «.tests»            (to "tests")
+
+
+
+;;;   __ _           _       _   _ _     
+;;;  / _(_)_ __   __| |     | |_| | |__  
+;;; | |_| | '_ \ / _` |_____| __| | '_ \ 
+;;; |  _| | | | | (_| |_____| |_| | | | |
+;;; |_| |_|_| |_|\__,_|      \__|_|_| |_|
+;;;                                      
+;; «find-tlh»  (to ".find-tlh")
+;; In this block we define two functions, `find-tlhs' and `find-tlhi',
+;; that test functions that generate links to here. See:
+;;
+;;   (find-eaproposf "ee-find.*links")
+;;   (find-eaproposf "ee-find.*linki")
+;;   (find-eaproposf "ee-find.*link[si]")
+
+(defun find-tlhs (sexp1 sexp2)
+  "Test (a function that generates) links to here.
+This function generates a 3-window setting like this,
+   ___________
+  |     |     |
+  |     |  B  |
+  |  A  |_____|
+  |     |     |
+  |     |  C  |
+  |_____|_____|
+
+in which A is the current buffer, B is the buffer obtained by
+running SEXP1 in the buffer A, and C is the result of running
+(find-elinks SEXP2) in the buffer B."
+  (find-wset "13o_2o_o" sexp1 `(find-elinks ,sexp2)))
+
+(defun find-tlhi (sexp1 sexp2)
+  "Test (a function that generates a single) link to here.
+This function generates a 3-window setting like this,
+   ___________
+  |     |     |
+  |     |  B  |
+  |  A  |_____|
+  |     |     |
+  |     |  C  |
+  |_____|_____|
+
+in which A is the current buffer, B is the buffer obtained by
+running SEXP1 in the buffer A, and C is the result of running
+(find-epp SEXP2) in the buffer B."
+  (find-wset "13o_2o_o" sexp1 `(find-epp ,sexp2)))
+
+
+
+;;;  _____         _       
+;;; |_   _|__  ___| |_ ___ 
+;;;   | |/ _ \/ __| __/ __|
+;;;   | |  __/\__ \ |_\__ \
+;;;   |_|\___||___/\__|___/
+;;;                        
+;; «tests»  (to ".tests")
+;; See:
+;;   (find-eev "eev-hlinks.el"  "hprog")
+;;   (find-eev "eev-kl-here.el" "hprog")
+;; Tests:
+;;   (find-tlhs '(find-enode "Lisp Eval")   '(ee-find-info-links))
+;;   (find-tlhi '(find-enode "Lisp Eval")   '(ee-find-info-linki))
+;;   (find-tlhs '(find-node "(rcirc)Index") '(ee-find-info-links))
+;;   (find-tlhi '(find-node "(rcirc)Index") '(ee-find-info-linki))
+;;   (find-tlhs '(find-eev-quick-intro)     '(ee-find-intro-links))
+;;   (find-tlhi '(find-eev-quick-intro)     '(ee-find-intro-linki))
+;;   (find-tlhs '(find-man "1 cat")         '(ee-find-man-links))
+;;   (find-tlhi '(find-man "1 cat")         '(ee-find-man-linki))
+;;   (find-tlhs '(find-epackages 'abs-mode) '(ee-find-epackages-links))
+;;   (find-tlhi '(find-epackages 'abs-mode) '(ee-find-epackages-linki))
+;;   (find-tlhs '(find-customizegroup 'editing) '(ee-find-custom-links))
+;;   (find-tlhi '(find-customizegroup 'editing) '(ee-find-custom-linki))
+;;   (find-tlhs '(find-customizeface 'bold)     '(ee-find-custom-f-links))
+;;   (find-tlhi '(find-customizeface 'bold)     '(ee-find-custom-f-linki))
+;;   (find-tlhs '(find-customizevariable 'goal-column) 
'(ee-find-custom-v-links))
+;;   (find-tlhi '(find-customizevariable 'goal-column) 
'(ee-find-custom-v-linki))
+;;   (find-tlhs '(find-eshortdoc 'keymaps)     '(ee-find-eshortdoc-links))
+;;   (find-tlhi '(find-eshortdoc 'keymaps)     '(ee-find-eshortdoc-linki))
+;;   (find-tlhs '(find-ecolors)                '(ee-find-ecolors-links))
+;;   (find-tlhi '(find-ecolors)                '(ee-find-ecolors-linki))
+;;   (find-tlhs '(find-efaces)                 '(ee-find-efaces-links))
+;;   (find-tlhi '(find-efaces)                 '(ee-find-efaces-linki))
+;;   (find-tlhs '(find-efunctiondescr 'car)    '(ee-find-efunctiondescr-links))
+;;   (find-tlhi '(find-efunctiondescr 'car)    '(ee-find-efunctiondescr-linki))
+;;   (find-tlhs '(find-efacedescr 'bold)       '(ee-find-efacedescr-links))
+;;   (find-tlhi '(find-efacedescr 'bold)       '(ee-find-efacedescr-linki))
+;;   (find-tlhs '(find-evardescr 'goal-column) '(ee-find-evardescr-links))
+;;   (find-tlhi '(find-evardescr 'goal-column) '(ee-find-evardescr-linki))
+
+
+
+(provide 'eev-htests)
+
+;; Local Variables:
+;; coding:            utf-8-unix
+;; no-byte-compile:   t
+;; End:
diff --git a/eev-intro.el b/eev-intro.el
index e6bf93168c..bed306935d 100644
--- a/eev-intro.el
+++ b/eev-intro.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20231223
+;; Version:    20231227
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-intro.el>
@@ -3333,9 +3333,149 @@ The next steps are to learn how:
 8. Debugging
 ============
 The best way to understand the innards of `find-here-links' is to
-call it in \"debug mode\". This is explained here:
+call it in \"debug mode\" - or, more precisely, to call it with a
+prefix argument. When we run `find-here-links' _without_ a prefix
+argument it displays a header and then the links to \"here\";
+_with_ a prefix argument it displays the header and then a lot of
+internal information about \"here\". For example, if you run
+
+  (eek \"M-h M-h  ;; find-here-links\")
+
+then \"here\" is this intro, and `find-here-links' displays a
+header and then a \"body\" that is the result of running
+(ee-find-intro-links). You can inspect the header and the body
+separately with:
+
+  (find-elinks (ee-find-here-links-header))
+  (find-elinks (ee-find-here-links))
+  (find-elinks (ee-find-intro-links))
+
+If you run `find-here-links' with a prefix argument, as in this
+`eek' sexp,
+
+  (eek \"M-0 M-h M-h  ;; M-0 find-here-links\")
+
+then `find-here-links' will display the same header as before and
+then a lot of information on how `(ee-find-here-links)' decided
+that \"here\" was an intro - this one - and then
+selected `(ee-find-intro-links)' as the right lower-level
+function to use to generate the body. You can inspect the header
+and the body of that buffer separately with:
+
+  (find-elinks (ee-find-here-links-header))
+  (ee-detect-here)
+  (find-elinks (ee-find-here-debug-links))
+
+
+
+9. The hlang
+============
+The original implementation of `find-here-links' was simple but
+was hard to debug - its core used a big `cond' and it didn't keep
+a lot of information on how it detected the kind of \"here\".
+See:
+
+  (find-eev \"eev-hlinks.el\" \"ee-find-here-links-old\")
+
+Then in 2021-2023 I rewrote it several times, and now
+`ee-detect-here' runs a program that looks like this:
+
+  (find-eev \"eev-hlinks.el\" \"hprog\")
+  (find-eev \"eev-hlinks.el\" \"ee-hprog-find-here-links\")
+
+The variable `ee-hprog-find-here-links' contains an \"hprogram\",
+that is a program written in the \"hlang\", that is a little
+language that is used mostly for deciding what is \"here\" and
+keeping track of some information on how that decision was made.
+
+The hlang is defined in the link below. To understand how it
+works read its docstrings,
+
+  (find-eev \"eev-hlinks.el\" \"hlang\")
+
+and try these examples:
+
+  (ee-hlang-:lisp '(+ 20 3) '(+ 40 5))
+  (ee-hlang-:or   '(:lisp nil) '(:lisp nil) '(:lisp 42) '(:lisp 99))
+  (ee-hlang-:if   '(< 1 2) '(list 'lt))
+  (ee-hlang-:if   '(> 1 2) '(list 'gt))
+
+  (ee-hlang-eval  '(:lisp (+ 20 3) (+ 40 5)))
+  (ee-hlang-eval  '(:or (:lisp nil) (:lisp nil) (:lisp 42) (:lisp 99)))
+  (ee-hlang-eval  '(:if (< 1 2) (list 'lt)))
+  (ee-hlang-eval  '(:if (> 1 2) (list 'gt)))
+  (ee-hlang-eval  '(:or (:if (< 1 2) (list 'lt)) (:if (> 1 2) (list 'gt))))
+  (ee-hlang-eval  '(:or (:if (> 1 2) (list 'gt)) (:if (< 1 2) (list 'lt))))
+
+Note this:
+
+  (find-efunction 'ee-hlang-:if)
+  (find-efunction 'ee-hlang-:if \"d) we DO NOT evaluate SEXP2\")
+  (find-efunction 'ee-find-here-links)
+  (find-efunction 'ee-find-here-links \"(eval ee-hlang-sexp2)\")
+
+When we are in debug mode we don't eval the \"then\" part of
+an (:if ...)! Check this low-level example to understand the
+details:
+
+  (ee-hlang-eval  '(:or (:if nil (error 1))
+                        (:if t   (error 2))
+                        (:if t   (error 3))
+                        (:if nil (error 4))))
+
+  (eval ee-hlang-sexp2)
+
+
+
+9.1. A historical note
+----------------------
+My main motivation for the hlang was my frustration with Org and
+Hyperbole. They are infinitely more popular then eev, probably
+because they look very user-friendly, but when I tried to learn
+them I stumbled on their hacker-unfriendliness...
+
+Both Org and Hyperbole have cases in which they have to inspect
+what we have \"here\", \"around point\", or \"in a link\", and
+then they have to classify what they found into several different
+cases, and act in a different way for each different case. Let me
+call the function that classifies and acts accordingly a
+\"dispatcher\".
+
+I tried to add new hyperlink types to Org ages ago, when the way
+to do that was not as well-documented as it is now. The current
+way is explained here:
+
+  (find-orgnode \"External Links\")
+  (find-orgnode \"Adding Hyperlink Types\")
+
+and when I tried to understand how Org's code blocks \"really
+work\" my experience was so painful that I made a video about it:
+
+  Page: http://anggtwu.net/2021-org-for-non-users.html
+  Info: (find-1stclassvideo-links \"2021orgfornonusers\")
+  Play: (find-2021orgfornonusersvideo \"00:00\")
+  Subs: (find-2021orgfornonuserslsubs \"00:00\")
+
+...but that was nothing in comparison with Hyperbole! I spent a
+lot of time trying to build a bridge between eev and Hyperbole
+that would make them easy to use together, but each one of my
+questions about the innards of Hyperbole - for example, my
+questions about the dispatchers for button types - was treated as
+The Wrong Question... and in the end Hyperbole got my Eternal
+Hate. See:
+
+  (find-es \"hyperbole\")
+
+Then I decided that ok, I will never be able to make eev look as
+user-friendly as Org or as Hyperbole, but at least I can make eev
+more hacker-friendly than them... and if tinkering with the
+innards of Org and Hyperbole is so unfun then I can make the
+innards of eev more fun to play with - and then I rewrote
+`find-here-links', that at that point was the part of eev whose
+code was worst.
+
+
 
-  (find-eevfile \"eev-hlinks.el\" \"Debug mode\")
 " pos-spec-list)))
 
 ;; (find-here-links-intro)
diff --git a/eev-kl-here.el b/eev-kl-here.el
index de434aa093..44409d45a5 100644
--- a/eev-kl-here.el
+++ b/eev-kl-here.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20231223
+;; Version:    20231228
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-kl-here.el>
@@ -30,94 +30,236 @@
 
 ;;; Commentary:
 
-;;; This file implements some commands that look like the ones in
-;;; `eev-kla.el' but that try to be smart in a way similar to
-;;; `find-here-links'. Everything here is VERY experimental.
+;; This file implements an experimental variant of `find-here-links',
+;; but in which we only generate a single \"link to here\", and we
+;; push that into the kill ring. It is a cross between this,
+;;
+;;   (find-here-links-intro "3. `find-here-links'")
+;;   (find-here-links-intro "9. The hlang")
+;;
+;; and the "kill link" functions from:
+;;
+;;   (find-kla-intro)
+;;
+;; Note that:
+;;
+;;   1. everything here is VERY experimental,
+;;   2. this file is not loaded by default,
+;;   3. the recommended way to use it is to put a line like this in
+;;      your ~/.emacs,
+;;
+;;        (require 'eev-kl-here)    ; (find-eev "eev-kl-here.el")
+;;
+;;   4. the current version of this file defines the functions `kl',
+;;      `kll' and `kls', that don't start with the valid prefixes.
 
 ;; Index:
-;; «.generate-sexps»   (to "generate-sexps")
-;; «.kill-sexps»       (to "kill-sexps")
-;; «.aliases»          (to "aliases")
+;; «.ee-find-linkis»           (to "ee-find-linkis")
+;; «.hprog»                    (to "hprog")
+;; «.kl»                       (to "kl")
 
 (require 'eev-kla)             ; (find-eev "eev-kla.el")
 (require 'eev-hlinks)          ; (find-eev "eev-hlinks.el")
 
 
 
-
-
-;;;  ____                      
-;;; / ___|  _____  ___ __  ___ 
-;;; \___ \ / _ \ \/ / '_ \/ __|
-;;;  ___) |  __/>  <| |_) \__ \
-;;; |____/ \___/_/\_\ .__/|___/
-;;;                 |_|        
+;;;                   __ _           _       _ _       _    _     
+;;;   ___  ___       / _(_)_ __   __| |     | (_)_ __ | | _(_)___ 
+;;;  / _ \/ _ \_____| |_| | '_ \ / _` |_____| | | '_ \| |/ / / __|
+;;; |  __/  __/_____|  _| | | | | (_| |_____| | | | | |   <| \__ \
+;;;  \___|\___|     |_| |_|_| |_|\__,_|     |_|_|_| |_|_|\_\_|___/
+;;;                                                                   
+;; These functions are used by the hprogram in the next section. Each
+;; `ee-find-{stem}-linki' is similar to the corresponding
+;; `ee-find-{stem}-links', but the `...-links' function generates
+;; several elisp hyperlinks and the `...-linki' function generates
+;; just one. The `i' in the `linki' was originally a `1', but the `i'
+;; is easier to type, to read, and to pronounce.
 ;;
-;; «generate-sexps»  (to ".generate-sexps")
-;; See: (find-eev "eev-kla.el" "generate-sexps")
-;;      (find-eev "eev-hlinks.el" "hprog")
-;;      (find-efunction 'ee-find-info-links)
-;;      (find-efunction 'ee-find-intro-links)
+;; See:
+;;   (find-eaproposf "ee-find.*link[is]")
+;;   (find-eev "eev-htests.el" "tests")
 ;;
-(defun ee-find-einfo-link (str)
-  "An internal function used by `ee-kl-sexp-klin'."
-  (let ((pos-spec-list (if str (list str))))
+;; «ee-find-linkis»  (to ".ee-find-linkis")
+
+;; Skel: (find-linki-links "info")
+(defun ee-find-info-linki ()
     (if (ee-info-shortp)
-       `(,(ee-info-shortf) ,(ee-info-node) ,@pos-spec-list)
-      `(find-node ,(ee-info-fullnode) ,@pos-spec-list))))
+       `(,(ee-info-shortf) ,(ee-info-node))
+      `(find-node ,(ee-info-fullnode))))
 
-(defun ee-find-eintro-link (str)
-  "An internal function used by `ee-kl-sexp-klin'."
+;; Skel: (find-linki-links "intro")
+(defun ee-find-intro-linki ()
   (let* ((stem (ee-intro-stem))
-        (find-xxx-intro (ee-intern "find-%s-intro" stem))
-        (pos-spec-list (if str (list str))))
-    `(,find-xxx-intro ,@pos-spec-list)))
-
-(defun ee-kl-sexp-klin (&optional str)
-  "<K>ill <l>ink to a <in>fo or <in>tro - make sexp."
-  (cond ((ee-info-bufferp)  (ee-find-einfo-link  str))
-       ((ee-intro-bufferp) (ee-find-eintro-link str))
-       (t (error "Not in info or in an intro!"))))
-
-
-;; Todo: adapt:
-;; (find-eev "eev-hlinks.el" "ee-hprog-find-here-links")
-;; (find-eev "eev-hlinks.el" "ee-hlang-run")
-
-
-;;;  _  ___ _ _     
-;;; | |/ (_) | |___ 
-;;; | ' /| | | / __|
-;;; | . \| | | \__ \
-;;; |_|\_\_|_|_|___/
-;;;                 
-;; «kill-sexps»  (to ".kill-sexps")
-;; Commands that push sexps into the kill ring.
-;; See: (find-eev "eev-kla.el" "kill-sexps")
-;;
-(defun eeklin ()
-  "<K>ill <l>ink to <in>fo or <in>tro."
+        (find-xxx-intro (ee-intern "find-%s-intro" stem)))
+    (list find-xxx-intro)))
+
+;; Skel: (find-linki-links "man")
+(defun ee-find-man-linki ()
+  `(find-man ,(ee-buffer-re ee-man-re)))
+
+;; Skel: (find-linki-links "file")
+(defun ee-find-file-linki ()
+  (let* ((fname0 (or (buffer-file-name) default-directory))
+        (fname (ee-shorten-file-name fname0)))
+    (if (ee-kl-c)
+       `(,(ee-kl-find-cfile) ,(ee-kl-shorterfname))
+      `(find-fline ,fname))))
+
+;; Skel: (find-linki-links "epackages")
+(defun ee-find-epackages-linki ()
+  (let ((pkgsymbol (ee-packages-package-here)))
+    `(find-epackages ',pkgsymbol)))
+
+;; Skel: (find-linki-links "custom")
+(defun ee-find-custom-linki ()
+  (let* ((name   (ee-buffer-re ee-custom-re))
+        (symbol (ee-custom-lispify-tag-name name)))
+    `(find-customizegroup ',symbol)))
+
+;; Skel: (find-linki-links "custom-f")
+(defun ee-find-custom-f-linki ()
+  (let* ((name   (ee-buffer-re ee-custom-f-re))
+        (symbol (ee-custom-lispify-tag-name name)))
+    `(find-customizeface ',symbol)))
+
+;; Skel: (find-linki-links "custom-v")
+(defun  ee-find-custom-v-linki () 
+  (let* ((name   (ee-buffer-re ee-custom-v-re))
+        (symbol (ee-custom-lispify-tag-name name)))
+    `(find-customizevariable ',symbol)))
+
+;; Skel: (find-linki-links "eshortdoc")
+(defun  ee-find-eshortdoc-linki ()
+  (let ((symbol (intern (ee-eshortdoc-bufferp))))
+    `(find-eshortdoc ',symbol)))
+
+;; Skel: (find-linki-links "ecolors")
+(defun ee-find-ecolors-linki ()
+  '(find-ecolors))
+
+;; Skel: (find-linki-links "efaces")
+(defun ee-find-efaces-linki ()
+  '(find-efaces))
+
+;; Skel: (find-linki-links "efunctiondescr")
+(defun ee-find-efunctiondescr-linki ()
+  (let ((f (ee-efunctiondescr-bufferp)))
+    `(find-efunctiondescr ',f)
+    ;; `(find-efunction-links ',f)
+    ))
+
+;; Skel: (find-linki-links "efacedescr")
+(defun ee-find-efacedescr-linki ()
+  (let ((f (ee-efacedescr-bufferp)))
+    `(find-efacedescr ',f)
+    ;; `(find-eface-links ',f)
+    ))
+
+;; Skel: (find-linki-links "evardescr")
+(defun ee-find-evardescr-linki ()
+  (let ((v (ee-evardescr-bufferp)))
+    `(find-evardescr ',v)
+    ;; `(find-evariable-links ',v)
+    ))
+
+;; Skel: (find-linki-links "epackage")
+;; Needs a rename
+
+
+;;;  _                           
+;;; | |__  _ __  _ __ ___   __ _ 
+;;; | '_ \| '_ \| '__/ _ \ / _` |
+;;; | | | | |_) | | | (_) | (_| |
+;;; |_| |_| .__/|_|  \___/ \__, |
+;;;       |_|              |___/ 
+;;
+;; This is an hprogram similar to the one used by `find-here-links',
+;; but in this one each :if returns a single sexp (for `kl').
+;; See:
+;;   (find-here-links-intro "9. The hlang")
+;;   (find-eev "eev-hlinks.el" "hprog")
+;; Tests:
+;;   (find-eev "eev-htests.el" "tests")
+;;
+;; «hprog»  (to ".hprog")
+
+(defvar ee-hprog-for-linki
+ '(:or
+   ;; By major mode:
+   (:if (ee-info-bufferp)       (ee-find-info-linki))      ; done
+   (:if (ee-man-bufferp)        (ee-find-man-linki))      ; done
+   (:if (ee-dired-bufferp)      (ee-find-file-linki))     ; done
+   (:if (ee-wdired-bufferp)     (ee-find-file-linki))     ; done
+   (:if (ee-epackages-bufferp)  (ee-find-epackages-linki)) ; done
+   ;;
+   ;; By buffer name:
+   (:if (ee-intro-bufferp)     (ee-find-intro-linki))     ; done
+   (:if (ee-custom-bufferp)    (ee-find-custom-linki))   ; done
+   (:if (ee-custom-f-bufferp)  (ee-find-custom-f-linki))  ; done
+   (:if (ee-custom-v-bufferp)  (ee-find-custom-v-linki))  ; done
+   (:if (ee-ecolors-bufferp)   (ee-find-ecolors-linki))   ; done
+   (:if (ee-efaces-bufferp)    (ee-find-efaces-linki))    ; done
+   (:if (ee-pdftext-bufferp)   (ee-find-pdftext-linki))   ; not yet
+   (:if (ee-eshortdoc-bufferp) (ee-find-eshortdoc-linki)) ; done
+   ;;
+   ;; By buffer name, when it is "*Help*":
+   (:if (ee-efunctiondescr-bufferp) (ee-find-efunctiondescr-linki)) ; done
+   (:if (ee-efacedescr-bufferp)     (ee-find-efacedescr-linki))            ; 
done
+   (:if (ee-evardescr-bufferp)      (ee-find-evardescr-linki))     ; done
+   (:if (ee-epackage-bufferp)       (ee-find-epackage-linki))      ; done
+   ;;
+   ;; Other cases:
+   (:if (ee-libera-bufferp)      (ee-find-libera-linki))   ; not yet
+   (:if (ee-freenode-bufferp)    (ee-find-freenode-linki)) ; not yet
+   (:if (ee-file-bufferp)        (ee-find-file-linki))    ; done
+   ;;
+   (:if t (error "Buffer type not supported by ee-hprog-linki"))
+   ))
+
+;; Similar to:
+;;   (find-efunction 'ee-detect-here)
+(defun ee-detect-linki ()
+  (ee-hlang-run ee-hprog-for-linki))
+
+(defun ee-get-linki ()
+  (ee-detect-linki)
+  (eval ee-hlang-sexp2))
+
+
+;;;  _    _ 
+;;; | | _| |
+;;; | |/ / |
+;;; |   <| |
+;;; |_|\_\_|
+;;;         
+;; «kl»  (to ".kl")
+;; Similar to:
+;;   (find-eev "eev-kla.el" "kill-sexps")
+;;   (find-eev "eev-kla.el" "aliases")
+
+(defun kl ()
+  "<K>ill <L>ink to here. Tries to be smart."
+  (interactive)
+  (ee-detect-linki)
+  (ee-kl-kill (ee-get-linki)))
+
+(defun kll ()
+  "<K>ill <L>ink to here; add a <L>ine. Tries to be smart."
   (interactive)
-  (ee-kl-kill (ee-kl-sexp-klin nil)))
+  (ee-detect-linki)
+  (ee-kl-kill (append (ee-get-linki) (list (ee-kl-line)))))
 
-(defun eeklins ()
-  "<K>ill <l>ink to <in>fo or <in>tro and a <s>tring."
+(defun kls ()
+  "<K>ill <L>ink to here; add a <S>tring. Tries to be smart."
   (interactive)
-  (ee-kl-kill (ee-kl-sexp-klin (ee-kl-region))))
-
-
-;;;     _    _ _                     
-;;;    / \  | (_) __ _ ___  ___  ___ 
-;;;   / _ \ | | |/ _` / __|/ _ \/ __|
-;;;  / ___ \| | | (_| \__ \  __/\__ \
-;;; /_/   \_\_|_|\__,_|___/\___||___/
-;;;                                  
-;; «aliases»  (to ".aliases")
-;; See: (find-eev "eev-kla.el" "aliases")
-;;      (find-kla-intro "4. Aliases")
-;; I use these aliases:
-;; (defalias 'klin  'eeklin)
-;; (defalias 'klins 'eeklins)
+  (ee-detect-linki)
+  (ee-kl-kill (append (ee-get-linki) (list (ee-kl-region)))))
+
+
+
+
+
 
 
 (provide 'eev-kl-here)
diff --git a/eev-kla.el b/eev-kla.el
index af0aff62d7..62bdb2ca87 100644
--- a/eev-kla.el
+++ b/eev-kla.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20231222
+;; Version:    20231228
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://anggtwu.net/eev-current/eev-kla.el>
@@ -208,6 +208,18 @@ This function also runs `ee-kl-transform' on the result, 
but
 (defun ee-kl-region ()
   (buffer-substring-no-properties (point) (mark)))
 
+;; Used in: (find-eev "eev-kl-here.el" "kl")
+;;    Test: (ee-kl-line)
+(defun ee-kl-line ()
+  (interactive "P")
+  (let* ((start (ee-bol))
+        (end   (ee-eol))
+        (str0  (buffer-substring start end))
+        (str   (ee-no-properties str0)))
+    (eeflash+ start end eeflash-copy)
+    str))
+
+
 
 ;;;  ____            _     _                               _ 
 ;;; | __ )  ___  ___| |_  | |      _ __       ___       __| |
diff --git a/eev-load.el b/eev-load.el
index 17ba2ff116..238b397655 100644
--- a/eev-load.el
+++ b/eev-load.el
@@ -111,6 +111,7 @@
 (require 'eev-elinks)         ; (find-eev "eev-elinks.el")
 (require 'eev-tlinks)         ; (find-eev "eev-tlinks.el")
 (require 'eev-hlinks)         ; (find-eev "eev-hlinks.el")
+(require 'eev-htests)          ; (find-eev "eev-htests.el")
 ;;
 ;; The `brxxx' functions. See:
 ;;   (find-eev-quick-intro "3.1. Non-elisp hyperlinks")
@@ -148,9 +149,9 @@
 (require 'eev-edit)            ; (find-eev "eev-edit.el")
 (require 'eev-testblocks)      ; (find-eev "eev-testblocks.el")
 (require 'eev-kla)             ; (find-eev "eev-kla.el")
-(require 'eev-kl-here)         ; (find-eev "eev-kl-here.el")
 (require 'eev-helpful)         ; (find-eev "eev-helpful.el")
 (require 'eev-rstdoc)          ; (find-eev "eev-rstdoc.el")
+' (require 'eev-kl-here)       ; (find-eev "eev-kl-here.el")
 ' (require 'eev-qrl)           ; (find-eev "eev-qrl.el")
 ;;
 ;; Configuration on M$ Windows.
diff --git a/eev-tlinks.el b/eev-tlinks.el
index 93a1dda325..479d372721 100644
--- a/eev-tlinks.el
+++ b/eev-tlinks.el
@@ -165,6 +165,7 @@
 ;; «.code-brappend»                    (to "code-brappend")
 ;; «.find-maximamsg-links»             (to "find-maximamsg-links")
 ;; «.find-maximamsg»                   (to "find-maximamsg")
+;; «.find-linki-links»                 (to "find-linki-links")
 
 
 (require 'eev-env)
@@ -4755,6 +4756,48 @@ A \"Maxima message\" is a message in the Maxima mailing 
list."
 
 
 
+;; «find-linki-links»  (to ".find-linki-links")
+;; Used in: (find-eev "eev-kl-here.el" "ee-find-linkis")
+;;    Skel: (find-find-links-links-new "linki" "stem" "")
+;;    Test: (find-linki-links "intro")
+;;
+(defun find-linki-links (&optional stem &rest pos-spec-list)
+"See: (find-eev \"eev-kl-here.el\" \"ee-find-linkis\")"
+  (interactive)
+  (setq stem (or stem "{stem}"))
+  (apply
+   'find-elinks-elisp
+   `((find-linki-links ,stem ,@pos-spec-list)
+     ;; Convention: the first sexp always regenerates the buffer.
+     (find-efunction 'find-linki-links)
+     ""
+     ,(ee-template0 "\
+;; (find-eev \"eev-htests.el\" \"tests\" \"ee-find-{stem}-links\")
+;; (find-eev \"eev-htests.el\" \"tests\" \"ee-find-{stem}-linki\")
+;; Tests:
+;;   (find-tlhs '(?)     '(ee-find-{stem}-links))
+;;   (find-tlh1 '(?)     '(ee-find-{stem}-linki))
+
+;; (find-eev \"eev-hlinks.el\"  \"hprog\")
+;; (find-eev \"eev-hlinks.el\"  \"hprog\" \"ee-find-{stem}-links\")
+;; (find-eev \"eev-kl-here.el\" \"hprog\")
+;;   (:if (ee-{stem}-bufferp)  (ee-find-{stem}-linki))
+
+;; (find-efunction 'ee-find-{stem}-links)
+;; (find-efunction 'ee-find-{stem}-linki)
+;; (find-eev \"eev-kl-here.el\" \"ee-find-linkis\")
+
+;; Skel: (find-linki-links \"{stem}\")
+(defun ee-find-{stem}-linki ()
+  )
+")
+     )
+   pos-spec-list))
+
+
+
+
+
 
 (provide 'eev-tlinks)
 



reply via email to

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