[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to test a buttonizer
From: |
Eduardo Ochs |
Subject: |
How to test a buttonizer |
Date: |
Tue, 3 Jan 2023 00:26:03 -0300 |
Hi Jean Louis,
I was going to answer this in private, but my answer was getting very
long and very detailed, and I saw that I would prefer to send it to a
public place. So here is it.
1. Introduction
===============
I think that you will need several different buttonizing functions.
For most of the functions here
(find-eev "eev-elinks.el")
a simple algorithm will work, but try this one:
(find-ecolor-links "gold")
it has some weird sexps - try it! =) - and most of the functions here
(find-eev "eev-tlinks.el")
are even worse... for example, this one, that I will also mention
again later for other reasons,
(find-angg-es-links)
shows some multi-line sexps in the temporary buffer, and some lines
there end with things in parentheses like this one:
(fname &rest rest)
Should the buttonizer treat that as an elisp hyperlink? I don't know -
some people would accept using one that does, but some people would
hate one that buttonizes that argument list as a hyperlink...
2. find-find-links-links-new
============================
Practically all the functions in these two files
(find-eev "eev-elinks.el")
(find-eev "eev-tlinks.el")
are based on "skeletons" generated by `find-find-links-links-new'.
Try this, and try to run the sexps after the ";; Skel:"s:
(find-eevgrep "grep --color=auto -nH --null -e Skel: *.el")
The function `find-find-links-links-new' is explained in the first
part of this video here:
;; Title: Some template-based functions of eev that are not five-minute hacks
;; MP4: http://angg.twu.net/eev-videos/2020-some-template-based.mp4
;; YT: http://www.youtube.com/watch?v=91-9YfRPsuk
;; Page: http://angg.twu.net/2020-some-template-based.html
;; Comment:
;; Date: 2020dec24
;; Length: 33:11
;;
;; Play: (find-eevtemplvideo "0:00")
;; Info: (find-1stclassvideodef "eevtempl")
;; (find-eev "eev-videolinks.el" "eevtempl")
;; (find-1stclassvideo-links "eevtempl")
;;
;; Index: (find-1stclassvideoindex "eevtempl")
;; http://angg.twu.net/.emacs.videos.html#eevtempl
;; (find-angg ".emacs.videos" "eevtempl")
;; (find-angg-es-links)
I added subtitles to that video just a few days ago, in 2022-12-27.
Have you configured `find-angg' to use wget? If you haven't done that
yet, try to follow the instructions in the error message of the
(find-angg ___) sexp above...
If your `find-angg' is defined correctly then these two ways to read
the subtitles of that video without watching it will work:
http://angg.twu.net/SUBTITLES/2020-some-template-based.lua.html
(find-angg "SUBTITLES/2020-some-template-based.lua")
3. `find-elinks' and `find-elinks-elisp'
========================================
Some of the `find-*-links' functions in these two files
(find-eev "eev-elinks.el")
(find-eev "eev-tlinks.el")
use `find-elinks' in their cores, and some use `find-elinks-elisp',
that is very similar but also does something extra. Take a look at:
(find-efunction 'find-elinks)
(find-efunction 'find-elinks-elisp)
(find-efunction 'find-estring)
(find-efunction 'find-estring-elisp)
Try to create variants that also do something extra, but in which this
something extra is running one of your buttonizing functions.
4. Redefining standard functions
================================
This is a trick that I invented recently and that I find very useful.
When I redefine a function - usually in my init file - I always keep a
link to where the original function is, like this:
;; Original: (find-eev "eepitch.el" "eepitch-shell")
;; Version that uses zsh:
(defun eepitch-shell () (interactive) (eepitch-de '(shell)))
(defun eepitch-shell2 () (interactive) (eepitch-de '(shell "*shell 2*")))
(defun eepitch-shell3 () (interactive) (eepitch-de '(shell "*shell 3*")))
For example, let's suppose that you want to redefine eev's
`find-efunction-links' by a version that uses your
`find-elinks-buttonize1' instead of the default `find-elinks'. My
suggestion is: write the original function to one of your init files -
let's say ~/.emacs for simplicity - and change just its `find-elinks'
by a `find-elinks-buttonize1'. Also, put these two lines above its
definition:
;; Original: (find-eev "eev-elinks.el" "find-efunction-links")
;; Try also: (find-efunction 'find-efunction-links)
You will see that the link in the "Try also:" doesn't work well -
sometimes it will take you to your definition, one or two lines below
the "Try also:", instead of to the original definition, but the link
that says "Original:" will always work...
Please tell me if the hints above don't help you and/or if any of them
does not lead you to learn things that are interesting & fun.
Cheers =),
Eduardo
- How to test a buttonizer,
Eduardo Ochs <=