[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eev 42c8d9ad25 1/2: Now calling `find-here-links' with
From: |
ELPA Syncer |
Subject: |
[elpa] externals/eev 42c8d9ad25 1/2: Now calling `find-here-links' with a prefix arg shows debug info. |
Date: |
Sat, 25 Jun 2022 19:57:33 -0400 (EDT) |
branch: externals/eev
commit 42c8d9ad257773911325056ad12646f79cdb7af8
Author: Eduardo Ochs <eduardoochs@gmail.com>
Commit: Eduardo Ochs <eduardoochs@gmail.com>
Now calling `find-here-links' with a prefix arg shows debug info.
---
ChangeLog | 6 ++++
VERSION | 4 +--
eev-hlinks.el | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
eev-kla.el | 25 +++++++++++++-
eev-readme.el | 2 ++
5 files changed, 128 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e26b0a37f6..08a650b825 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-06-25 Eduardo Ochs <eduardoochs@gmail.com>
+
+ * eev-hlinks.el (find-here-links, ee-find-here-links): added an
+ "&optional arg" to the argument list, for debugging.
+ (ee-find-here-debug-links): new function.
+
2022-06-18 Eduardo Ochs <eduardoochs@gmail.com>
* eev-blinks.el (ee-buffer-local-variables): new function.
diff --git a/VERSION b/VERSION
index 647937b41d..8b450dedd9 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Mon Jun 20 02:22:14 GMT 2022
-Sun Jun 19 23:22:14 -03 2022
+Sat Jun 25 23:05:18 GMT 2022
+Sat Jun 25 20:05:18 -03 2022
diff --git a/eev-hlinks.el b/eev-hlinks.el
index 06a839ab95..2a105b33a0 100644
--- a/eev-hlinks.el
+++ b/eev-hlinks.el
@@ -1,6 +1,6 @@
;;; eev-hlinks.el --- `find-here-links' and variants. -*- lexical-binding:
nil; -*-
-;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2022 Free Software Foundation, Inc.
;;
;; This file is part of GNU eev.
;;
@@ -19,7 +19,7 @@
;;
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version: 20220502
+;; Version: 20220625
;; Keywords: e-scripts
;;
;; Latest version: <http://angg.twu.net/eev-current/eev-hlinks.el>
@@ -61,10 +61,42 @@
;;
;; Their names are of the form `ee-*-bufferp' and `ee-find-*-links'.
;;
-;; TODO: Some of the `ee-find-*-links' functions are defined in other
-;; files. Which ones? Give examples!
;;
-;; (find-eapropos "ee-find-.*-links")
+;; 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)
+
+
+;; TODO
+;; ====
+;; 1. Some of the `ee-find-*-links' functions are defined in other
+;; files. Which ones? Give examples! This may help:
+;;
+;; (find-eapropos "ee-find-.*-links")
;;
;; The main workhorse function in this file is `ee-find-here-links',
;; Its current version runs the program in `ee-fhl-main-program' using
@@ -74,6 +106,7 @@
;; «.find-here-links» (to "find-here-links")
;; «.ee-find-here-links» (to "ee-find-here-links")
+;; «.ee-find-here-debug-links» (to "ee-find-here-debug-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")
@@ -109,10 +142,12 @@
;;
;; TODO: write one test for each kind of "here" that we support.
;;
-(defun find-here-links (&rest pos-spec-list)
+(defun find-here-links (&optional arg &rest pos-spec-list)
"Visit a temporary buffer containing hyperlinks pointing to \"here\".
+If ARG is not nil, show some info about how `find-here-links'
+detected which kind of \"here\" the current buffer is.
See: (find-here-links-intro)"
- (interactive)
+ (interactive "P")
(let ((ee-buffer-name "*(find-here-links)*"))
(apply
'find-elinks
@@ -120,7 +155,7 @@ See: (find-here-links-intro)"
;; regenerates the buffer - instead the first lines point to
;; help pages.
,@(ee-find-here-links0)
- ,@(ee-find-here-links)
+ ,@(ee-find-here-links arg)
)
pos-spec-list)))
@@ -134,7 +169,7 @@ See: (find-here-links-intro)"
;; «ee-find-here-links» (to ".ee-find-here-links")
;;
-(defun ee-find-here-links ()
+(defun ee-find-here-links (&optional arg)
"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
@@ -157,13 +192,45 @@ will have this,
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)))
+the \"*(find-here-links)*\" buffer.
+
+If ARG is non-nil, show some info about how `ee-fhl-run' decided
+which kind \"here\" the current buffer is."
+ (ee-detect-here)
+ (if arg
+ (cons "" (ee-find-here-debug-links))
+ (cons "" (eval ee-fhl-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")
+;;
+(defun ee-find-here-debug-links ()
+ `("# The last call to"
+ "# '(find-here-links ARG)"
+ "# -> '(ee-detect-here)"
+ "# -> '(ee-fhl-run ee-fhl-main-program)"
+ "# produced this:"
+ ,(format "# ee-fhl-sexp1 => %s" (ee-S ee-fhl-sexp1))
+ ,(format "# ee-fhl-sexp2 => %s" (ee-S ee-fhl-sexp2))
+ "# See:"
+ "# ee-fhl-sexp1"
+ "# ee-fhl-sexp2"
+ ,(format "# (find-efunction '%s)" (car ee-fhl-sexp1))
+ ,(format "# (find-efunction '%s)" (car ee-fhl-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-fhl-run\")"
+ "# (find-eev \"eev-hlinks.el\" \"ee-fhl-run\" \"ee-detect-here\")"
+ "# (find-eev \"eev-hlinks.el\" \"ee-fhl-main-program\")"
+ ))
+
;; «ee-find-here-links-tests» (to ".ee-find-here-links-tests")
-;; Low-level tests:
+;; Low-level tests (old, written before `ee-find-here-debug-links'):
;;
;; (find-2a nil '(find-here-links))
;; (find-2a nil '(find-elinks (ee-find-here-links)))
@@ -188,6 +255,14 @@ the \"*(find-here-links)*\" buffer."
;;
;; Try: (find-eppp ee-fhl-main-program)
;; (ee-fhl-run ee-fhl-main-program)
+;;
+;; Note the _AT THIS MOMENT_ the easiest way to add support for a new
+;; kind of "here" in `ee-fhl-main-program' is to override this
+;; variable by setq-ing it in your init file... this is just because
+;; I've been lazy and I haven't implemented YET a way to make
+;; `ee-fhl-main-program' call "subprograms". If you need to extend
+;; this please get in touch with me and I'll implement the missing
+;; parts!!!
(defvar ee-fhl-main-program
'(:or
@@ -282,6 +357,12 @@ the \"*(find-here-links)*\" buffer."
until fhl-result
finally return fhl-result))
+(defun ee-detect-here ()
+ "To understand this, run `find-here-links' with a prefix argument.
+This is the standard high-level way to call `ee-fhl-run'."
+ (ee-fhl-run ee-fhl-main-program))
+
+
;; «ee-find-here-links-old» (to ".ee-find-here-links-old")
diff --git a/eev-kla.el b/eev-kla.el
index c9be423c4d..c244275578 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: 20220307
+;; Version: 20220625
;; Keywords: e-scripts
;;
;; Latest version: <http://angg.twu.net/eev-current/eev-kla.el>
@@ -293,12 +293,35 @@ Put in the kill ring a link to the preceding anchor."
+
+(defun eekla2 ()
+ "Insert a link \"to here\" \"there\" and a link \"to there\" \"here\".
+Run `eekla' in this window, and save the result in `kla-here';
+then run `eekla' in the next window, and save the result in
+`kla-here'; then insert `kla-there' \"here\" and `kla-here'
+\"there\"."
+ (interactive)
+ (let* ((kla-here (progn (eekla)
+ (car kill-ring)))
+ (kla-there (progn (other-window 1)
+ (eekla)
+ (other-window -1)
+ (car kill-ring))))
+ (insert kla-there)
+ (other-window 1)
+ (insert kla-here)
+ (other-window -1)))
+
+
+
;; «aliases» (to ".aliases")
;; I use these aliases:
;; (defalias 'kla 'eekla)
;; (defalias 'klas 'eeklas)
;; (defalias 'klf 'eeklf)
;; (defalias 'klfs 'eeklfs)
+;; (defalias 'klfs 'eeklfs)
+;; (defalias 'kla2 'eekla2)
diff --git a/eev-readme.el b/eev-readme.el
index abd64f9565..96e528e041 100644
--- a/eev-readme.el
+++ b/eev-readme.el
@@ -32,6 +32,8 @@
;;; Commentary:
+;; THIS FILE IS OBSOLETE!
+;;
;; Until march/2019 this file was used by a few of the (many) ways of
;; loading eev; now it is totally obsolete, and it will be removed at
;; some point. See these for the current standard ways to install eev: