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

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

[elpa] externals/eev 1369ee9ccc: Rewrote eev-kla.el.


From: ELPA Syncer
Subject: [elpa] externals/eev 1369ee9ccc: Rewrote eev-kla.el.
Date: Sat, 17 Sep 2022 05:57:50 -0400 (EDT)

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

    Rewrote eev-kla.el.
---
 ChangeLog     |  16 +++
 VERSION       |   4 +-
 eev-edit.el   |  21 ++-
 eev-elinks.el |   3 +-
 eev-kla.el    | 439 ++++++++++++++++++++++++++++++++++++++--------------------
 eev-tlinks.el |   6 +-
 6 files changed, 330 insertions(+), 159 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cc6afd742b..a1be87ba48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2022-09-17  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-edit.el (ee-preceding-tag-flash): new function.
+       (ee-copy-preceding-tag-to-kill-ring): use
+       `ee-preceding-tag-flash'.
+
+       * eev-kla.el: totally rewritten.
+
+2022-09-06  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-elinks.el (find-ecolor-links): added (read-color).
+
+2022-09-05  Eduardo Ochs  <eduardoochs@gmail.com>
+
+       * eev-tlinks.el (find-debpkg-links): small changes.
+
 2022-09-03  Eduardo Ochs  <eduardoochs@gmail.com>
 
        * eev-hlinks.el (ee-eshortdoc-re): new variable.
diff --git a/VERSION b/VERSION
index c54ba6ce70..b67ccfae30 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Sat Sep  3 04:28:44 GMT 2022
-Sat Sep  3 01:28:44 -03 2022
+Sat Sep 17 09:33:54 GMT 2022
+Sat Sep 17 06:33:54 -03 2022
diff --git a/eev-edit.el b/eev-edit.el
index d4074ad86d..4d2d19a331 100644
--- a/eev-edit.el
+++ b/eev-edit.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20220224
+;; Version:    20220917
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-edit.el>
@@ -151,21 +151,28 @@ With a prefix argument run 
`ee-copy-preceding-tag-to-kill-ring' instead."
 (defvar ee-tag-re-utf-8 "«\\([!-~]+\\)»")
 (defun  ee-tag-re () ee-tag-re-utf-8)
 
-(defun ee-copy-preceding-tag-to-kill-ring ()
-  "Copy the preceding tag to the kill ring and highlight (\"flash\") it.
+(defun ee-preceding-tag-flash ()
+  "Highlight (\"flash\") the preceding tag and return it.
 A \"tag\" is the string between \"«»\"s in an anchor."
   (interactive)
   (save-excursion
     (if (re-search-backward (ee-tag-re))
        (let* ((start (match-beginning 1))
               (end   (match-end 1))
-              (str   (ee-no-properties (match-string 1)))
-              (msg   (format "Copied \"%s\" to the kill ring" str)))
+              (str   (ee-no-properties (match-string 1))))
          (eeflash start end eeflash-copy)
-         (kill-new str)
-         (message msg)
          str)
       (error "No preceding tag!"))))
+
+(defun ee-copy-preceding-tag-to-kill-ring ()
+  "Copy the preceding tag to the kill ring and highlight (\"flash\") it.
+A \"tag\" is the string between \"«»\"s in an anchor."
+  (interactive)
+  (let* ((str (ee-preceding-tag-flash))
+        (msg (format "Copied \"%s\" to the kill ring" str)))
+    (kill-new str)
+    (message msg)
+    str))
     
 
 
diff --git a/eev-elinks.el b/eev-elinks.el
index be919153b2..879bd807c7 100644
--- a/eev-elinks.el
+++ b/eev-elinks.el
@@ -19,7 +19,7 @@
 ;;
 ;; Author:     Eduardo Ochs <eduardoochs@gmail.com>
 ;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version:    20220323
+;; Version:    20220906
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-elinks.el>
@@ -1189,6 +1189,7 @@ to understand how this is used. ARG is usually
   (apply
    'find-elinks
    `((find-ecolor-links ,initialcolor ,@pos-spec-list)
+     (find-ecolor-links (read-color))
      ;; Convention: the first sexp always regenerates the buffer.
      (find-efunction 'find-ecolor-links)
      ""
diff --git a/eev-kla.el b/eev-kla.el
index 4b0a16b650..f74b6f81c9 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:    20220628
+;; Version:    20220917
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-kla.el>
@@ -28,15 +28,16 @@
 ;;                 <http://angg.twu.net/eev-intros/find-eev-intro.html>
 ;;                                                (find-eev-intro)
 
-;; «.intro»            (to "intro")
-;; «.test»             (to "test")
-;; «.ee-preferred-c»   (to "ee-preferred-c")
-;; «.utils»            (to "utils")
-;; «.eekla»            (to "eekla")
-;; «.eekla2»           (to "eekla2")
-;; «.demo»             (to "demo")
-;; «.eeklf»            (to "eeklf")
-;; «.aliases»          (to "aliases")
+;; «.intro»                    (to "intro")
+;; «.variables»                        (to "variables")
+;;  «.test»                    (to "test")
+;; «.simple-defaults»          (to "simple-defaults")
+;; «.other-defaults»           (to "other-defaults")
+;; «.generate-sexps»           (to "generate-sexps")
+;; «.kill-sexps»               (to "kill-sexps")
+;; «.eekla2»                   (to "eekla2")
+;; «.demo»                     (to "demo")
+;; «.aliases»                  (to "aliases")
 
 
 
@@ -59,69 +60,202 @@
 ;;
 ;;
 ;;
-;; 1. Choosing a link to here
-;; ==========================
+;; 1. The problem
+;; ==============
 ;; This section of the main tutorial
 ;;
 ;;   (find-eev-quick-intro "10.1. Generating short hyperlinks to files")
 ;;
-;; explains that we can have several `code-c-d's "pointing to the same
-;; directory", and if we run
+;; explains that after running these four `code-c-d's
 ;;
-;;   (eek "M-h M-h  ;; find-here-links")
+;;   (code-c-d "foo"  "/tmp/FOO/")
+;;   (code-c-d "bar"  "/tmp/FOO/BAR/")
+;;   (code-c-d "plic" "/tmp/FOO/BAR/PLIC/")
 ;;
-;; here in this file it will try to generate links to "here" - and it
-;; will show several options, including one for each `code-c-d' that
-;; points to this directory or to any of its parents. One of the
-;; options will be this one:
+;; all these sexp hyperlinks will point to the same file:
 ;;
-;;   (find-eevfile "eev-kla.el")
+;;   (find-file  "/tmp/FOO/BAR/PLIC/bletch")
+;;   (find-fline "/tmp/FOO/BAR/PLIC/bletch")
+;;   (find-foofile        "BAR/PLIC/bletch")
+;;   (find-barfile            "PLIC/bletch")
+;;   (find-plicfile                "bletch")
 ;;
-;; It is associated to this `code-c-d':
+;; So if we are in the file /tmp/FOO/BAR/PLIC/bletch then there isn't
+;; an obvious choice for the best short hyperlink to that file, and
+;; `find-here-links' will display all the choices above... Try this:
 ;;
-;;   (code-c-d "eev" ee-eev-source-directory :anchor)
+;;   (eek "<down> M-3 M-e M-h M-h")
+;;   (find-fline "/tmp/FOO/BAR/PLIC/bletch")
 ;;
-;; that is one of the predefined `code-c-d's that are executed when
-;; eev is loaded. It appears here:
+;; It will show the "here links" to /tmp/FOO/BAR/PLIC/bletch at the
+;; window at the right.
 ;;
-;;   (find-eev "eev-code.el" "code-c-d-s")
+;; The _standard_ way to create a link to /tmp/FOO/BAR/PLIC/bletch is
+;; to run `find-here-links' - i.e., `M-h M-h' - and then choose one of
+;; the hyperlinks, and do mark, copy, and paste. But sometimes we want
+;; something faster.
 ;;
-;; Apparently there isn't a way to choose automatically which of the
-;; links in the `find-here-links' buffer is the best one - we always
-;; have to choose the "right" link by hand.
 ;;
 ;;
+;; 2. Converting `c's to `d's
+;; ==========================
+;; Remember that the arguments for a `code-c-d' are called "c" (for
+;; "code") and "d" (for "directory"),
 ;;
-;; 2. Our preferred link to here
-;; =============================
-;; This file implement a VERY HACKY way to choose the "right" link
-;; automatically and to save it to the kill ring. When the variable
+;;   (code-c-d "foo"  "/tmp/FOO/")
+;;   (code-c-d "bar"  "/tmp/FOO/BAR/")
+;;   (code-c-d "plic" "/tmp/FOO/BAR/PLIC/")
+;;   ;;         ^`c's  ^`d's
 ;;
-;;   ee-preferred-c
+;; We can run this to understand the code that the first `code-c-d'
+;; above runs,
 ;;
-;; is non-nil it says which `code-c-d' is the "best" one for this
-;; file; if you eval it above you will see that its value is "eev",
-;; that is the "c", i.e., the first argument, of this `code-c-d':
+;;   (find-code-c-d "foo"  "/tmp/FOO/")
 ;;
-;;   (code-c-d "eev" ee-eev-source-directory :anchor)
+;; and then we will see that there are two ways to convert the `c'
+;; "foo" to its corresponding `d', "/tmp/FOO/":
 ;;
-;; The "d" of that `code-c-d' is its second argument - the directory.
-;; The "d" for that "c" is stored in this variable:
+;;   ee-foodir
+;;   ;; --> "/tmp/FOO/"
+;;   (ee-foofile "BAR/PLIC/bletch")
+;;   ;; --> "/tmp/FOO/BAR/PLIC/bletch"
 ;;
-;;   ee-eevdir
 ;;
-;; so knowing the "c" is enough.
 ;;
-;; My favorite way to set the value of `ee-preferred-c' in a directory
-;; and in all its subdirectories is by using directory variables. See:
+;; 3. Shortening filenames
+;; =======================
+;; Try:
 ;;
-;;   (find-enode "Directory Variables")
-;;   (find-eev ".dir-locals.el")
+;;   (ee-kl-dir :c "foo")
+;;   (ee-kl-dir :c "bar")
+;;   (ee-kl-dir :c "plic")
+;;   (ee-kl-shortfname :c "foo"  :fname "/tmp/FOO/BAR/PLIC/bletch")
+;;   (ee-kl-shortfname :c "bar"  :fname "/tmp/FOO/BAR/PLIC/bletch")
+;;   (ee-kl-shortfname :c "plic" :fname "/tmp/FOO/BAR/PLIC/bletch")
+;;
+;; The functions `ee-kl-dir' and `ee-kl-shortfname' _sort of_ perform
+;; the opposite operations of `ee-{c}dir' and `ee-{c}file'. Try also
+;; this:
+;;
+;;   (ee-kl-sexp-klf :c "foo"  :fname "/tmp/FOO/BAR/PLIC/bletch")
+;;   (ee-kl-sexp-klf :c "bar"  :fname "/tmp/FOO/BAR/PLIC/bletch")
+;;   (ee-kl-sexp-klf :c "plic" :fname "/tmp/FOO/BAR/PLIC/bletch")
 ;;
+;; The three sexps above return these other sexps:
 ;;
+;;   (find-foofile "BAR/PLIC/bletch")
+;;   (find-barfile "PLIC/bletch")
+;;   (find-plicfile "bletch")
 ;;
-;; 3. Commands
+;; that are three different short hyperlinks to the file
+;; /tmp/FOO/BAR/PLIC/bletch.
+;;
+;;
+;;
+;; 4. Defaults
 ;; ===========
+;; When the functions `ee-kl-dir', `ee-kl-shortname', and
+;; `ee-kl-sexp-klf' above are called without keyword arguments they
+;; call certain functions to supply default values for those
+;; arguments. For example, this call
+;;
+;;   (ee-kl-sexp-klf)
+;;
+;; is equivalent to:
+;;
+;;   (ee-kl-sexp-klf :c (ee-kl-c) :fname (ee-kl-fname))
+;;
+;; The call to (ee-kl-fname) returns the file name of this file -
+;; nothing mysterious here - but the call to (ee-kl-c) returns the
+;; value of the variable `ee-preferred-c'.
+;;
+;;
+;;
+;; 5. `ee-preferred-c'
+;; ===================
+;; In short: in the example that we are discussing there are three
+;; possible sexp hyperlinks to this file:
+;;
+;;   /tmp/FOO/BAR/PLIC/bletch
+;;
+;; namely:
+;;
+;;   (find-foofile "BAR/PLIC/bletch")
+;;   (find-barfile "PLIC/bletch")
+;;   (find-plicfile "bletch")
+;;
+;; Each one is associated to a `c'. If `c' is "foo" we get the first
+;; one, if `c' is "bar" we get the second, and if `c' is "plic" we get
+;; the third one... and the value of the variavle `ee-preferred-c'
+;; determines which is these short hyperlinks should be preferred.
+;;
+;; Try:
+;;
+;;   (find-evardescr 'ee-preferred-c)
+;;
+;; you will get an explanation like this:
+;;
+;;   ee-preferred-c is a variable defined in ‘eev-kla.el’.
+;;
+;;   Its value is "eev"
+;;   Local in buffer eev-kla.el; global value is nil
+;;
+;;   See: (find-eev "eev-kla.el")
+;;
+;;     This variable’s value is directory-local, set by the file
+;;     ‘/home/edrx/eev-current/.dir-locals.el’.
+;;     This variable is safe as a file local variable if its value
+;;     satisfies the predicate ‘stringp’.
+;;
+;; and if you visit the .dir-locals.el file file mentioned above,
+;; with:
+;;
+;;   (find-eev ".dir-locals.el")
+;;
+;; you will see that it has a header, and then this:
+;;
+;;   ;; See: (find-eev "eev-kla.el" "intro")
+;;   ;;      (find-enode "Directory Variables")
+;;   ;;      (find-enode "Directory Variables" "a subdirectory (a string)")
+;;   ;;
+;;   (("" . ((nil . ((ee-preferred-c . "eev")))))
+;;    )
+;;
+;;
+;;
+;; 6. `add-dir-local-variable'
+;; ===========================
+;; When I started created my own ".dir-locals.el" files I found their
+;; syntax very hard to get right... but there's this:
+;;
+;;   (find-enode "Directory Variables" "M-x add-dir-local-variable")
+;;   (find-enode "Directory Variables" "M-x delete-dir-local-variable")
+;;   (find-efunctiondescr 'add-dir-local-variable)
+;;   (find-efunctiondescr 'delete-dir-local-variable)
+;;
+;; The manual only explains how to run those functions with `M-x'.
+;; People who prefer the run them from sexps can use this example as a
+;; starting point:
+;;
+;;   (mkdir "/tmp/foo/bar/" t)
+'    (find-2a nil ' (progn
+                     (find-fline "/tmp/foo/bar/.dir-locals.el")
+                     (add-dir-local-variable nil 'ee-preferred-c "foo")))
+'    (find-2a nil ' (progn
+                     (find-fline "/tmp/foo/bar/.dir-locals.el")
+                     (add-dir-local-variable nil 'ee-preferred-c "bar")))
+'    (find-2a nil ' (progn
+                     (find-fline "/tmp/foo/bar/.dir-locals.el")
+                     (delete-dir-local-variable nil 'ee-preferred-c)))
+;;
+;; Note that the three sexps starting with `find-2a's are three lines
+;; long each, and they are commented out with a "'" at the beginning
+;; of the line.
+;;
+;;
+;;
+;; 7. `eekla' and friends
+;; ======================
 ;; At the moment this file implements these commands:
 ;;
 ;;   1) `M-x eekla', that <K>ills a <L>ink to an <A>nchor.
@@ -146,157 +280,164 @@
 ;;
 ;;   4) `M-x eeklfs'
 ;;
-;;   3) `M-x ee-preferred-c-show', that shows the current directory
+;;   5) `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. Try:
 ;;
 ;;        (ee-preferred-c-show)
 ;;
-;; TODO: `M-x eekls', that <K>ills a <L>ink to a <S>tring.
-;;
-;;
+;; TODO: `M-x eeklt', that <K>ills a <L>ink made with (<T>o ...);
+;; rewrite `ee-preferred-c-show' - I deleted the old version.
 ;;
-;; 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:")
-
-
+;; 8. Aliases
+;; ==========
+;; TODO: write this.
 
 
 
-;; «ee-preferred-c»  (to ".ee-preferred-c")
+;; «variables»  (to ".variables")
 ;;
 (defvar ee-preferred-c nil
   "See: (find-eev \"eev-kla.el\")")
 
+(defvar ee-kl-format "%s"
+  "See: (find-eev \"eev-kla.el\")")
+
 ;;;###autoload
 (put   'ee-preferred-c 'safe-local-variable #'stringp)
 
-(defun ee-preferred-c-show ()
-  "Show the current value of `ee-preferred-c' at the window at the right."
-  (interactive)
-  (find-2a nil '(find-epp (list default-directory ee-preferred-c))))
+;;;###autoload
+(put   'ee-kl-format 'safe-local-variable #'stringp)
 
+(defun ee-kl-kill (sexp)
+  (if (not (stringp sexp))
+      (setq sexp (ee-S sexp)))
+  (kill-new (format ee-kl-format sexp))
+  (message "Copied to the kill ring: %s" sexp))
 
 
-;; «utils»  (to ".utils")
-;; Tests: (ee-kl-c)
-;;        (ee-kl-dir)
-;;        (ee-kl-fname)
-;;                   ee-edir
-;;        (ee-kl-dir   "e")
-;;                         (ee-efile "textmodes/fill.el")
-;;        (ee-kl-fname "e" (ee-efile "textmodes/fill.el"))
-;;
-;; TODO: add support for "living fossils" to ee-kl-fname.
-;; See: (find-angg-es-links 2 "and suffixes")
-;; Prototype: (find-angg ".emacs" "eev-kla-fossils")
 
+;; «simple-defaults»  (to ".simple-defaults")
+;; "Simple defaults" - the functions that generate sexps, below, call
+;; these functions when they don't receive keywords arguments. Tests:
+;;   (ee-kl-c)
+;;   (ee-kl-fname)
+;;   (ee-kl-anchor)
+;;   (ee-kl-region)
+;;
 (defun ee-kl-c ()
-  (or ee-preferred-c (error "`ee-preferred-c' is nil here!")))
-
-(defun ee-kl-dir (&optional c)
-  (ee-expand (eval (read (format "ee-%sdir" (or c (ee-kl-c)))))))
+  (if (not ee-preferred-c)
+      (error "`ee-preferred-c' is nil here!")
+    ee-preferred-c))
 
-(defun ee-kl-fname (&optional c fname)
-  (ee-remove-prefix (ee-kl-dir c) (ee-expand (or fname buffer-file-name))))
+(defun ee-kl-fname ()
+  (or (buffer-file-name) (default-directory)))
 
-;; Tests: (ee-kl-anchor)
-;;        (ee-kl-region)
-;;        (ee-kl-kill "(FOO \"BAR\")")
-;;
 (defun ee-kl-anchor ()
-  (ee-copy-preceding-tag-to-kill-ring))
+  (ee-preceding-tag-flash))
 
 (defun ee-kl-region ()
-  ; (if (not (use-region-p)) (error "The region is not active!"))
+  ;; (if (not (use-region-p)) (error "The region is not active!"))
   (buffer-substring-no-properties (point) (mark)))
 
-(defun ee-kl-kill (sexp)
-  (kill-new (concat sexp "\n"))
-  (message "Copied to the kill ring: %s" sexp))
-
-
-
-;; Tests:
-;;   (defun find-2ae (sexp) (find-2a nil `(find-estring ,sexp :end)))
-;;   (find-2ae ' (concat "FOO\n" "BAR") )
-;;   (find-2ae ' (ee-kla-sexp  "eev" "foo.el" "ANCHOR") )
-;;   (find-2ae ' (ee-klas-sexp "eev" "foo.el" "ANCHOR" "FOO\nBAR") )
-;;   (find-2ae ' (ee-klf-sexp  "eev" "foo.el") )
-;;   (find-2ae ' (ee-klfs-sexp "eev" "foo.el" "FOO\nBAR") )
-;;        
-(defun ee-kla-sexp (c fname anchor)
-  (format "(find-%s \"%s\" \"%s\")" c fname anchor))
-
-(defun ee-klas-sexp (c fname anchor str)
-  (format "(find-%s \"%s\" \"%s\" %s)" c fname anchor (ee-S str)))
-
-(defun ee-klf-sexp (c fname)
-  (format "(find-%sfile \"%s\")" c fname))
-
-(defun ee-klfs-sexp (c fname str)
-  (format "(find-%sfile \"%s\" %s)" c fname (ee-S str)))
-
-
-
-
-
-
-
-;;;            _    _       
-;;;   ___  ___| | _| | __ _ 
-;;;  / _ \/ _ \ |/ / |/ _` |
-;;; |  __/  __/   <| | (_| |
-;;;  \___|\___|_|\_\_|\__,_|
-;;;                         
-;; «eekla»  (to ".eekla")
-;; <K>ill <L>ink to <A>nchor,
-;; <K>ill <L>ink to <A>nchor and <S>tring,
-;; <K>ill <L>ink to <File>.
-;; <K>ill <L>ink to <File> and <S>tring.
-;; More precisely: produce a link to the preceding anchor and put it
-;; in the kill-ring.
-
-;; (eek "C-e 4*<left> C-SPC <<klas>>")
-
 
+;; «other-defaults»  (to ".other-defaults")
+;; "Other defaults" - same as above, but these ones
+;; accept keyword arguments. Tests:
+;;   (ee-kl-dir)
+;;   (ee-kl-shortfname)
+;;   (ee-kl-find-c)
+;;   (ee-kl-find-cfile)
+;;
+(cl-defun ee-kl-dir
+    (&key (c (ee-kl-c)))
+  (symbol-value (intern (format "ee-%sdir" c))))
+
+(cl-defun ee-kl-shortfname
+    (&key (c     (ee-kl-c))
+         (fname (ee-kl-fname)))
+  (ee-remove-prefix (ee-expand (ee-kl-dir :c c))
+                   (ee-expand fname)))
+
+(cl-defun ee-kl-find-c
+    (&key (c (ee-kl-c)))
+  (intern (format "find-%s" c)))
+
+(cl-defun ee-kl-find-cfile
+    (&key (c (ee-kl-c)))
+  (intern (format "find-%sfile" c)))
+
+
+;; «generate-sexps»  (to ".generate-sexps")
+;; Functions that generate sexps. Tests:
+;;   (ee-kl-sexp-kla)
+;;   (ee-kl-sexp-klas :region "foo")
+;;   (ee-kl-sexp-klf)
+;;   (ee-kl-sexp-klfs :region "foo")
+;;
+(cl-defun ee-kl-sexp-kla
+    (&key (c      (ee-kl-c))
+     &key (fname  (ee-kl-fname))
+     &key (anchor (ee-kl-anchor)))
+  (list (ee-kl-find-c :c c)
+       (ee-kl-shortfname :c c :fname fname)
+       anchor))
+
+(cl-defun ee-kl-sexp-klas
+    (&key (c      (ee-kl-c))
+     &key (fname  (ee-kl-fname))
+     &key (anchor (ee-kl-anchor))
+     &key (region (ee-kl-region)))
+  (list (ee-kl-find-c :c c)
+       (ee-kl-shortfname :c c :fname fname)
+       anchor
+       region))
+
+(cl-defun ee-kl-sexp-klf
+    (&key (c     (ee-kl-c))
+         (fname (ee-kl-fname)))
+  (list (ee-kl-find-cfile :c c)
+       (ee-kl-shortfname :c c :fname fname)))
+
+(cl-defun ee-kl-sexp-klfs
+    (&key (c      (ee-kl-c))
+         (fname  (ee-kl-fname))
+         (region (ee-kl-region)))
+  (list (ee-kl-find-cfile :c c)
+       (ee-kl-shortfname :c c :fname fname)
+       region))
+
+;; «kill-sexps»  (to ".kill-sexps")
+;; Commands that push sexps into the kill ring. Note that
+;; they are "(interactive)" and can be invoked with `M-x'.
+;;
 (defun eekla ()
   "<K>ill <L>ink to <A>nchor.
 Put in the kill ring a link to the preceding anchor."
   (interactive)
-  (ee-kl-kill (ee-kla-sexp (ee-kl-c) (ee-kl-fname) (ee-kl-anchor))))
+  (ee-kl-kill (ee-kl-sexp-kla)))
 
 (defun eeklas ()
   "<K>ill <L>ink to <A>nchor and <S>tring.
 Put in the kill ring a link to the preceding anchor."
   (interactive)
-  (ee-kl-kill (ee-klas-sexp (ee-kl-c) (ee-kl-fname) (ee-kl-anchor) 
(ee-kl-region))))
+  (ee-kl-kill (ee-kl-sexp-klas)))
 
 (defun eeklf ()
   "<K>ill <L>ink to <F>ile."
   (interactive)
-  (ee-kl-kill (ee-klf-sexp (ee-kl-c) (ee-kl-fname))))
+  (ee-kl-kill (ee-kl-sexp-klf)))
 
 (defun eeklfs ()
   "<K>ill <L>ink to <F>ile and <S>tring."
   (interactive)
-  (ee-kl-kill (ee-klfs-sexp (ee-kl-c) (ee-kl-fname) (ee-kl-region))))
+  (ee-kl-kill (ee-kl-sexp-klfs)))
+
+;; (eekla)
+
 
 
 
@@ -338,6 +479,7 @@ then run `eekla' in the next window, and save the result in
 ;; «demo»  (to ".demo")
 ;; See: (find-kla-test-intro)
 ;;      (find-kla-test-intro "2. Setup for a demo")
+;; TODO: rewrite this.
 
 (defun ee-kla-demo-write-file (fname contents)
   "See: (find-kla-test-intro)"
@@ -375,6 +517,7 @@ Body:
 
 
 
+
 ;; «aliases»  (to ".aliases")
 ;; I use these aliases:
 ;; (defalias 'kla  'eekla)
diff --git a/eev-tlinks.el b/eev-tlinks.el
index 9f991dd074..77cd047112 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:    20220625
+;; Version:    20220905
 ;; Keywords:   e-scripts
 ;;
 ;; Latest version: <http://angg.twu.net/eev-current/eev-tlinks.el>
@@ -653,6 +653,7 @@ Try this: (find-debpkg-links \"bash\")"
     (apply 'find-elinks `(
       ;; Convention: the first sexp always regenerates the buffer.
       (find-debpkg-links ,pkgname ,@rest)
+      (find-efunction 'find-debpkg-links)
       (find-available ,pkgname)
       ""
       ,@(ee-links-for-debpkg pkgname)
@@ -668,6 +669,9 @@ Try this: (find-debpkg-links \"bash\")"
 {ee-H}(find-sh \"apt search '{pkgname}*'\")
 {ee-H}(find-sh \"apt search '{pkgname}*' 2> /dev/null\")
 {ee-H}(find-sh \"grep-aptavail -P {pkgname}\")
+{ee-H}(find-sh \"grep-aptavail -P -s Package {pkgname}\")
+{ee-H}(find-sh \"grep-aptavail -P -s Package {pkgname} | sort\")
+{ee-H}(find-sh \"grep-aptavail -P -s Package,Version {pkgname}\")
 {ee-H}(find-sh \"dpkg-query -W '{pkgname}*'\")
 
 http://packages.debian.org/{pkgname}



reply via email to

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