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

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

[elpa] externals/eev fe9e1a475e: Rewrote many comments; fixed ee-0x0-upl


From: ELPA Syncer
Subject: [elpa] externals/eev fe9e1a475e: Rewrote many comments; fixed ee-0x0-upload.
Date: Fri, 25 Feb 2022 01:57:33 -0500 (EST)

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

    Rewrote many comments; fixed ee-0x0-upload.
---
 ChangeLog     |   4 ++
 VERSION       |   4 +-
 eev-elinks.el |   2 +-
 eev-hlinks.el | 171 +++++++++++++++++++++++++++++++---------------------------
 eev-kla.el    |  73 ++++++++++++++++++++++---
 eev-tlinks.el |  30 ++++-------
 6 files changed, 174 insertions(+), 110 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 017c3e8fd7..ff8d735727 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2022-02-25  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-tlinks.el (ee-0x0-upload): rewritten.
+
 2022-02-24  Eduardo Ochs  <eduardoochs@gmail.com>
 
        * eev-kla.el: new file.
diff --git a/VERSION b/VERSION
index 9b94b0b316..d66682fd92 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Thu Feb 24 08:38:28 GMT 2022
-Thu Feb 24 05:38:28 -03 2022
+Fri Feb 25 06:52:54 GMT 2022
+Fri Feb 25 03:52:54 -03 2022
diff --git a/eev-elinks.el b/eev-elinks.el
index ac400f116b..25b593c633 100644
--- a/eev-elinks.el
+++ b/eev-elinks.el
@@ -707,7 +707,7 @@ a hack to let use use `M-h M-i' for both \"intro\" and 
\"info\"."
 ;; `find-code-c-d-filter-1' and `find-code-c-d-filter-2' are debugging
 ;; functions.
 ;;
-;;   (find-epp ee-code-c-d-pairs)
+;;   (find-eppp ee-code-c-d-pairs)
 ;;   (find-code-c-d-filter-1 'c-d)
 ;;   (find-code-c-d-filter-1 'c)
 ;;   (find-code-c-d-filter-1 'd)
diff --git a/eev-hlinks.el b/eev-hlinks.el
index 63e84a4df1..57c3458d04 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:    20211219
+;; Version:    20220224
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-hlinks.el>
@@ -72,11 +72,13 @@
 
 
 
+;; «.find-here-links»          (to "find-here-links")
+;; «.ee-find-here-links»       (to "ee-find-here-links")
+;; «.ee-find-here-links-tests» (to "ee-find-here-links-tests")
 ;; «.ee-fhl-main-program»      (to "ee-fhl-main-program")
 ;; «.ee-fhl-run»               (to "ee-fhl-run")
-;; «.ee-find-here-links»       (to "ee-find-here-links")
+;;
 ;; «.ee-find-here-links-old»   (to "ee-find-here-links-old")
-;; «.find-here-links»          (to "find-here-links")
 ;;
 ;; «.low-level-functions»      (to "low-level-functions")
 ;; «.tests-and-links»          (to "tests-and-links")
@@ -88,6 +90,92 @@
 
 
 
+
+;;;   __ _           _       _                         _ _       _        
+;;;  / _(_)_ __   __| |     | |__   ___ _ __ ___      | (_)_ __ | | _____ 
+;;; | |_| | '_ \ / _` |_____| '_ \ / _ \ '__/ _ \_____| | | '_ \| |/ / __|
+;;; |  _| | | | | (_| |_____| | | |  __/ | |  __/_____| | | | | |   <\__ \
+;;; |_| |_|_| |_|\__,_|     |_| |_|\___|_|  \___|     |_|_|_| |_|_|\_\___/
+;;;                                                                       
+;; «find-here-links»  (to ".find-here-links")
+;; Skel: (find-find-links-links-new "here" "" "")
+;; See: (find-eev "eev-mode.el" "eev-mode-map-set" "find-here-links")
+;;      (find-eev-quick-intro "`M-h M-h'")
+;;      (find-here-links-intro)
+;;      (find-links-conv-intro "3. Classification")
+;;      (find-links-conv-intro "3. Classification" "that violate")
+;; Tests: (find-here-links)
+;;        (progn (find-enode "Screen") (find-here-links))
+;;
+;; TODO: write one test for each kind of "here" that we support.
+;;
+(defun find-here-links (&rest pos-spec-list)
+"Visit a temporary buffer containing hyperlinks pointing to \"here\".
+See: (find-here-links-intro)"
+  (interactive)
+  (let ((ee-buffer-name "*(find-here-links)*"))
+    (apply
+     'find-elinks
+     `(;; 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)
+       )
+     pos-spec-list)))
+
+(defun ee-find-here-links0 ()
+  "The header used by `find-here-links'."
+  `(,(ee-H "See: ")
+    (find-eev-quick-intro "4.1. `find-here-links'")
+    (find-emacs-keys-intro "1. Basic keys (eev)" "M-h M-h")
+    (find-here-links-intro "4. `find-here-links-3'")
+    ))
+
+;; «ee-find-here-links»  (to ".ee-find-here-links")
+;;
+(defun ee-find-here-links ()
+  "Generate the non-header part of the \"*(find-here-links)*\" buffer.
+This function runs `(ee-fhl-run ee-fhl-main-program)', that runs
+the program in `ee-fhl-main-program' with `ee-fhl-run' until an
+expression like this in it
+
+  (:if SEXP1 SEXP2)
+
+succeeds. When the successful `(:if ___ ___)' is found its SEXP1
+is stored in the global variable `ee-fhl-sexp1' and its SEXP2 is
+stored in the global variable `ee-fhl-sexp2'. Their values will
+be things like:
+
+  SEXP1  =>  (ee-<kind>-bufferp)
+  SEXP2  =>  (ee-find-<kind>-links)
+
+For example, if we run `find-here-links' in an info buffer we
+will have this,
+
+  SEXP1  =>  (ee-info-bufferp)
+  SEXP2  =>  (ee-find-info-links)
+
+and `(eval (ee-find-info-links))' produces the non-header part of
+the \"*(find-here-links)*\" buffer."
+  (ee-fhl-run ee-fhl-main-program)
+  (cons "" (eval ee-fhl-sexp2)))
+
+
+;; «ee-find-here-links-tests»  (to ".ee-find-here-links-tests")
+;; Low-level tests:
+;;
+;;   (find-2a nil                 '(find-here-links))
+;;   (find-2a nil '(find-elinks (ee-find-here-links)))
+;;           (ee-fhl-run ee-fhl-main-program)
+;;                 (list ee-fhl-sexp1 ee-fhl-sexp2)
+;;                                    ee-fhl-sexp2
+;;   (find-2a nil '(find-elinks (eval ee-fhl-sexp2)))
+
+
+
+
+
 ;;;                  _                                                   
 ;;;  _ __ ___   __ _(_)_ __    _ __  _ __ ___   __ _ _ __ __ _ _ __ ___  
 ;;; | '_ ` _ \ / _` | | '_ \  | '_ \| '__/ _ \ / _` | '__/ _` | '_ ` _ \ 
@@ -96,12 +184,7 @@
 ;;;                           |_|              |___/                     
 ;;
 ;; «ee-fhl-main-program»  (to ".ee-fhl-main-program")
-;; In the past this "main program" was a big cond, that was easy to
-;; understand but hard to debug... in oct/2021 I replaced the big cond
-;; by a program in a domain-specific language that should be easy to
-;; understand, easy to extend, and easy to debug - the one below.
-;;
-;; `find-here-links' runs this "program" with `ee-fhl-run'.
+;; `ee-find-here-links' runs this "program" with `ee-fhl-run'.
 ;;
 ;; Try: (find-eppp ee-fhl-main-program)
 ;;     (ee-fhl-run ee-fhl-main-program)
@@ -194,19 +277,6 @@
           until fhl-result
            finally return fhl-result))
 
-;; «ee-find-here-links»  (to ".ee-find-here-links")
-;; Try:           (ee-find-here-links)
-;;   (find-elinks (ee-find-here-links))
-;;   ee-fhl-sexp1
-;;   ee-fhl-sexp2
-
-(defun ee-find-here-links ()
-  "Run all the `(:if SEXP1 SEXP2)'s in `ee-fhl-main-program' until
-one succeeds. When the successful `(:if ___ ___)' is found store
-its SEXP1 in `ee-fhl-sexp1', its SEXP2 in `ee-fhl-sexp2', and
-return the result of (eval ee-fhl-sexp2), slightly preprocessed."
-  (ee-fhl-run ee-fhl-main-program)
-  (cons "" (eval ee-fhl-sexp2)))
 
 
 ;; «ee-find-here-links-old»  (to ".ee-find-here-links-old")
@@ -242,52 +312,6 @@ return the result of (eval ee-fhl-sexp2), slightly 
preprocessed."
 
 
 
-;;;   __ _           _       _                         _ _       _        
-;;;  / _(_)_ __   __| |     | |__   ___ _ __ ___      | (_)_ __ | | _____ 
-;;; | |_| | '_ \ / _` |_____| '_ \ / _ \ '__/ _ \_____| | | '_ \| |/ / __|
-;;; |  _| | | | | (_| |_____| | | |  __/ | |  __/_____| | | | | |   <\__ \
-;;; |_| |_|_| |_|\__,_|     |_| |_|\___|_|  \___|     |_|_|_| |_|_|\_\___/
-;;;                                                                       
-;; «find-here-links»  (to ".find-here-links")
-;; Skel: (find-find-links-links-new "here" "" "")
-;; Key binding:
-;;     (find-eev "eev-mode.el" "eev-mode-map-set" "M-h" "M-h" 
"find-here-links")
-;; See: (find-eev-quick-intro "`M-h M-h'")
-;;      (find-here-links-intro)
-;;      (find-links-conv-intro "3. Classification")
-;;      (find-links-conv-intro "3. Classification" "that violate")
-;; Tests: (find-here-links)
-;;        (progn (find-enode "Screen") (find-here-links))
-;;
-(defun find-here-links (&rest pos-spec-list)
-"Visit a temporary buffer containing hyperlinks pointing to \"here\".
-See: (find-here-links-intro)"
-  (interactive)
-  (let ((ee-buffer-name "*(find-here-links)*"))
-    (apply
-     'find-elinks
-     `(;; 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)
-       )
-     pos-spec-list)))
-
-(defun ee-find-here-links0 ()
-  "The header used by `find-here-links'."
-  `(,(ee-H "See: ")
-    (find-eev-quick-intro "4.1. `find-here-links'")
-    (find-emacs-keys-intro "1. Basic keys (eev)" "M-h M-h")
-    (find-here-links-intro "4. `find-here-links-3'")
-    ))
-
-
-
-
-
-
-
 ;;;  _                       _                _ 
 ;;; | |    _____      __    | | _____   _____| |
 ;;; | |   / _ \ \ /\ / /____| |/ _ \ \ / / _ \ |
@@ -295,7 +319,7 @@ See: (find-here-links-intro)"
 ;;; |_____\___/ \_/\_/      |_|\___| \_/ \___|_|
 ;;;                                             
 ;; «low-level-functions»  (to ".low-level-functions")
-;; Low lever functions used by the functions of the form
+;; Low level functions used by the functions of the form
 ;; `ee-*-bufferp' and `ee-find-*-links' defined in the next section.
 
 ;; Some tools for detecting which kind of buffer we're in.
@@ -410,15 +434,6 @@ See: (find-here-links-intro)"
 (defun ee-find-w3m-links       () `((find-w3m ,w3m-current-url)))
 
 
-;; For debugging.
-;; TODO: remember how to use this.
-;;
-;; (defun find-here-links-test (sexp)
-;; "See: (find-links-intro \"`find-here-links'\")"
-;;   (find-wset "13o_2o_o" sexp '(find-here-links)))
-
-
-
 
 
 ;;;  _                _                       
diff --git a/eev-kla.el b/eev-kla.el
index 6c107e0e4a..63ed0e2a5d 100644
--- a/eev-kla.el
+++ b/eev-kla.el
@@ -33,10 +33,12 @@
 ;;                                                (find-prepared-intro)
 
 ;; «.intro»            (to "intro")
+;; «.test»             (to "test")
 ;; «.ee-preferred-c»   (to "ee-preferred-c")
 ;; «.utils»            (to "utils")
 ;; «.eekla»            (to "eekla")
 ;; «.eeklf»            (to "eeklf")
+;; «.aliases»          (to "aliases")
 
 
 
@@ -45,6 +47,20 @@
 
 ;; «intro»  (to ".intro")
 ;;
+;; 0. Prerequisites
+;; ================
+;; This tool will only make sense to people who understand `code-c-d',
+;; anchors, and `find-here-links' very well. See:
+;;
+;;   (find-eev-quick-intro "9.1. `code-c-d'")
+;;   (find-eev-quick-intro "9.2. Extra arguments to `code-c-d'")
+;;   (find-eev-quick-intro "9.2. Extra arguments to `code-c-d'" "to anchors")
+;;   (find-eev-quick-intro "8. Anchors")
+;;   (find-eev-quick-intro "4. Creating Elisp Hyperlinks")
+;;   (find-eev-quick-intro "4.1. `find-here-links'")
+;;
+;;
+;;
 ;; 1. Choosing a link to here
 ;; ==========================
 ;; This section of the main tutorial
@@ -77,6 +93,7 @@
 ;; have to choose the "right" link by hand.
 ;;
 ;;
+;;
 ;; 2. Our preferred link to here
 ;; =============================
 ;; This file implement a VERY HACKY way to choose the "right" link
@@ -104,23 +121,60 @@
 ;;   (find-eev ".dir-locals.el")
 ;;
 ;;
+;;
 ;; 3. Commands
 ;; ===========
-;; At this moment this file implements these commands:
+;; At the moment this file implements these commands:
+;;
+;;   1) `M-x eekla', that <K>ills a <L>ink to an <A>nchor.
+;;      See: (find-anchors-intro "3. The preceding tag" "M-1 M-h M-w")
+;;           (find-refining-intro "5. Pointing to anchors")
+;;
+;;         «test»  (to ".test")
+;;
+;;      To test this, run `M-x eekla' here. It will highlight the
+;;      anchor above ("test") for a fraction of a second and will show
+;;      this message in the echo area:
+;;
+;;        Copied to the kill ring: (find-eev "eev-kla.el" "test")
 ;;
-;;   1) `M-x eekla', that <K>ills a <L>ink to an <A>nchor. See:
+;;   2) `M-x eeklf', that <K>ills a <L>ink to a <F>ile.
+;;       To test this, just run `M-x eeklf'. You will see this message
+;;       in the echo area:
 ;;
-;;      (find-anchors-intro "3. The preceding tag" "M-1 M-h M-w")
-;;      (find-refining-intro "5. Pointing to anchors")
+;;         Copied to the kill ring: (find-eevfile "eev-kla.el")
 ;;
-;;   2) `M-x ee-preferred-c-show', that shows the current directory
+;;   3) `M-x ee-preferred-c-show', that shows the current directory
 ;;      and the value of `ee-preferred-c' at the window at the right.
 ;;      This is useful to check if the ".dir-locals.el" file was
-;;      correctly written.
+;;      correctly written. Try:
 ;;
-;; Try them! =)
+;;        (ee-preferred-c-show)
 ;;
 ;; TODO: `M-x eekls', that <K>ills a <L>ink to a <S>tring.
+;;
+;;
+;;
+;; 4. The gory details
+;; ===================
+;; The function `find-here-links' calls the function
+;; `ee-find-here-links' to generate the non-header part of the
+;; "*(find-here-links)*" buffer. When `ee-find-here-links' decides
+;; that "here" is a file it calls the function `ee-find-file-links' to
+;; generate a series of links to the current file.
+;;
+;; If you really, really, REALLY want to know the innards of how this
+;; works and how `ee-find-file-links' consults the data stored by
+;; `code-c-d' to generate these links, follow the links below:
+;;
+;;   (find-eev "eev-hlinks.el" "ee-find-here-links")
+;;   (find-eev "eev-elinks.el" "find-file-links")
+;;   (find-eev "eev-elinks.el" "ee-find-xxxfile-sexps")
+;;   (find-eev "eev-elinks.el" "ee-code-c-d-filter")
+;;   (find-eev "eev-elinks.el" "ee-code-c-d-filter" "Try:")
+
+
+
 
 
 ;; «ee-preferred-c»  (to ".ee-preferred-c")
@@ -185,7 +239,7 @@
 ;; <K>ill <L>ink to <File>.
 
 (defun ee-klf-sexp (c fname)
-  (format "(find-%sfile \"%s\")" c (ee-kla-fname c fname)))
+  (format "(find-%sfile \"%s\")" c (ee-kl-fname c fname)))
 
 (defun eeklf ()
   "Put in the kill ring a link to this file."
@@ -195,10 +249,13 @@
     (ee-kl-kill (ee-klf-sexp c fname))))
 
 
+;; «aliases»  (to ".aliases")
 ;; I use these aliases:
 ;; (defalias 'kla 'eekla)
 ;; (defalias 'klf 'eeklf)
 
+
+
 (provide 'eev-kla)
 
 
diff --git a/eev-tlinks.el b/eev-tlinks.el
index 971212ab33..593c078b80 100644
--- a/eev-tlinks.el
+++ b/eev-tlinks.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20220218
+;; Version:    20220225
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-tlinks.el>
@@ -2501,31 +2501,19 @@ sudo ./install-tl -select-repository
 ;;;                   
 ;; «ee-0x0-upload-region»  (to ".ee-0x0-upload-region")
 ;; Needs: https://melpa.org/#/0x0
+;;        (find-epackage-links '0x0)
 ;;   See: https://lists.gnu.org/archive/html/eev/2021-08/msg00000.html
 ;;
 (defvar ee-0x0-url nil
   "The last URL generated by a call to `ee-0x0-upload-region'.")
 
-(defun ee-0x0-upload (&rest rest)
-  "This should work like `0x0-upload'. Redefine if needed."
-  (apply '0x0-upload rest))
-
-;; If you are using a version of 0x0 that doesn't have `0x0-upload'
-;; then try using the hack below. See:
-;;   https://gitlab.com/willvaughn/emacs-0x0/-/issues/2
-;;
-;; Based on: (find-efunction '0x0-upload-kill-ring)
-' (defun ee-0x0-upload (b e server-old)
-    "This is a hack. See the source code."
-    (let ((server (0x0--choose-server))
-         (region-contents (buffer-substring-no-properties b e)))
-      (with-temp-buffer
-       (insert region-contents)
-       (let* ((file-name (or (buffer-file-name) (buffer-name) "kill-ring.txt"))
-               (bounds (0x0--make-bounds))
-               (size (0x0--bounds-size bounds))
-               (resp (0x0--send server file-name bounds)))
-         (0x0--handle-resp server size resp)))))
+(defun ee-0x0-upload (b e &rest ignore)
+  "Upload the current region using `0x0-dwim'.
+See: https://gitlab.com/willvaughn/emacs-0x0/-/issues/2
+This is a hack."
+  (deactivate-mark 'force)
+  (eek "C-x C-x C-x C-x     ;; reactivate the mark
+        M-x 0x0-dwim RET"))
 
 (defun ee-0x0-upload-region (b e)
   "Upload the current region to 0x0 and show some elisp hyperlinks.



reply via email to

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