eev
[Top][All Lists]
Advanced

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

Re: Proposals for purposes and usage examples


From: Jean Louis
Subject: Re: Proposals for purposes and usage examples
Date: Sun, 8 Jan 2023 02:05:07 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Eduardo Ochs <eduardoochs@gmail.com> [2023-01-07 03:25]:
> can Hyperbole be used to "automate" downloading a source package
> and compiling it?

It can be set for anything, it provides a way of unification of what
user wants. Same can be said for Emacs Lisp or eev, etc.

eev is lower level, Emacs Lisp based system. It does things simpler as
it allowes more information to be invoked or jumped to it,
automatizing is part of it too.

Emacs has now functions:

package-vc-install
package-vc-install-from-checkout

so that means you can install straight from sources on Internet.

> You said in a previous e-mail that you found its docs well
> written...

Not so general, I found it's introduction and usage well written. 

I recommend you to provide:

1. Introduction
2. Usage

instead of

1. Installation Instruction

> if I remember correctly I found them so confusing that it took me
> two evenings just to learn how to use the {...} buttons that execute
> sequences of keys - so I know very little about Hyperbole...

I use Hyperbole since 2 decades and never finished learning it.

> How would you translate this to Hyperbole? First run the script here
> to make sure that you have a copy of the source code of that version
> of Lua - it's just 200KB,
> 
>   (find-psne-links "http://www.lua.org/ftp/lua-5.1.5.tar.gz";)
> 
> and then run this second part with <f8>s:
> 
> • (eepitch-shell)
> • (eepitch-kill)
> • (eepitch-shell)
>   rm -Rfv /tmp/lua-5.1.5/
>   mkdir   /tmp/lua-5.1.5/
>   tar  -C /tmp/ -xvzf $S/http/www.lua.org/ftp/lua-5.1.5.tar.gz
>   cd      /tmp/lua-5.1.5/
> 
>   find * -name '*.[ch]' | sort > .files.ch
>   etags $(<.files.ch)
>   make linux test local 2>&1 | tee omltl
>   ./bin/lua -e 'print(2+3)'
> 
> To be more precise: how would you use Hyperbole to "automate" that
> second part?

It is possible to use it just in similar way as eev, but needs
programming it. You could do anything, it is about using M-RET action
key for anything.

Recently I started playing to unify commands on one key, that is good
exercise, and I continually use it. Now without Hyperbole.

So I would go this way:

- define thing at point eepitch-this-line

- use M-RET to invoke that function

- if previous lines where with thing at point eepitch-this-line

- (without empty line), then
  execute each subsequent line with M-RET until empty line

> Again: I know very little about Hyperbole. Basically, I know that
> rsw repeats all the time that "Hyperbole keeps everything simple",
> but it wasn't simple for me.

Ha ha ha, that is right.

I told you about that effect. Yes, rsw has very good sales pitch, and
they are both kind people, but their information is not really easy to
grasp. 

Both for eev, and for Hyperbole and for me, when referring to abstract
things, including for Doug Engelbart.

But when reader starts entering into the knowledge, then one can find
useful concepts.

Apropos concepts
----------------

Did you see my inquiry on GNU Emacs Help mailing list about
invoking-buffer concept?

I use it now, as the ordinary "previous-buffer" concept is not good
enough.

I think same applies for Hyperbole, for eev, and many other
applications.

If I am now in mail-mode and write e-mail, maybe I wish to find some
note, right? Or inject in this mode, or do something else, but then
whatever I invoked, I wish to remove and come back to mail-mode.

How is that useful?

It is similar to M-k in eev, but M-k wants to kill buffer. I don't
like it.

If I go to eev buffer, and from there to other buffer, and other, but
come back to one invoked by eev, and then press M-k, buffer is killed
and I do not find myself in the invoked buffer (eev-beginner) but in
some other.

Solution is this:

(defvar-local rcd-invoking-buffer nil
  "Name of the invoking buffer.")
(put 'rcd-invoking-buffer 'permanent-local t)

When invoking eev or any buffer, setup variable `rcd-invoking-buffer',
that means during using M-e, when new buffer is generated.

Then bind M-k or `q' to this:

(defun rcd-back-to-invoking-buffer-or-quit ()
  (interactive)
  (cond ((buffer-live-p rcd-invoking-buffer)
         (cond ((get-buffer-window rcd-invoking-buffer) 
                ;; if `rcd-invoking-buffer' exists as window (displayed), go 
there: 
                (cond ((equal (current-buffer) (get-buffer rcd-invoking-buffer))
                       ;; if invoking buffer is current buffer, just quit-window
                       (quit-window))n
                      (t (switch-to-buffer-other-window rcd-invoking-buffer))))
                       ;; otherwise show the invoking buffer
               (t (switch-to-buffer rcd-invoking-buffer))))
                ;; but if it is not as window, go to invoking buffer
        (t (quit-window))))
        ;; or if invoking buffer does not exist, quit window

I could also include to have the function in variable on how to invoke
the invoking buffer.

That means even if eev-beginner window is not there any more, by using
M-k one would return to the invoking buffer, and if such does not
exist, it would be re-created by using the variable holding function
to run.

I think eev needs that.

> I know that for most people in Uganda internet is very expensive, but
> how is it for you?  I asked you to either watch the part of this one
> that starts at 13:10 or to read its subtitles starting from 13:10...
> that video is 19:21 long, and its .mp4 is 56MB...

I am reader of text.

> > I was the test person, I read that introduction and is not enough. I
> > can't gain understanding.
> 
> Here it goes, in capitals:
> 
>   Then STOP TRYING
>   TO UNDERSTAND IT
>   BY READING!!!!!!

See, I am reader of text. 

> Either try more "Try it"s in the tutorial or watch the demo in my
> presentation in the EmacsConf2019.

I watched.

 Compare the situation with learning
> what is a Turing machine in the early 80s versus playing a
> coin-operated video games in the early 80s - Donkey Kong, say, or Qix.
> It is VERY HARD to imagine that a video game can be fun, and how fun
> it can be, by just learning what a Turing machine can do and trying to
> imagine a video game, or by reading an _objective_ description of what
> a video game _is_ or what a video game _does_.
> 
> The slides of my presentation at the EmacsConf 2019, that are in the
> second link below,
> 
>   http://angg.twu.net/emacsconf2019.html
>   http://angg.twu.net/LATEX/2019emacsconf.pdf

The PDF is useful, it tells about three important keys, jumping,
coming back, generating temporary buffers.

> > I understand it is for you. Though it is too general. Automating
> > everything is good in general, but does not tell what eev does.
> 
> Then: eev doesn't do anything by itself. Emacs comes with C-x C-e,
> i.e., eval-last-sexp, that is incredibly powerful, but that power is
> not immediately obvious to everyone. Eev makes that power slightly
> more accessible.

That is so much right.

I often use functions in writing to generate snippets of text,
especially calculations. 

We know that 2 + 2 = (+ 2 2)X <-- at X execute function to replace
sexp with it's result. That is very useful feature that work in every
mode.

> I've met at least two persons - my sister and one ex-internet friend
> - who thought that a monochrome screen with an unfontified sexp was
> something so repulsive that they couldn't stare at that for more
> than a few seconds with complaining or running away. Eev is
> certainly not for them - and so, by consequence, eev is not for
> everyone.

That is matter of habit.

I use mutt email reader, and it was in colors, and now I find it
pleasant in black-white mode. Styling depends on person.

> > Executable log -- I do not understand as there is no clear example.
> >
> > If it is log, there must be preceding action. Action example is not
> > explained.
> 
> In the demo at the end of my presentation at the EmacsConf 2019 I did
> not show how I "record" executable notes, only how I "play them back".
> In the video below, that I subtitled just a few days ago, and that is
> 18:22 long and takes 56MB, I show almost in real time how I record
> executable notes that are made only of elisp hyperlinks:
> 
>    Info:  (find-1stclassvideo-links "2021workshop3")

I also "save links to everything what is interesting". That is great
concept.

I am sure you know that M-0 is same as C-u 0 or C-0.

For your (eek "M-j") sorting:

(defun eejump-1 () (find-fline "~/TODO"))
(defun eejump-10 () (set-frame-font "5x7" t))
(defun eejump-11 () (set-frame-font "6x13" t))
(defun eejump-12 () (set-frame-font "10x20" t))

Just pad it with 0, and you will get correct sorting.

> Yes. But I've learned how create logs almost in real time - this is
> explained here:

I have feeling that you may thinkg of "logs" as something else then
what I think.

My logs look similarly like this:

 40239 Word query: greedy                                                     
Word Lookup
 40240 Function `msmtp-count-remaining' invoked                               
Emacs Lisp Function
 40241 Function `msmtp-count-remaining' invoked                               
Emacs Lisp Function
 40242 emacs: message sent                                                    
Default
 40243 Function `cf-people-by-id-list' invoked                                
Emacs Lisp Function
 40244 Function `cf-people-by-id-list' invoked                                
Emacs Lisp Function
 40245 Function `msmtp-count-remaining' invoked                               
Emacs Lisp Function

and single entry looks like:

                             ID   40246
                   Date created   "2023-01-08 00:52:35.616385"
                  Date modified   nil
                   User created   "maddox"
                  User modified   "maddox"
                 List of people   nil
                        Contact   "Jean Louis"
                       Business   nil
                    Assigned to   nil
                      Time zone   nil
                           Date   "2023-01-08 00:52:35.616385"
                           Time   nil
                          Title   "Function `cf-people-by-id-list' invoked"
                    Description   nil
                        Publish   nil
                  Hyperdocument   nil
                            Key   nil
                       Log type   "Emacs Lisp Function"

I can actually re-create what I was doing at some day, how much I was
working, and so on. 

There is no thinking involved, log is automatic.

What is log for you?

> > Exercise
> > --------
> >
> > 1. Provide me three actions that you do
> >
> > 2. Show how is executable log created for those actions
> >
> > 3. Show how to execute the log and replay the actions
> 
> Start by the ones above - I need to know which ones are clear and
> which ones are not before giving you more complex executable logs and
> instructions in text...

After watching video, which is understandable, I can see:

- that you move to some buffer, or file
- come back to your notes buffer or file
- insert and write functions which refer to other buffers or file or information

My understanding raised.

There is also surprise moment. Do you wish to know about it?
------------------------------------------------------------

It is not easy believable that you have to write function for each
reference. Why waste time when you already use keys.

What you do, how I understand is, you are capturing bookmarks that
lead to information. But you capture such bookmarks by using marking,
region, then writing the eev functions in notes buffer. Am I right so
far?

And why not using this shorter workflow:

- somehow remember the buffer where notes shall be added

- in any other buffer, only invoke a key to capture the bookmark or
  eev function, that is automatically generated.

Me and you, we have basically same workflows. I also need to "insert"
functions in buffer, and invoke them. And I often use M-e to invoke it
from eev package, and M-k to go back. I am aware when package is
loaded or not.

For example:

(hyperscope 1) 

above is my executable Hyperlink. But we can't possible write by hand
each time (eek "M-J") or "(hyperscope 23311)" or similar, or copy and
paste stuff.

It needs integration like bookmarks. C-x r m and this place is
bookmarked.

By using the principle:

- somehow remember the buffer where notes shall be added

- in any other buffer, only invoke a key to capture the bookmark or
  eev function, that is automatically generated.

Then a single key should say "This is the buffer where notes shall be
captured" Like: (setq my-notes-buffer (current-buffer))

Then in other buffers, there shall be single key with prefixes or
decision making, which would say what kind of hyperlink would be
generated and inserted in my-notes-buffer.

First define global variable:

(defvar hyperscope-remembered-notes-buffer nil)

Define function to remember the buffer where notes shall be inserted:

(defun hyperscope-remember-notes-buffer ()
  (interactive)
  (setq hyperscope-remembered-notes-buffer (current-buffer))
  (message "Notes buffer is: %s" (buffer-name)))

Then function to go to notes buffer:

(defun hyperscope-go-to-notes-buffer ()
  (interactive)
  (cond ((buffer-live-p hyperscope-remembered-notes-buffer)
         (cond ((not (equal (current-buffer) 
hyperscope-remembered-notes-buffer))
                (switch-to-buffer-other-window 
hyperscope-remembered-notes-buffer))
               (t (message "Already here"))))
        (t (message "Notes buffer not set"))))

Then define keys:

(keymap-global-set "C-c r" #'hyperscope-remember-notes-buffer)
(keymap-global-set "C-c g" #'hyperscope-go-to-notes-buffer)

then define main function to capture notes by condition, choice, or
prefix:

(defun hyperscope-write-in-notes-buffer (hyperlink)
  (with-current-buffer hyperscope-remembered-notes-buffer
    (insert "\n")
    (insert hyperlink)))
  
This one drops the link in the notes buffer without going there:

(defun hyperscope-link-drop ()
  (interactive)
  (cond ((and (string= rcd-db-current-table "hyobjects")
              (tabulated-list-get-id)) ;; recognize current ID for
                                       ;; elementary object
         (hyperscope-write-in-notes-buffer 
          (format "(hyperscope %d)" (tabulated-list-get-id))))
        ;; Injects link
        (t (message "Did not know what to insert"))))

Finally bind the key to drop links:

(keymap-global-set "C-c d" #'hyperscope-link-drop)

See video on Telegram, as it is not for public, just for you.

If you include that concept in eev, you will speed up generation of hyperlinks.

Also to mention that `hyperscope-link-drop' is a concept function, you
could provide detection of prefix and by prefix decide which hyperlink
to enter, is it maybe key hyperlink like eek or maybe to search for
string in some buffer, or download some video, etc.

-- 

Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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