unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eduardo Ochs <eduardoochs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Workshop to save M$ Windows users - help needed
Date: Sun, 3 Oct 2021 16:15:11 -0300	[thread overview]
Message-ID: <CADs++6gtBYCS+EzyNUGttf7XfMW2sFOZ3OaJbzDWay43i9BQ4w@mail.gmail.com> (raw)
In-Reply-To: <834k9y9ysj.fsf@gnu.org>

On Sun, 3 Oct 2021 at 07:41, Eli Zaretskii <eliz@gnu.org> wrote:
>
> Do you really need that?  The Windows Explorer can unzip files just
> fine, and a browser or Emacs itself can be used to fetch files.


Hi Eli,

Let me start by showing some kinds of useful one-liners.


  1. (find-eev-quick-intro "2. Evaluating Lisp" "M-0 M-e")
     (find-eev-quick-intro "3.1. Non-elisp hyperlinks" "M-x brff")
     (find-emacs-keys-intro "5. Undoing")

     The first sexp above opens the sandboxed tutorial called
     `find-eev-quick-intro', searches for the first occurrence of the
     string "2. Evaluating Lisp" in it, and then searches for the
     first occurrence of the string "M-0 M-e" after that.



  2. (find-firefox-page "http://foo/bar/Coetzee99.pdf" 4)
     (find-firefox-page              "~/Coetzee99.pdf" 4)

     The two sexps above use Firefox as a PDF viewer to open a remote
     PDF and a local PDF on page 4. In low-level terms what they do is:

     (find-bgprocess '("firefox"    "http://foo/bar/Coetzee99.pdf#page=4"))
     (find-bgprocess '("firefox" "file:///home/edrx/Coetzee99.pdf#page=4"))



  3. (find-testblsvideo "2:33" "f8 here starts a new Lua interpreter")

     This sexp plays the video about test blocks starting from 2:33.
     Let me pretend here that I would have time enough in the workshop
     to show that it has two "natural" definitions. Its first natural
     definition would use the copy of that video at youtube, and would
     use Firefox to open this URL:

        http://www.youtube.com/watch?v=fpsF_M55W4o#t=2m33s

     Its second natural definition supposes that we have downloaded
     the .mp4 file of that video, that is here,

        http://angg.twu.net/eev-videos/2021-test-blocks.mp4

     to some hardcoded location, like:

        /tmp/foo/bar/2021-test-blocks.mp4

     and it supposes that everyone in the workshop has the mpv video
     player installed. In low-level terms, what this second definition
     runs is:

       (find-bgprocess '("mpv" "/tmp/foo/bar/2021-test-blocks.mp4"
                         "--start=2:33" "--fs" "--osd-level=2"))



  4. (find-pdf-text "~/Coetzee99.pdf" (+ -110 127) "wrong thoughts")

     This is a variant of the sexps in item 2. It is not trivial to
     make `find-pdf-text' work on Windows, but that function is a
     fixture of my workshops on LaTeX. Let me pretend that I would be
     able to present it, just because it is a very nifty function and
     it will be good karma to give that function a bit more of
     visibility.

     That sexp converts the file ~/Coetzee99.pdf to text by running:

       pdftotext -layout -enc Latin1 /home/edrx/Coetzee99.pdf -

     then puts the output in a temporary buffer, finds the page 17,
     i.e., (+ -110 127), in it by counting formfeeds, and searches for
     the first occurrence of the string "wrong thoughts" in that
     buffer starting from the beginning of page 17.



So, consider again these sexps:

  (find-eev-quick-intro "2. Evaluating Lisp" "M-0 M-e")
  (find-eev-quick-intro "3.1. Non-elisp hyperlinks" "M-x brff")
  (find-emacs-keys-intro "5. Undoing")
  (find-firefox-page "http://foo/bar/Coetzee99.pdf" 4)
  (find-firefox-page              "~/Coetzee99.pdf" 4)
  (find-testblsvideo "2:33" "f8 here starts a new Lua interpreter")
  (find-pdf-text "~/Coetzee99.pdf" (+ -110 127) "wrong thoughts")

all of them are easy to understand, easy to use - if you have the
right files and if you know how to use `M-e', that is roughly
equivalent to `C-e C-x C-e' -, easy to modify in useful ways (by
changing their arguments), easy to save in your notes with cut and
paste, and easy to share by chat.

Two of these sexps need files in hardcoded places - I used
~/Coetzee99.pdf and /tmp/foo/bar/2021-test-blocks.mp4 in the examples
above, but many functions in eev use a convention, explained here,

  http://angg.twu.net/eev-intros/find-psne-intro.html

in which the name of the local copy is derived from the URL like this,

      http://www.gnu.org/software/emacs/emacs-paper.html
  -> $S/http/www.gnu.org/software/emacs/emacs-paper.html

and the environment variable S is $HOME/snarf. Also, if we put the
point on the url below

      http://www.gnu.org/software/emacs/emacs-paper.html

and type M-x brep we get a temporary buffer containing something like
this,


• (eepitch-shell)
• (eepitch-kill)
• (eepitch-shell)
  mkdir -p $S/http/www.gnu.org/software/emacs/
  cd       $S/http/www.gnu.org/software/emacs/
  wget -nc 'http://www.gnu.org/software/emacs/emacs-paper.html'


So several things in the workshop will be much easier if everybody has
wget in the path. An un(tg)zipper is not very important - I only
realized this after my previous e-mail - but wget is.

  [[]],
    Eduardo Ochs
    http://angg.twu.net/#eev



  reply	other threads:[~2021-10-03 19:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-03  4:26 Workshop to save M$ Windows users - help needed Eduardo Ochs
2021-10-03  5:45 ` Jean Louis
2021-10-03  7:59   ` Eduardo Ochs
2021-10-03  9:35 ` Eli Zaretskii
2021-10-03 10:19   ` Eduardo Ochs
2021-10-03 10:40     ` Eli Zaretskii
2021-10-03 19:15       ` Eduardo Ochs [this message]
2021-10-03 19:44         ` Tomas Hlavaty
2021-10-04  3:06           ` Eduardo Ochs
2021-10-04 17:34             ` Tomas Hlavaty
2021-10-04 18:29               ` Tomas Hlavaty
2021-10-06  4:50                 ` Eduardo Ochs
2021-10-06  5:10                   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-06 12:41                   ` Eli Zaretskii
2021-10-07 16:32                 ` Eduardo Ochs
2021-10-07 17:52                   ` Tomas Hlavaty
2021-10-04 18:50         ` Eli Zaretskii
2021-10-06  4:19           ` Eduardo Ochs
2021-10-03  9:36 ` Tomas Hlavaty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADs++6gtBYCS+EzyNUGttf7XfMW2sFOZ3OaJbzDWay43i9BQ4w@mail.gmail.com \
    --to=eduardoochs@gmail.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).