[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eev 3364428c93 1/2: Added `find-telegachatm'.
From: |
ELPA Syncer |
Subject: |
[elpa] externals/eev 3364428c93 1/2: Added `find-telegachatm'. |
Date: |
Tue, 19 Dec 2023 21:57:50 -0500 (EST) |
branch: externals/eev
commit 3364428c9312560c662149022fabe2fcf41b01f3
Author: Eduardo Ochs <eduardoochs@gmail.com>
Commit: Eduardo Ochs <eduardoochs@gmail.com>
Added `find-telegachatm'.
---
ChangeLog | 12 +++++
VERSION | 4 +-
eev-intro.el | 159 ++++++++++++++++++++++++++++++++++++++++++++--------------
eev-plinks.el | 57 ++++++++++++++++-----
eev-tlinks.el | 61 +++++++++++++++++++++-
5 files changed, 238 insertions(+), 55 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9ad38b5cff..a84d2a2f69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,19 @@
+2023-12-19 Eduardo Ochs <eduardoochs@gmail.com>
+
+ * eev-plinks.el (find-telegachat-msgc, ee-telegachat-msg0)
+ (ee-telegachat-msgc): new functions.
+ (find-telegachatm): new alias.
+
+2023-12-18 Eduardo Ochs <eduardoochs@gmail.com>
+
+ * eev-tlinks.el (find-homebrew-links): new function.
+ (ee-find-telegachat-links): added several entries.
+
2023-12-17 Eduardo Ochs <eduardoochs@gmail.com>
* eev-tlinks.el (show2-use, find-show2-use)
(ee-show2-do-with-fname0, ee-show2-use): new functions.
+ (code-show2, find-code-show2, ee-code-show2): deleted.
* eev-intro.el (find-show2-intro): added more sections.
diff --git a/VERSION b/VERSION
index aa5e175291..53dc0369a0 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-Mon Dec 18 02:34:19 GMT 2023
-Sun Dec 17 23:34:19 -03 2023
+Wed Dec 20 00:11:46 GMT 2023
+Tue Dec 19 21:11:46 -03 2023
diff --git a/eev-intro.el b/eev-intro.el
index b5f1a5c733..cddfde087d 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: 20231217
+;; Version: 20231218
;; Keywords: e-scripts
;;
;; Latest version: <http://anggtwu.net/eev-current/eev-intro.el>
@@ -16055,8 +16055,63 @@ that are displayed in a format like this one:
0 y + 1
+2. Dependencies
+===============
+Here we install some system-wide packages.
+This part is different for each OS and distro.
+
+
+2.1. Debian
+-----------
+ Make sure that we have the Debian packages that we need.
+ (eepitch-shell)
+ (eepitch-kill)
+ (eepitch-shell)
+sudo apt-get install build-essential
+sudo apt-get install lua5.1 lua5.1-doc lua5.1-dev
+sudo apt-get install lua5.2 lua5.2-doc lua5.2-dev
+sudo apt-get install lua-lpeg lua-lpeg-dev
+sudo apt-get install texlive-latex-extra
+
+ This will be used to build lpeglabel
+ (setenv \"LUA52DIR\" \"/usr/include/lua5.2\")
+
+ Define links to some manuals
+ (code-brappend \"lua51manual\"
\"file:///usr/share/doc/lua5.1-doc/doc/manual.html\")
+ (code-brappend \"lua52manual\"
\"file:///usr/share/doc/lua5.2-doc/manual.html\")
+ (code-brappend \"lpegmanual\"
\"file:///usr/share/doc/lua-lpeg-dev/lpeg.html\")
+ (code-brappend \"lpegremanual\"
\"file:///usr/share/doc/lua-lpeg-dev/re.html\")
+ Tests: (find-lua51manual)
+ (find-lua52manual)
+ (find-lpegmanual)
+ (find-lpegremanual)
+
+
+2.2. MacOS
+----------
+ Make sure that we have the Homebrew packages that we need.
+ (eepitch-shell)
+ (eepitch-kill)
+ (eepitch-shell)
+sudo port install lua-lpeg lua51-lpeg lua52-lpeg
+
+ This will be used to build lpeglabel
+ (setenv \"LUA52DIR\" \"/opt/local/include/lua5.2\")
+
+ Define links to some manuals
+ (code-brappend \"lua51manual\"
\"file:///opt/local/share/doc/lua51/html/manual.html\")
+ (code-brappend \"lua52manual\"
\"file:///opt/local/share/doc/lua52/html/manual.html\")
+ (code-brappend \"lpegmanual\"
\"http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html\")
+ (code-brappend \"lpegremanual\"
\"http://www.inf.puc-rio.br/~roberto/lpeg/re.html\")
+ Tests: (find-lua51manual)
+ (find-lua52manual)
+ (find-lpegmanual)
+ (find-lpegremanual)
+
-2. Installation (on Debian)
+
+
+3. Installation (on Debian)
===========================
Make sure that you have pdf-tools installed in Emacs.
@@ -16068,17 +16123,7 @@ that are displayed in a format like this one:
(package-install 'pdf-tools)
(find-epackage 'pdf-tools)
- Make sure that we have the Debian packages that we need
- (eepitch-shell)
- (eepitch-kill)
- (eepitch-shell)
-sudo apt-get install build-essential
-sudo apt-get install lua5.1 lua5.1-doc lua5.1-dev
-sudo apt-get install lua5.2 lua5.2-doc lua5.2-dev
-sudo apt-get install lua-lpeg lua-lpeg-dev
-sudo apt-get install texlive-latex-extra
-
- Clone the git repository
+ Clone the git repository with Show2.lua and friends.
See: https://github.com/edrx/show2-elpeg1#introduction
(eepitch-shell)
(eepitch-kill)
@@ -16087,26 +16132,14 @@ rm -Rfv /tmp/show2-elpeg1/
mkdir /tmp/show2-elpeg1/
cd /tmp/show2-elpeg1/
git clone https://github.com/edrx/show2-elpeg1 .
- (code-c-d \"show2\" \"/tmp/show2-elpeg1/\" :anchor)
- Test: (find-show2file \"\")
- (find-show2 \"\")
- (find-show2 \"README.org\")
-
- Links to some manuals
- (code-brappend \"lua51manual\"
\"file:///usr/share/doc/lua5.1-doc/doc/manual.html\")
- (code-brappend \"lua52manual\"
\"file:///usr/share/doc/lua5.2-doc/manual.html\")
- (code-brappend \"lpegmanual\"
\"file:///usr/share/doc/lua-lpeg-dev/lpeg.html\")
- (code-brappend \"lpegremanual\"
\"file:///usr/share/doc/lua-lpeg-dev/re.html\")
- Test: (find-lua51manual)
- (find-lua52manual)
- (find-lpegmanual)
- (find-lpegremanual)
- Download and compile lpegrex and lpeglabel.
- I couldn't make their rocks work, so...
- (eepitch-shell)
- (eepitch-kill)
- (eepitch-shell)
+ Clone the git repositories of lpegrex and lpeglabel
+ inside /tmp/show2-elpeg1/. Notes:
+ 1) lpegrex depends on lpeglabel
+ 2) lpeglabel needs to be compiled
+ 3) lpeglabel doesn't work on Lua5.1, so we use Lua5.2
+ 4) the (lua)rocks for lpegrex and lpeglabel don't work
+ 5) I only use lpegrex in a few examples, and for comparisons
rm -Rfv /tmp/show2-elpeg1/lpeglabel
rm -Rfv /tmp/show2-elpeg1/lpegrex
cd /tmp/show2-elpeg1/
@@ -16115,21 +16148,43 @@ git clone https://github.com/edubart/lpegrex
cd /tmp/show2-elpeg1/lpeglabel/
make LUADIR=/usr/include/lua5.2 2>&1 | tee om
+ Define links to some directories and manuals
+ (code-c-d \"show2\" \"/tmp/show2-elpeg1/\" :anchor)
+ (code-brappend \"lua51manual\"
\"file:///usr/share/doc/lua5.1-doc/doc/manual.html\")
+ (code-brappend \"lua52manual\"
\"file:///usr/share/doc/lua5.2-doc/manual.html\")
+ (code-brappend \"lpegmanual\"
\"file:///usr/share/doc/lua-lpeg-dev/lpeg.html\")
+ (code-brappend \"lpegremanual\"
\"file:///usr/share/doc/lua-lpeg-dev/re.html\")
+ Tests: (find-show2file \"\")
+ (find-show2 \"LUA/\")
+ (find-show2 \"LUA/Show2.lua\" \"introduction\")
+ (find-show2 \"LUA/lua50init.lua\")
+ (find-lua51manual)
+ (find-lua52manual)
+ (find-lpegmanual)
+ (find-lpegremanual)
+
Make some ennvironment variables point to /tmp/show2-elpeg1/
(setenv \"SHOW2LUADIR\" \"/tmp/show2-elpeg1/LUA\")
(setenv \"SHOW2LATEXDIR\" \"/tmp/show2-elpeg1/LATEX\")
(setenv \"LUA_INIT\" \"@/tmp/show2-elpeg1/LUA/lua50init.lua\")
(setenv \"LUA_PATH\" \"/tmp/show2-elpeg1/LUA/?.lua;;\")
- Test:
+ In show2-elpeg1 the Path.addLUAtopath() below is defined as a no-op.
+ See: (find-show2 \"LUA/lua50init.lua\" \"Path.addLUAtopath\")
+
+ Test if the init file and \"require\" both work.
+ See: (find-show2 \"LUA/Tos2.lua\")
(eepitch-lua51)
(eepitch-kill)
(eepitch-lua51)
PP({10,20,\"30\",d=40})
+Path.addLUAtopath()
+= Path.from \"path\"
require \"Tos2\"
PPC(Tos.__index)
- Test lpegrex: first test
+ Test lpegrex: first test (boring).
+ Hint: no errors good, errors bad.
(eepitch-lua52)
(eepitch-kill)
(eepitch-lua52)
@@ -16141,7 +16196,7 @@ require \"tests/csv-test\"
arg = {\"/home/edrx/usrc/lpegrex/examples/lua-ast.lua\"}
require \"examples/lua-ast\"
- Test lpegrex: second test
+ Test lpegrex: check if loadlpegrex works
(eepitch-lua52)
(eepitch-kill)
(eepitch-lua52)
@@ -16251,10 +16306,6 @@ body = [[ HELLO ]]
= Show.log
= Show.bigstr
-The \"\" in the first line makes the <f8> treat it as comment,
-but if you execute it with `M-e' you will get a temporary buffer
-with a detailed explanation of what the `(code-show2 ...)' does.
-
The two \"body = ...\" lines let you choose between \"HELLO\",
that is valid LaTeX code, and \"\\HELLO\", that will yield an
error. Choosing is explained here:
@@ -16303,6 +16354,36 @@ EmacsConf2023:
+3.4. Dednat6
+------------
+Some of the test blocks in this directory
+
+ (find-show2 \"LUA/\")
+
+need to save their .tex files in a specific directory - this one,
+
+ (find-show2 \"LATEX/\")
+ (find-fline \"$SHOW2LATEXDIR/\")
+
+because their .tex files need to load files that are there. Try
+to run this test block:
+
+ (find-show2 \"LUA/Verbatim3.lua\" \"dednat6-tests\")
+
+The line with the \":show0()\" in the test block shows the
+contents of the .tex file. You will see that it contains several
+lines that start with \"\\input\" and some lines that load
+Dednat6, that is explained here:
+
+ (find-eev2023replsvideo \"20:52\")
+ (find-eev2023replslsubs \"20:52\")
+ http://anggtwu.net/dednat6/tug-slides.pdf
+
+
+
+
+
+
4. ELpeg1.lua
=============
To be written! See:
diff --git a/eev-plinks.el b/eev-plinks.el
index c512101698..8c56b11e5b 100644
--- a/eev-plinks.el
+++ b/eev-plinks.el
@@ -19,7 +19,7 @@
;;
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;; Maintainer: Eduardo Ochs <eduardoochs@gmail.com>
-;; Version: 20230717
+;; Version: 20231219
;; Keywords: e-scripts
;;
;; Latest version: <http://anggtwu.net/eev-current/eev-plinks.el>
@@ -111,16 +111,17 @@
;; (find-eev "eev-brxxx.el")
-;; «.find-urlretrieve» (to "find-urlretrieve")
-;; «.find-wget» (to "find-wget")
-;; «.find-anggwget» (to "find-anggwget")
-;; «.find-anggwgeta» (to "find-anggwgeta")
-;; «.find-gitk» (to "find-gitk")
-;; «.find-tkdiff» (to "find-tkdiff")
-;; «.find-osm» (to "find-osm")
-;; «.find-telegachat» (to "find-telegachat")
-;; «.find-firefox» (to "find-firefox")
-;; «.find-googlechrome» (to "find-googlechrome")
+;; «.find-urlretrieve» (to "find-urlretrieve")
+;; «.find-wget» (to "find-wget")
+;; «.find-anggwget» (to "find-anggwget")
+;; «.find-anggwgeta» (to "find-anggwgeta")
+;; «.find-gitk» (to "find-gitk")
+;; «.find-tkdiff» (to "find-tkdiff")
+;; «.find-osm» (to "find-osm")
+;; «.find-telegachat» (to "find-telegachat")
+;; «.find-telegachat-msgc» (to "find-telegachat-msgc")
+;; «.find-firefox» (to "find-firefox")
+;; «.find-googlechrome» (to "find-googlechrome")
@@ -488,10 +489,40 @@ viewer - installed for this to work, and Emacs 28 or
later."
;; (find-telegachat "@emacs_posts" "Emacs News and Posts")
;; See: (find-eev "eev-tlinks.el" "find-telegachat-links")
;;
-(defun find-telegachat (name &rest rest)
- (let ((url (format "tg:telega:%s" name)))
+(defun find-telegachat (idn &rest rest)
+ "Go to a Telega buffer or to a message in a Telega buffer.
+When IDN is just the name of the numeric id of a Telegram
+channel, like \"@emacs_telega\", just go to the buffer of that
+channel, starting Telega and opening that channel if needed; when
+IDN also has a message number, like in \"@emacs_telega#43590\",
+also go to that message and highlight it."
+ (let ((url (format "tg:telega:%s" idn)))
(find-dbsw-call `(telega-tme-open-tg ,url))))
+;; «find-telegachat-msgc» (to ".find-telegachat-msgc")
+;; Tests: (find-telegachat "@emacs_telega#43594")
+;; (find-telegachat-msgc "@emacs_telega#43594")
+;; (find-eppp (ee-telegachat-msg0 "@emacs_telega#43594"))
+;; (find-estring (ee-telegachat-msgc "@emacs_telega#43594"))
+;;
+(defun find-telegachat-msgc (idn &rest rest)
+ "Like `find-telegachat', but shows the contents of the message."
+ (apply 'find-estring (ee-telegachat-msgc idn) rest))
+
+(defalias 'find-telegachatm 'find-telegachat-msgc)
+
+(defun ee-telegachat-msg0 (idn)
+ "An internal function used by `find-telegachat-msgc'."
+ (save-window-excursion
+ (find-telegachat idn)
+ (telega-msg-at (point))))
+
+(defun ee-telegachat-msgc (idn)
+ "An internal function used by `find-telegachat-msgc'."
+ (telega-msg-content-text (ee-telegachat-msg0 idn)))
+
+
+
;; «find-firefox» (to ".find-firefox")
;; «find-googlechrome» (to ".find-googlechrome")
diff --git a/eev-tlinks.el b/eev-tlinks.el
index 3d00bd70e2..e28a827a17 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: 20231217
+;; Version: 20231219
;; Keywords: e-scripts
;;
;; Latest version: <http://anggtwu.net/eev-current/eev-tlinks.el>
@@ -89,6 +89,7 @@
;; «.find-eev-header-links» (to "find-eev-header-links")
;;
;; «.find-debpkg-links» (to "find-debpkg-links")
+;; «.find-homebrew-links» (to "find-homebrew-links")
;; «.find-eev-install-links» (to "find-eev-install-links")
;; «.find-eev-update-links» (to "find-eev-update-links")
;; «.find-youtubedl-links» (to "find-youtubedl-links")
@@ -739,6 +740,52 @@ dpkg-query --search {pkgname}
+;;; _ _ _
+;;; | | | | ___ _ __ ___ ___| |__ _ __ _____ __
+;;; | |_| |/ _ \| '_ ` _ \ / _ \ '_ \| '__/ _ \ \ /\ / /
+;;; | _ | (_) | | | | | | __/ |_) | | | __/\ V V /
+;;; |_| |_|\___/|_| |_| |_|\___|_.__/|_| \___| \_/\_/
+;;;
+;; «find-homebrew-links» (to ".find-homebrew-links")
+;; Skel: (find-find-links-links-new "homebrew" "pkg" "")
+;; Tests: (find-homebrew-links)
+;; (find-homebrew-links "lpeg")
+;;
+(defun find-homebrew-links (&optional pkg &rest pos-spec-list)
+"Visit a temporary buffer containing hyperlinks for homebrew."
+ (interactive)
+ (setq pkg (or pkg "{pkg}"))
+ (apply
+ 'find-elinks
+ `((find-homebrew-links ,pkg ,@pos-spec-list)
+ ;; Convention: the first sexp always regenerates the buffer.
+ (find-efunction 'find-homebrew-links)
+ ""
+ ,(ee-template0 "\
+# (find-sh \"port contents {pkg}\")
+# (find-sh \"find /opt/local | grep {pkg} | sort\")
+# (find-sh \"port echo all | grep {pkg} | sort\")
+# (find-sh \"port echo installed\")
+# (find-sh \"port help echo\")
+# (find-sh \"port help contents\")
+# (find-sh \"port help provides\")
+# (find-sh \"port provides /opt/local/an/existing/file\")
+# (find-man \"1 port\")
+# https://formulae.brew.sh/formula/{pkg}
+# https://formulae.brew.sh/formula/lua@5.1#default
+# https://ports.macports.org/port/{pkg}/
+
+ (eepitch-shell)
+ (eepitch-kill)
+ (eepitch-shell)
+sudo port install {pkg}
+sudo brew install {pkg}
+")
+ )
+ pos-spec-list))
+
+
+
;;; __ _ _ _ _ _ _ _
;;; / _(_)_ __ __| | __| |___ ___| |__ _ _(_) | __| |
;;; | |_| | '_ \ / _` |_____ / _` / __|/ __| '_ \| | | | | |/ _` |
@@ -773,6 +820,9 @@ dpkg-query --search {pkgname}
(downcase (format-time-string "%Y%b%d"))
(ee-dsc-url-split dsc-url)))
+;; Note: this is VERY OLD - it uses bounded regions,
+;; that I haven't used in ages... see:
+;; (find-bounded-intro)
(defun ee-links-for-dscbuild0 (date prot dir/ xxx vvv -sv)
(ee-template
'(date prot dir/ xxx vvv -sv) "\
@@ -3712,19 +3762,26 @@ This doesn't support pos-spec lists yet."
(find-telegachat ,atusername ,title)
(find-telegachat ,atusernamen)
(find-telegachat ,atusernamen ,title)
+ (find-telegachatm ,atusernamen)
(find-telegachat ,id)
(find-telegachat ,id ,title)
(find-telegachat ,idn)
(find-telegachat ,idn ,title)
+ (find-telegachatm ,idn)
""
(find-ebuffer ,bufname)
(setq tcbuf ,bufname)
(setq tcchat (with-current-buffer tcbuf telega-chatbuf--chat))
+ (setq tcmsg (with-current-buffer tcbuf (telega-msg-at (point))))
+ (setq tcmsgc (plist-get (plist-get (plist-get tcmsg :content) :text)
:text))
+ (setq tcmsgc (ee-no-properties (telega-msg-content-text tcmsg)))
(telega-tme-internal-link-to tcchat)
(find-eppp tcchat)
(plist-get tcchat :chat_id)
(plist-get tcchat :title)
(plist-get tcchat :id)
+ (find-eppp tcmsg)
+ (find-estring tcmsgc)
)))
(defun ee-telega-msgn (&optional msg)
@@ -4523,6 +4580,8 @@ Some of the Lua modules in (find-show2-intro) use
`find-luatb'."
;;
;; «code-brappend» (to ".code-brappend")
;; Skel: (find-code-xxx-links "brappend" "c url f" "")
+;; Test: (code-brappend "foomanual" "file:///tmp/foobarmanual.html" 'list)
+;; (find-foomanual "#section-2" "bla")
(defun code-brappend (c url &optional f)
(eval (ee-read (ee-code-brappend c url f))))