branch: externals/eev commit 57c351e141e348f500dd892f86cc78f633ecde0a Author: Eduardo Ochs <eduardoo...@gmail.com> Commit: Eduardo Ochs <eduardoo...@gmail.com>
Added the ee-ffll-functions (for `find-find-links-links-new'). --- ChangeLog | 5 +++ VERSION | 4 +- eev-code.el | 5 +++ eev-tlinks.el | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 125 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0dc4c4b..82e658d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-01-05 Eduardo Ochs <eduardoo...@gmail.com> + + * eev-code.el: added `(code-c-d "elpa" "~/.emacs.d/elpa/")' - + `find-epackage-links' depends on this. + 2020-01-04 Eduardo Ochs <eduardoo...@gmail.com> * eev-intro.el (find-templates-intro): rewrote the whole intro. diff --git a/VERSION b/VERSION index c27b890..b3f8103 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -Sun Jan 5 17:58:04 GMT 2020 -Sun Jan 5 14:58:04 -03 2020 +Tue Jan 7 21:18:50 GMT 2020 +Tue Jan 7 18:18:50 -03 2020 diff --git a/eev-code.el b/eev-code.el index 072531d..1ed79d7 100644 --- a/eev-code.el +++ b/eev-code.el @@ -338,9 +338,14 @@ Note: the POS-SPEC-LIST arguments are currently not used." ;; (find-equailfile "") ;; (find-equailfile "latin-ltx.el") +;; Debian: (code-c-d "ud" "/usr/share/doc/" :gz) ; (find-udfile "bash/") (code-c-d "vldi" "/var/lib/dpkg/info/") ; (find-vldifile "bash.list") +;; Used by `find-epackage-links': +(code-c-d "elpa" "~/.emacs.d/elpa/") +;; (find-elpafile "") + (provide 'eev-code) diff --git a/eev-tlinks.el b/eev-tlinks.el index a277c0d..4273827 100644 --- a/eev-tlinks.el +++ b/eev-tlinks.el @@ -19,7 +19,7 @@ ;; ;; Author: Eduardo Ochs <eduardoo...@gmail.com> ;; Maintainer: Eduardo Ochs <eduardoo...@gmail.com> -;; Version: 2020jan02 +;; Version: 2020jan07 ;; Keywords: e-scripts ;; ;; Latest version: <http://angg.twu.net/eev-current/eev-tlinks.el> @@ -58,6 +58,8 @@ ;; «.ee-copy-rest» (to "ee-copy-rest") ;; ;; «.find-find-links-links» (to "find-find-links-links") +;; «.ee-ffll-functions» (to "ee-ffll-functions") +;; ;; «.find-intro-links» (to "find-intro-links") ;; «.find-pdflikedef-links» (to "find-pdflikedef-links") ;; «.find-eev-header-links» (to "find-eev-header-links") @@ -206,9 +208,8 @@ See: (find-eev \"eev-tlinks.el\" \"ee-copy-rest\")" ;;; ;; ;; «find-find-links-links» (to ".find-find-links-links") -;; See: -;; (find-eev "eev-template.el" "find-find-links-links") -;; (find-find-links-links "u" "find-links" "k stem args") +;; See: (find-templates-intro "horrible" "kludge") +;; Test: (find-find-links-links "u" "find-links" "k stem args") (defun ee-prepend-commas (str) (save-match-data @@ -266,6 +267,114 @@ This is an internal function used by `find-{stem}-links'.\" + + +;;; __ __ _ _ _ +;;; ___ ___ / _|/ _| | | | __/\__ +;;; / _ \/ _ \_____| |_| |_| | | |_____\ / +;;; | __/ __/_____| _| _| | | |_____/_ _\ +;;; \___|\___| |_| |_| |_|_|_| \/ +;;; +;; «ee-ffll-functions» (to ".ee-ffll-functions") +;; Low-level functions used by find-find-links-links-new. +;; +;; The original `find-find-links-links' whas a horrible kludge. +;; See: (find-templates-intro "horrible" "kludge") +;; This is an attempt to rewrite it. +;; It was inspired by discussions with Marc Simpson. +;; Version (of the ee-ffll-functions and find-find-links-links-new): +;; 2020jan07. +;; Status: `find-find-links-links-new' doesn't exist yet, but the +;; tests below work. + +;; Tests: +;; (ee-ffll-optional "") +;; (ee-ffll-optional "foo bar") +;; (ee-ffll-comma-args "plic bletch") +;; (find-estring (ee-ffll-setqs " " "foo bar")) +;; (find-estring (ee-ffll-lets " " "foo bar")) +;; (find-estring-elisp (ee-ffll-defun-without-lets "mytask" "foo bar")) +;; (find-estring-elisp (ee-ffll-defun-with-lets "mytask" "foo bar" "plc bltch")) +;; (find-estring-elisp (ee-ffll-defun "mytask" "foo bar")) +;; (find-estring-elisp (ee-ffll-defun "mytask" "foo bar" "plic bletch")) +;; +(defun ee-ffll-optional (args) + (if (< 0 (length (split-string args))) + (concat "&optional " args " ") + "")) + +(defun ee-ffll-setqs (spaces args) + (mapconcat (lambda (arg) (format "%s(setq %s (or %s \"{%s}\"))\n" + spaces arg arg arg)) + (split-string args) + "")) + +(defun ee-ffll-lets (spaces vars) + (format "let* (%s)" + (mapconcat (lambda (var) (format "(%s \"{%s}\")" var var)) + (split-string vars) + (concat "\n" spaces " ")))) + +(defun ee-ffll-comma-args (args) + (mapconcat (lambda (arg) (format ",%s " arg)) + (split-string args) + "")) + +(defun ee-ffll-defun-without-lets (stem args) + (let* ((optional (ee-ffll-optional args)) + (setqs (ee-ffll-setqs " " args)) + (comma-args (ee-ffll-comma-args args)) + ) + (ee-template0 "\ +(defun find-{stem}-links ({optional}&rest pos-spec-list) +\"Visit a temporary buffer containing hyperlinks for {stem}.\" + (interactive) +{setqs}\ + (apply + 'find-elinks + `((find-{stem}-links {comma-args},@pos-spec-list) + ;; Convention: the first sexp always regenerates the buffer. + (find-efunction 'find-{stem}-links) + \"\" + ,(ee-template0 \"\\ +\") + ) + pos-spec-list)) +"))) + +(defun ee-ffll-defun-with-lets (stem args vars) + (let* ((optional (ee-ffll-optional args)) + (setqs (ee-ffll-setqs " " args)) + (comma-args (ee-ffll-comma-args args)) + (lets (ee-ffll-lets " " vars)) + ) + (ee-template0 "\ +(defun find-{stem}-links ({optional}&rest pos-spec-list) +\"Visit a temporary buffer containing hyperlinks for {stem}.\" + (interactive) +{setqs}\ + ({lets} + (apply + 'find-elinks + `((find-{stem}-links {comma-args},@pos-spec-list) + ;; Convention: the first sexp always regenerates the buffer. + (find-efunction 'find-{stem}-links) + \"\" + ,(ee-template0 \"\\ +\") + ) + pos-spec-list))) +"))) + +(defun ee-ffll-defun (stem args &optional vars) + (if (equal vars "") (setq vars nil)) + (if vars (ee-ffll-defun-with-lets stem args vars) + (ee-ffll-defun-without-lets stem args))) + + + + + ;;; _ _ _ _ _ ;;; (_)_ __ | |_ _ __ ___ | (_)_ __ | | _____ ;;; | | '_ \| __| '__/ _ \ _____| | | '_ \| |/ / __|