Re: Org and Hyperbole

2022-06-23 Thread Eduardo Ochs
On Thu, 23 Jun 2022 at 22:47, Robert Weiner  wrote:
>
> I am the author of Hyperbole and would be happy to answer questions
> concerning Hyperbole today (so you don't have to answer based on
> experience from the 1990s).  Hyperbole has been modernized for use
> with Org mode and Emacs 28 and continues to develop.  There are videos
> that demonstrate some of its features in simple, understandable ways.
> Hyperbole is a single Emacs package that can be installed and
> uninstalled quickly for testing.  It is largely a global minor mode,
> so you can also disable it quickly if you ever care to.  In 20 minutes
> you can get through the builtin, interactive demo and be on your way
> to basic yet powerful usage.  We have listened to much feedback in the
> last few years and made it much more approachable.


Hi Robert,

can you show us a sexp that will disable Hyperbole completely, and
that we can execute with our favorite variants of `C-x C-e'?
I know that this page

  (info "(hyperbole)Default Hyperbole Bindings")

has this paragraph,

  {C-h h}
  {C-h h X}
 Hyperbole Mini Menu: Enable Hyperbole minor mode and invoke the
 Hyperbole minibuffer menu, giving access to many Hyperbole
 commands.  This is bound globally.  Use {C-h h X} to close the
 Hyperbole minibuffer menu and disable Hyperbole minor mode.

and apparently these sexps toggle Hyperbole minor mode,

  (hyperbole-mode 1)
  (hyperbole-mode 0)

but even when I toggle it off the global binding for `C-h h' remains
active...

  Thanks in advance.
  My notes on Hyperbole are here,
http://angg.twu.net/hyperbole.html
  and there is some material on why I find Hyperbole too "magic"
  in these two links:
http://angg.twu.net/2021-org-for-non-users.html
http://angg.twu.net/eev-wconfig.html

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



Re: Org and Hyperbole

2022-06-23 Thread Eduardo Ochs
On Wed, 22 Jun 2022 at 11:36, Bill Burdick  wrote:
>
> Here's a hyperbole-org integration that lets you use org-mode tables outside 
> of org-mode files. Shift-middle-click a "recalc" button and it will 
> recalculate the table right under it (this idea is from an old version of the 
> Oberon environment I wrote in Java, by the way).
>
> Here's the code:
>
> (defun bill/calc (end)
>   (goto-char end)
>   (re-search-forward "\n")
>   (when (org-at-table-p)
> (org-table-analyze)
> (let* ((table-start (point))
>(rows (1- (length org-table-dlines)))
>(table-end (re-search-forward "\n" nil t rows))
>(inside (<= table-start action-key-depress-prev-point table-end)))
>   (when inside
> (goto-char action-key-depress-prev-point)
> (org-table-maybe-eval-formula))
>   (goto-char table-start)
>   (call-interactively 'org-table-recalculate)
>   (org-table-align
>
> (defib recalc ()
>   "recalculate a table"
>   (save-excursion
> (let* ((pos (point))
>(eol (progn (re-search-forward "\n") (point)))
>(bol (progn (re-search-backward "\n" nil t 2) (1+ (point
>(start (progn (goto-char pos) (re-search-backward "<" bol t)))
>(end (progn (goto-char pos) (re-search-forward ">" eol t
>   ;;(message "pos: %s, prev: %s" (point) action-key-depress-prev-point)
>   (and start end (string-match " ].*" (buffer-substring start 
> end))
>(hact 'bill/calc end)
>
> Here's an example table you can put anywhere. Just shift-middle-click on it 
> to recalculate the org-mode table. Also, if you type a formula (and keep the 
> cursor on the same line) and then shift-click recalc, it'll handle the 
> formula:
>
> 
> | a | 12 |
> | a |  5 |
> #+TBLFM: @1$2=3*4::@2$2=2+3


Hi Bill,

can I ask you for help on something that looks easy but that I'm not
being able to do (due to temporary braindeadness)?

How do we reimplement your  button as a sexp that can be run
with C-e C-x C-e? In eev all "buttons" are simply sexps that can
executed by variants of eval-last-sexp - as explained here:

  http://angg.twu.net/eev-intros/find-eev-quick-intro.html#3

I'm trying to translate your  to "eev style", but I'm
failing...

  Thanks in advance!
Eduardo Ochs
http://angg.twu.net/#eev



Re: Org and Hyperbole

2022-06-20 Thread Eduardo Ochs
On Mon, 20 Jun 2022 at 12:28, Russell Adams  wrote:
> Juan,
>
> I've often wondered the same thing. I've looked at Hyperbole several
> times. They have been great at advertising when a new release
> occurs. Yet I find that I can't really find a useful feature in it
> that I don't get from Org-mode.
>
> Is there some keen feature I'm missing? What's the use case for
> Hyperbole if you're already an Org-mode user?


Hi Russell,

Some years ago I tried to integrate Hyperbole and eev and 1) I failed
miserably, and 2) I ended up with the impression that Hyperbole is
meant to be "used", not to be "hacked"... for example, in Hyperbole
the action of a button like this,

  {C-h h d a}

is to emulate what happens when the user types `C-h h d a'. This
button works exactly as expected; eev implements something similar,
but in a very simplistic, and slightly buggy, way: when we run this in
eev

  (eek "C-h h d a")

it simply runs this,

  (execute-kbd-macro (read-kbd-macro "C-h h d a"))

that just inserts an "a". The details are here, in the second part,
after the blank lines:

  https://lists.gnu.org/archive/html/hyperbole-users/2020-09/msg00013.html

Hyperbole has some amazing features, but its code needs to be
refactored to make more parts of it easier to use from Lisp... someone
needs to do that, and this someone won't be me, as I'm burnt out. =(
My links about my attempts to learn Hyperbole are here:

  http://angg.twu.net/hyperbole.html

  [[]],
Eduardo Ochs
http://angg.twu.net/2021-org-for-non-users.html



Re: Eev-wconfig.el etc etc, or: "Exercise: Learn Org!"

2022-05-29 Thread Eduardo Ochs
On Mon, 30 May 2022 at 00:20, Ihor Radchenko  wrote:
> It would be interesting to hear about the outcome and the student
> feedback.
>
> Best,
> Ihor

The workshop was by chat (Telegram), and only one student came. He
installed Emacs, Mpv, downloaded a copy with subtitles of the
eev-wconfig video, and then followed the first sections of these two
tutorials,

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

and this video until 48:30,

  http://angg.twu.net/.emacs.videos.html#2022eevwconfig

doing practically all the exercises. He told me that two of the five
tests of `find-wget' didn't work as a described in the video... I need
to debug that - my guess is that I need to add a line to the configs
to make the output of wget.exe be interpreted as UTF-8 by default -
and at one point he called an external program from Emacs and Emacs
crashed. He started Emacs again and recovered some backup files, but
then he had to leave. He asked me if we could continue on Wednesday.
We haven't yet reached the part in which he learns how to index local
videos, but we will probably do that on Wednesday.

I think that that was quite good for three hours. =)

  Cheers, E.



Re: Eev-wconfig.el etc etc, or: "Exercise: Learn Org!"

2022-05-28 Thread Eduardo Ochs
On Sat, 28 May 2022 at 01:52, Ihor Radchenko  wrote:
> (...)

Hi Ihor,

I think that you are underestimating how alien eev is for most people.
Let me suppose that what you mean by your comments is this:

  "I've spent N minutes watching this video - for N big - and I feel
   that I've learned very little! What is the best way to learn a lot
   of eev in M minutes, for M very small?"

then the answer is: follow the main tutorial, that is here:

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

Let me just stress some points that are not obvious at all.

  0) You can turn eev-mode on and off with M-x eev-mode. The technical
 details are here:

   http://angg.twu.net/eev-intros/find-eev-intro.html#1
   (find-eev-intro "1. `eev-mode'")

  1) Following a link to a video for which we have a local copy
 usually takes about three seconds. _For me_ this means that I can
 use links to videos as links to _images_. You complained that
 this entry in an index makes no sense:

   (find-2022eevwconfigvideo "15:50" "6.1, 6.2, 6.3, 6.4")

 When I execute it with `M-e' it shows - in just three seconds - a
 page of text with lots of things, and the comment "6.1, 6.2, 6.3,
 6.4" in the sexp hyperlink indicates that the most important
 things in that page of text are the items 6.1 to 6.4.

  2) The main principle of eev is "take executable notes of everything
 that you do". The easiest part of "take executable notes" is
 "copy to your notes all the links that you find interesting". So,
 if you stumble on a link to a position in a video that looks
 slightly interesting, copy it to your notes; if you find a link
 in, say, this tutorial,

   (find-emacs-keys-intro)
   (eek "M-2 M-j")

 that looks interesting, copy it to your notes.

  3) There are ways to create index to videos in Org, but few people
 use them. Years ago I tried to learn this, but I gave up after a
 while:

 https://lists.gnu.org/archive/html/emacs-orgmode/2020-01/msg7.html

 Also, the organizers of the last EmacsConf were using some tools
 - that i also didn't learn - the create indexes and transcripts
 for the videos of the conference.

Anyway, tomorrow I will meet with a group of three or four students
that are interested in learning Emacs and eev. They use Windows and
they have never used Emacs before, so we probably won't be able to do
much of this exercise:

  http://angg.twu.net/eev-wconfig.html#learn-org

...which means: sorry for the off-topic-ish e-mails that were about
eev and not about Org, but I hope that we will reach the part in which
they'll start to index Rainer Koenig's videos in a few days...

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



Re: Eev-wconfig.el etc etc, or: "Exercise: Learn Org!"

2022-05-27 Thread Eduardo Ochs
sing eev. No need to side track explaining Elisp syntax. No
> need to show troubleshooting. No need to show things users "are not
> supposed to understand". No need to show initial configuration with all
> possible caveats.

There are lots of short demos scattered through the videos... here's
one that has subtitles. If you run this

  # Index: http://angg.twu.net/.emacs.videos.html#2022pict2elua
  # Info:  (find-1stclassvideo-links "2022pict2elua")
  exportS=$HOME/snarf
  mkdir -p $S/http/angg.twu.net/eev-videos/
  cd   $S/http/angg.twu.net/eev-videos/
  wget -nc  http://angg.twu.net/eev-videos/2022-pict2e-lua.mp4
  wget -nc  http://angg.twu.net/eev-videos/2022-pict2e-lua.vtt
  mpv $S/http/angg.twu.net/eev-videos/2022-pict2e-lua.mp4

then you can use the keys [ and ] to make mpv change the playing
speed, and you can watch the full 8-minute video in just one or two
minutes. If you prefer to watch it on Youtube the link is this one:

  http://www.youtube.com/watch?v=hiHsUhGVLGM

> No need to side track explaining Elisp syntax. No
> need to show troubleshooting. No need to show things users "are not
> supposed to understand". No need to show initial configuration with all
> possible caveats.

Can you explain these "no need"s? Except for the red stars and anchors
_all_ the "markup language" of eev consists of explicit sexps...

> You argue that Org is a "black box", but your code is also a black box
> in a sense that one needs to read the "wconfig" files (AFAIU). How is it
> different compared to Org written in Elisp following the usual
> documentation conventions described in the Elisp manual?

Eev-wconfig is only needed for configuring things on Windows. On, say,
Debian, people only need to install google-chrome (obs: it's easy to
use other browsers instead), and do this:

  sudo apt-get install wget xpdf pdftotext mpv

after that all the features will work.

Here are two examples of cases in which I stumbled on black boxes that
I never managed to open properly, one in Org and one in Hyperbole:

  https://lists.gnu.org/archive/html/emacs-orgmode/2021-12/msg00674.html
  https://lists.gnu.org/archive/html/emacs-orgmode/2022-02/threads.html#00098
  https://lists.gnu.org/archive/html/hyperbole-users/2020-09/msg00012.html

Cheers,
  Eduardo Ochs
  http://angg.twu.net/#eev
  http://angg.twu.net/#eev-blogposts



Eev-wconfig.el etc etc, or: "Exercise: Learn Org!"

2022-05-22 Thread Eduardo Ochs
Hi all,

I made a video that is mainly for people who are new to Emacs and who
are using M$ Windows, and it ends with an exercise that is roughly
this: "...now download a .zip file with Rainer Koenig's videos from
<http://angg.twu.net/eev-wconfig.html#learn-org>, unpack it somewhere,
and use eev to create an index of the video that you've watched, with
pointers to the parts that you will need to re-watch many times"...

The best way to watch the video is to download it and its subtitles by
doing this:

  wget http://angg.twu.net/eev-videos/2022-eev-wconfig.mp4
  wget http://angg.twu.net/eev-videos/2022-eev-wconfig.vtt

and then watch the local copy with a video player. The second best way
to watch it is to access its index, here,

  http://angg.twu.net/.emacs.videos.html#2022eevwconfig

and click on the timestamps of the parts that look interesting to play
the video on Youtube starting from that position.

The page about the video and all the ideas behind it is this one:

  http://angg.twu.net/eev-wconfig.html

All feedback welcome!
  Cheers,
Eduardo Ochs
http://angg.twu.net/#eev



Re: Org for non-users, part 2: `C-c C-e', a.k.a. `org-export-dispatch'

2022-02-07 Thread Eduardo Ochs
On Mon, 7 Feb 2022 at 10:55, Ihor Radchenko  wrote:

> >   What are the recommended ways to abort org-export-dispatch without
> >   letting it destroy the "*Org Export Dispatcher*" window and its
> >   buffer?
>
> You cannot. That window acts similarly to transient, but simpler. You
> can think of *Org Export Disipatcher* as an extended help for
> read-char-exclusive.
>
> Best,
> Ihor
>

 Hi Ihor,

What do you mean by "you cannot"?
I was expecting an answer like this:

  That's difficult to do, but the temporary buffer is generated by the
  function `org-foo-bar'... you can try to make a copy of
  `org-foo-bar' called `org-foo-bar-hacked-version', add your own
  debugging functions to that copy - suggestion: the lines 42 and 99
  are good places for that - and then you can change the function
  `org-plic-ploc', that is called by `org-export-dispatch', to make it
  call `org-foo-bar-hacked-version' instead of `org-foo-bar'...

One possible meaning of "you cannot" is:

  Org is NOT MEANT to be explored in that way, and this "is not meant
  to" is in a very strong sense. The last time that a person gave
  technical information of that kind in the mailing list was 4 or 5
  years ago, and we banished her from the community and excommunicated
  her. Her name shall not be mentioned.

Frustrated cheers =(,
  Eduardo Ochs
  http://angg.twu.net/#eev


Org for non-users, part 2: `C-c C-e', a.k.a. `org-export-dispatch'

2021-12-29 Thread Eduardo Ochs
Hi all,

a few weeks ago I recorded a video called "Org for non-users" -
link:

  http://angg.twu.net/2021-org-for-non-users.html

that was about a way to understand some of the data structures that
are used in the support for code blocks. Now I would like to do
something similar with the exporter, but I am stuck at the first
step... When I run `M-x org-export-dispatch' or `C-c C-e' it creates a
second window whose mode line says "*Org Export Dispatcher*" -

My first question is:

  What are the recommended ways to abort org-export-dispatch without
  letting it destroy the "*Org Export Dispatcher*" window and its
  buffer?

I will probably get stuck at other points later, but I think that I'll
be able to get quite far by myself if I can inspect that buffer with
the tools that I know.

All suggestions are welcome, including suggestions related to
questions that you guess that I will have later. =)

  Thanks in advance!
Eduardo Ochs
http://angg.twu.net/#eev
http://angg.twu.net/emacsconf2021.html


Re: Video: Org for Non-Users

2021-12-13 Thread Eduardo Ochs
Hi Samuel,

I know Rainer König's videos! They are fantastic, and I have even
indexed a few of the ones that I've watched several times... see:

  http://angg.twu.net/e/org.e.html#rainer-koenig

The indexing above was done with eev's tricks. I have tried to learn
how to do links to positions in videos with Org, but all my attempts
have failed miserably...

  Cheers =/,
Eduardo Ochs
http://angg.twu.net/#eev



On Mon, 13 Dec 2021 at 11:23, Samuel Banya  wrote:
>
> Good point about the docs.
>
> I actually wish it were more like a giant wiki page instead of a page menu 
> system where you have to keep clicking next on similar topics. Might be 
> difficult to implement without a huge loading time.
>
> To be fair though Eduardo, have you checked out Rainer's videos on Org Mode 
> on YouTube?
> https://www.youtube.com/playlist?list=PLVtKhBrRV_ZkPnBtt_TD1Cs9PJlU0IIdE
>
> I feel that anyone who doesn't know Org Mode should go through these first, 
> and THEN check out the documentation / built-in manual page in Emacs.
>
> Worth a try :)
>
> Sam
>
> On Mon, Dec 13, 2021, at 7:33 AM, Byung-Hee HWANG wrote:
>
> Eduardo Ochs  writes:
>
> > Hi all,
> >
> > A few months ago I finally understood why I have always found Org so
> > difficult to learn, and I started to work on a way to use eev - a
> > package that I wrote - to create notes on Org that would complement
> > the official docs "exactly in the way that I needed". I recorded a
> > video about that, and it is here:
> >
> >   http://angg.twu.net/2021-org-for-non-users.html
> >
> > TL;DR: I discovered that I am a "non-user" and recorded a video on how
> > I am now documenting Org for "non-users" like me. Initially I am
> > writing the docs in that format for myself, but I hope that they will
> > inspire other people...
>
> Thanks, i did enter at org mode two days ago.
>
> Sincerely, Gnus fan Byung-Hee
>
> --
> ^고맙습니다 _布德天下_ 감사합니다_^))//
>
>
>



Video: Org for Non-Users

2021-12-12 Thread Eduardo Ochs
Hi all,

A few months ago I finally understood why I have always found Org so
difficult to learn, and I started to work on a way to use eev - a
package that I wrote - to create notes on Org that would complement
the official docs "exactly in the way that I needed". I recorded a
video about that, and it is here:

  http://angg.twu.net/2021-org-for-non-users.html

TL;DR: I discovered that I am a "non-user" and recorded a video on how
I am now documenting Org for "non-users" like me. Initially I am
writing the docs in that format for myself, but I hope that they will
inspire other people...

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



Re: From macros to elisp programming?

2021-12-07 Thread Eduardo Ochs
Hi Ypo!

You may find this useful too. I often use it when I want to put
editing commands in my functions and I'm in a hurry and not in a mood
to find their names - so for example I use (eek "C-l") instead of
(recenter-top-bottom), or (eek " C-a C-SPC  M-w C-y") to
duplicate the line above the point...

  Cheers & happy hacking =),
E.
http://angg.twu.net/#eev


;; See:
;; http://angg.twu.net/eev-intros/find-eev-quick-intro.html#3
;; (find-eev-quick-intro "3. Elisp hyperlinks")
;;
(defun eek (str)
  "Execute STR as a keyboard macro. See `edmacro-mode' for the exact format.\n
An example: (eek \"C-x 4 C-h\")"
  (interactive "sKeys: ")
  (execute-kbd-macro (read-kbd-macro str)))

On Tue, 7 Dec 2021 at 09:55, Ypo  wrote:
>
> Obrigado, Eduardo!
>
> I didn't know that command: "setq last-kbd-macro" and probably it will be 
> useful with elmacro too.
>
> (outline-next-visible-heading) ;; C-c C-n
>
> I save your instructions to my notes to use them :-)
>
> Saúde!
>
>
> El 07/12/2021 a las 3:11, Eduardo Ochs escribió:
>
> On Mon, 6 Dec 2021 at 10:43, Ypo  wrote:
>
> Hi
>
> I am able to make macros, but I think I am far away from Lisp programming.
>
> Is there a path to go from macros to elisp programming? For example, the last 
> macro I've made is for transforming the name of some headlines, adding in 
> front of them a part from the previous headline. This is the elisp code of 
> the macro:
>
> #+BEGIN_SRC
> (fset 'SanzTema5
>(kmacro-lambda-form [?\C-a ?\M-f ?\M-b ?\C-  ?\M-f ?\M-f ?\M-f ?\M-f ?\M-f 
> ?\M-f ?\M-f ?\M-f ?\M-f ?\M-w ?\C-c ?\C-n ?\C-a ?\M-f ?\M-b ?\C-y ?  ?- ?  
> ?\C-e ?\M-b ?\M-f ?\"] 0 "%d"))
> #+END_SRC
>
>
> Using that code, from these headlines:
>
> *** Sanz Aparicio et al. (2019) "5 Los Motivos Adquiridos, Menéndez Balaña" 
> (pp. 95-118)
>  INTRODUCCIÓN
>
> I get modified the second headline:
>
> *** Sanz Aparicio et al. (2019) "5 Los Motivos Adquiridos, Menéndez Balaña" 
> (pp. 95-118)
>  Sanz Aparicio et al. (2019) "5 Los Motivos Adquiridos - INTRODUCCIÓN"
>
>
> Are macros near to elisp programming or they are two different worlds?
>
> Ypo
>
> Hi Ypo,
>
> here's a suggestion. If you run this
>
>   (setq last-kbd-macro [?\C-a ?\M-f ?\M-b ?\C- ?\M-f ?\M-f ?\M-f ?\M-f
> ?\M-f ?\M-f ?\M-f ?\M-f ?\M-f ?\M-w ?\C-c ?\C-n ?\C-a ?\M-f ?\M-b
> ?\C-y ? ?- ? ?\C-e ?\M-b ?\M-f ?\"])
>
> and then type `C-x C-k C-e' (`kmacro-edit-macro-repeat') you will get
> a temporary buffer that contains this:
>
> C-a ;; move-beginning-of-line
> M-f ;; forward-word
> M-b ;; backward-word
> C-SPC   ;; set-mark-command
> 9*M-f   ;; forward-word
> M-w ;; kill-ring-save
> C-c C-n
> C-a ;; move-beginning-of-line
> M-f ;; forward-word
> M-b ;; backward-word
> C-y ;; yank
> SPC ;; self-insert-command
> -   ;; self-insert-command
> SPC ;; self-insert-command
> C-e ;; move-end-of-line
> M-b ;; backward-word
> M-f ;; forward-word
> "   ;; self-insert-command
>
> If you convert that by hand - suggestion: use keyboard macros for
> that! =) - to a defun like this one,
>
>   (defun SanzTema5 ()
> (interactive)
> (move-beginning-of-line)   ; C-a
> (forward-word) ; M-f
> (backward-word); M-b
> (set-mark-command) ; C-SPC
> (dotimes 9 (forward-word)) ; 9*M-f
> ;; ^ or: (forward-word 9)
> (kill-ring-save)   ; M-w
> ;; What here? I don' have a:   ; C-c C-n
> (move-beginning-of-line)   ; C-a
> (forward-word) ; M-f
> (backward-word); M-b
> (yank) ; C-y
> (insert " - ") ; SPC - SPC
> (move-end-of-line) ; C-e
> (backward-word); M-b
> (forward-word) ; M-f
> (insert "\"")  ; "
> )
>
> Then you will get a defun that does something that is clearly useful
> to you... you can start by creating and debugging a handful of defuns
> like that one and then learn what most people consider as "real
> Elisp"...
>
>   Cheers =),
> Eduardo Ochs
> http://angg.twu.net/#eev



Re: Looking for extensions of [[file:~/xx.org::My Target]]

2021-12-06 Thread Eduardo Ochs
...also here:
https://github.com/jkitchin/scimax/blob/master/scimax-notebook.org#example-links

Very good, thanks! =)
  E.

On Mon, 6 Dec 2021 at 23:45, John Kitchin  wrote:
>
> You might find the scimax-notebook project 
> (https://github.com/jkitchin/scimax/blob/master/scimax-notebook.org) 
> interesting for this. It builds on projectile and defines a link 
> (https://github.com/jkitchin/scimax/blob/master/scimax-notebook.org#notebookproject-links)
>  similar to what you describe. You can learn more about it here:
>
> https://www.youtube.com/watch?v=H4sK5ld6Bw0
>
>
> John
>
> ---
> Professor John Kitchin (he/him/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Mon, Dec 6, 2021 at 8:44 PM Eduardo Ochs  wrote:
>>
>> Hi people,
>>
>> this node of the Org manual
>>
>>   (info "(org)Search Options")
>>   http://www.gnu.org/software/emacs/manual/html_node/org/Search-Options.html
>>
>> explains that we can use links like this one
>>
>>   [[file:~/xx.org::My Target]]
>>
>> to point to a string like "<>" in the file ~/xx.org.
>>
>> Where can I find extensions of that syntax that allow using several
>> "projects"? I am thinking of something like this: after telling the
>> extension that in the local filesystem
>>
>>   the project "dn6" is at ~/LATEX/dednat6/, and
>>   the project "edrxrepl" is at ~/edrxrepl/
>>
>> then the links
>>
>>   [[file:dn6/stacks.lua:Stack-tests]] and
>>   [[file:edrxrepl/edrxpcall.lua:Class]]
>>
>> would point to:
>>
>>   the string "<>" in ~/LATEX/dednat6/stacks.lua and
>>   the string "<>" in ~/edrxrepl/edrxpcall.lua,
>>
>> and I imagine that every such extension would also allow telling the
>> HTML exporter where these "projects" are in the web...
>>
>> Thanks in advance!
>>   Eduardo Ochs
>>   http://angg.twu.net/#eev
>>
>>
>>
>> P.S.: I still know far less Org than I should, but I am trying to
>> remedy this...
>>
>> P.P.S.: eev uses this trick to point to anchors in "projects":
>>   http://angg.twu.net/eev-intros/find-eev-quick-intro.html#8.5
>>   http://angg.twu.net/eev-intros/find-eev-quick-intro.html#9.2
>> I need to add to its docs references to how other packages do
>> similar things.
>>



Re: From macros to elisp programming?

2021-12-06 Thread Eduardo Ochs
On Mon, 6 Dec 2021 at 10:43, Ypo  wrote:
>
> Hi
>
> I am able to make macros, but I think I am far away from Lisp programming.
>
> Is there a path to go from macros to elisp programming? For example, the last 
> macro I've made is for transforming the name of some headlines, adding in 
> front of them a part from the previous headline. This is the elisp code of 
> the macro:
>
> #+BEGIN_SRC
> (fset 'SanzTema5
>(kmacro-lambda-form [?\C-a ?\M-f ?\M-b ?\C-  ?\M-f ?\M-f ?\M-f ?\M-f ?\M-f 
> ?\M-f ?\M-f ?\M-f ?\M-f ?\M-w ?\C-c ?\C-n ?\C-a ?\M-f ?\M-b ?\C-y ?  ?- ?  
> ?\C-e ?\M-b ?\M-f ?\"] 0 "%d"))
> #+END_SRC
>
>
> Using that code, from these headlines:
>
> *** Sanz Aparicio et al. (2019) "5 Los Motivos Adquiridos, Menéndez Balaña" 
> (pp. 95-118)
>  INTRODUCCIÓN
>
> I get modified the second headline:
>
> *** Sanz Aparicio et al. (2019) "5 Los Motivos Adquiridos, Menéndez Balaña" 
> (pp. 95-118)
>  Sanz Aparicio et al. (2019) "5 Los Motivos Adquiridos - INTRODUCCIÓN"
>
>
> Are macros near to elisp programming or they are two different worlds?
>
> Ypo


Hi Ypo,

here's a suggestion. If you run this

  (setq last-kbd-macro [?\C-a ?\M-f ?\M-b ?\C- ?\M-f ?\M-f ?\M-f ?\M-f
?\M-f ?\M-f ?\M-f ?\M-f ?\M-f ?\M-w ?\C-c ?\C-n ?\C-a ?\M-f ?\M-b
?\C-y ? ?- ? ?\C-e ?\M-b ?\M-f ?\"])

and then type `C-x C-k C-e' (`kmacro-edit-macro-repeat') you will get
a temporary buffer that contains this:

C-a ;; move-beginning-of-line
M-f ;; forward-word
M-b ;; backward-word
C-SPC   ;; set-mark-command
9*M-f   ;; forward-word
M-w ;; kill-ring-save
C-c C-n
C-a ;; move-beginning-of-line
M-f ;; forward-word
M-b ;; backward-word
C-y ;; yank
SPC ;; self-insert-command
-   ;; self-insert-command
SPC ;; self-insert-command
C-e ;; move-end-of-line
M-b ;; backward-word
M-f ;; forward-word
"   ;; self-insert-command

If you convert that by hand - suggestion: use keyboard macros for
that! =) - to a defun like this one,

  (defun SanzTema5 ()
(interactive)
(move-beginning-of-line)   ; C-a
(forward-word) ; M-f
(backward-word); M-b
(set-mark-command) ; C-SPC
(dotimes 9 (forward-word)) ; 9*M-f
;; ^ or: (forward-word 9)
(kill-ring-save)   ; M-w
;; What here? I don' have a:   ; C-c C-n
(move-beginning-of-line)   ; C-a
(forward-word) ; M-f
(backward-word); M-b
(yank) ; C-y
(insert " - ") ; SPC - SPC
(move-end-of-line) ; C-e
(backward-word); M-b
(forward-word) ; M-f
(insert "\"")  ; "
)

Then you will get a defun that does something that is clearly useful
to you... you can start by creating and debugging a handful of defuns
like that one and then learn what most people consider as "real
Elisp"...

  Cheers =),
Eduardo Ochs
http://angg.twu.net/#eev



Looking for extensions of [[file:~/xx.org::My Target]]

2021-12-06 Thread Eduardo Ochs
Hi people,

this node of the Org manual

  (info "(org)Search Options")
  http://www.gnu.org/software/emacs/manual/html_node/org/Search-Options.html

explains that we can use links like this one

  [[file:~/xx.org::My Target]]

to point to a string like "<>" in the file ~/xx.org.

Where can I find extensions of that syntax that allow using several
"projects"? I am thinking of something like this: after telling the
extension that in the local filesystem

  the project "dn6" is at ~/LATEX/dednat6/, and
  the project "edrxrepl" is at ~/edrxrepl/

then the links

  [[file:dn6/stacks.lua:Stack-tests]] and
  [[file:edrxrepl/edrxpcall.lua:Class]]

would point to:

  the string "<>" in ~/LATEX/dednat6/stacks.lua and
  the string "<>" in ~/edrxrepl/edrxpcall.lua,

and I imagine that every such extension would also allow telling the
HTML exporter where these "projects" are in the web...

Thanks in advance!
  Eduardo Ochs
  http://angg.twu.net/#eev



P.S.: I still know far less Org than I should, but I am trying to
remedy this...

P.P.S.: eev uses this trick to point to anchors in "projects":
  http://angg.twu.net/eev-intros/find-eev-quick-intro.html#8.5
  http://angg.twu.net/eev-intros/find-eev-quick-intro.html#9.2
I need to add to its docs references to how other packages do
similar things.



Re: Orgdown: negative feedback & attempt of a root-cause analysis (was: "Orgdown", the new name for the syntax of Org-mode)

2021-11-30 Thread Eduardo Ochs
On Tue, 30 Nov 2021 at 17:46, Karl Voit  wrote:
>
> I chose an in-between approach: defining only a minimal set (name,
> common structure/idea/documentation, Orgdown1, providing a
> collaborative home on GitLab) and hope for a project community that
> will take over (or at least support) from there, discussing syntax
> elements for Orgdown2 and taking the project to its next logical
> steps.
>
> In hindsight, this decision was wrong.
>
> Quite frankly, I don't have the energy to throw away everything and
> start from zero with a different name.
>
> People do not seem to realize what it took to get there - which is
> partly understandingly because I had to learn by doing what it takes
> to get the idea into a coherent and consistent form.
>
> Simply switching to a different name is not just search It
> would reset the project almost to its very start again, losing the
> go-live effect of previous weekend (whose effect might be
> questionable considering the name discussion), its project URL that
> is now out there, the motivation video which aims to explain the
> motivation to users of Emacs, the EmacsConf21 talk publicity, and it
> would require much effort to reach the status where Orgdown is now.


Hi Karl,

I was at the EmacsConf2021, but I was totally exhausted due to other
chores and spoke to very few people there...

I think that your work is VERY important. I am one of the people who
have tried to learn Org lots of times and got stuck the same number of
times, and any initiative that splits the features - either syntactic
or semantics - into layers of different complexity and importance
will help me very much.

My suggestion about the name is: it's your project, changing its name
is not a trivial task, and the people who complained about the name
did not offer help. If I were you would simply put "find a better name
for the project and change its name to it" in my TODO list as a
low-priority task.

  Cheers =),
Eduardo Ochs
http://angg.twu.net/#eev
https://emacsconf.org/2021/talks/test/



Short videos about workflows - and how to upload them

2021-01-05 Thread Eduardo Ochs
Hi list,

this is slightly off-topic - but only slightly, I think.
Yesterday I attended (as a lurker...) this meeting of the EmacsNYC
group:

https://emacsnyc.org/2020/12/28/online-meetup-discussionhow-do-we-improve-emacs.html

In it Sacha Chua said that she feels that most people, especially
newbies, have a hard time figuring out other people's workflows, and
that we should try to make short videos about our workflows and share
them...

Long story short: I have a nice workflow for recording and uploading
short videos to my home page, and I made a 5-minute video about it. It
is here:

  http://angg.twu.net/eev-videos/2020-short-find-ssr-links-2.mp4

It uses eev, that can be used in conjunction with Org, but that is
based on design decisions that are very different from the ones in
Org. I gave a presentation about these design decisions at the last
EmacsConf:

  http://angg.twu.net/emacsconf2020.html

I know only a handful of features of Org at the moment, and I don't
know (yet) how to translate the ideas of this method for uploading
videos to "pure Org", i.e., to Org without eev... I hope that someone
would find a way, and would share it with everybody. Also, I think
that it would be really, really, really great if more people start to
make their videos downloadable from places that are not Youtube; eev
has some functions that help downloading videos from Youtube with
youtube-dl - see:

  http://angg.twu.net/2020-some-template-based.html
  http://www.youtube.com/watch?v=91-9YfRPsuk#t=19m23s (intro)
  http://www.youtube.com/watch?v=91-9YfRPsuk#t=22m48s (demo)

but they're a bit clumsy... eev also has functions for accessing
videos at <http://angg.twu.net/eev-videos/>, and, far more
important than that, it has this comment in its source:

  ;; The definitions of `find-eevvideo-links' and `code-eevvideo' above
  ;; have strings like "eev" and "http://angg.twu.net/eev-videos/;
  ;; hardcoded in several places... it is easy, but not entirely
  ;; trivial, to create variants of them that point to other sites that
  ;; stores video tutorials and presentations in ways that are easy to
  ;; download. If you are aware of sites like that, please get in touch
  ;; and I'll create functions pointing to them!

So: let's create videos about workflows and videos about creating
videos about workflows, and let's share ideas and links

  Cheers =) =) =),
Eduardo Ochs
http://angg.twu.net/#eev
https://github.com/edrx/eev#introduction



Re: Long links

2020-01-05 Thread Eduardo Ochs
Hi Steven,

On Sun, 5 Jan 2020 at 11:03, Steven Penny  wrote:
>
> So you can understand why I was annoyed when Trey started his off
> topic discussion about hard versus soft wrapping.

We understand, but now lots of people are annoyed with you.

Trey wrote his e-mails very carefully, and even if his suggestions
weren't exactly what you were looking for they were given in good
faith and they were useful to other people - for example to me.

Most people here read e-mails paying attention both to their technical
contents and to the "social contents" of them... in terms of social
contents Trey's e-mails were impeccable, and this one was especially
brilliant:

https://lists.gnu.org/archive/html/emacs-orgmode/2020-01/msg00029.html

I want to be like him when I grow up.

  Cheers,
Eduardo Ochs
http://angg.twu.net/#eev
http://angg.twu.net/emacsconf2019.html



Re: Add a new link type for video files

2020-01-03 Thread Eduardo Ochs
Hi Stardiviner,

just some quick comments on org-video-link-open...

Eev also has functions for opening audio/video files at certain time
offsets. They are called like this (with `C-e C-x C-e' or something
equivalent),

  (find-video "~/eev-videos/Punch_and_Judy_Mark_Poulton-K6LmZ0A1s9U.mp4")
  (find-video "~/eev-videos/Punch_and_Judy_Mark_Poulton-K6LmZ0A1s9U.mp4" "1:17")

and the sexps above pass these lists to start-process:

  ("mpv" "~/eev-videos/Punch_and_Judy_Mark_Poulton-K6LmZ0A1s9U.mp4"
 "--fs" "--osd-level=2")

  ("mpv" "~/eev-videos/Punch_and_Judy_Mark_Poulton-K6LmZ0A1s9U.mp4"
 "--start" "1:17"
 "--fs" "--osd-level=2")

I use mpv instead of mplayer because this page at the Wikipedia
convinced me to:

  https://en.wikipedia.org/wiki/Mpv_(media_player)

"--fs" means "full screen" and "--osd-level=2" shows the current time.

If you know other emacs packages that implement opening audio or video
files and skipping to a certain position please tell me - I would like
to mention them in the comments of eev-audiovideo.el. I mentioned your
previous message there, by the way! See:

  https://github.com/edrx/eev/blob/UTF-8/eev-audiovideo.el#L55
  http://angg.twu.net/eev-current/eev-audiovideo.el.html
  http://angg.twu.net/eev-current/eev-audiovideo.el

Cheers,
  Eduardo Ochs
  http://angg.twu.net/#eev
  http://angg.twu.net/emacsconf2019.html

On Fri, 3 Jan 2020 at 06:15, stardiviner  wrote:
>
>
> I write a patch to add new link type:
>
> #+begin_example
> [[video:/path/to/file.mp4::00:13:20]]
> #+end_example
>
> This will open video file in specific timestamp. And it is possible to add 
> more
> options in link. Like video player arguments.
>
> I want to ask should I add this patch to Org Mode built-in?
>
> Here is my patch source code:
>
> #+begin_src emacs-lisp :file "ol-video.el"
> ;;; [[video:/path/to/file.mp4::00:13:20]]
> (defcustom org-video-link-open-command "mplayer"
>   "Specify the program for openning video: link."
>   :type 'string)
>
> (defvar org-video-link-extension-list '("avi" "rmvb" "ogg" "mp4" "mkv"))
>
> (defun org-video-link-open (uri)
>   "Open video file `URI' with video player."
>   (let* ((list (split-string uri "::"))
>  (path (car list))
>  (start-timstamp (cadr list)))
> (make-process
>  :command (list org-video-link-open-command
> "-ss" start-timstamp
> (expand-file-name (org-link-unescape path)))
>  :name "org-video-link")))
>
> (defun org-video-complete-link ( arg)
>   "Create a video link using completion."
>   (let ((file (read-file-name "Video: " nil nil nil nil
>   #'(lambda (file)
>   (seq-contains-p
>org-video-link-extension-list
>(file-name-extension file)
> (pwd (file-name-as-directory (expand-file-name ".")))
> (pwd1 (file-name-as-directory (abbreviate-file-name
>(expand-file-name ".")
> (cond ((equal arg '(16))
>(concat "video:"
>(abbreviate-file-name (expand-file-name file
>   ((string-match
> (concat "^" (regexp-quote pwd1) "\\(.+\\)") file)
>(concat "video:" (match-string 1 file)))
>   ((string-match
> (concat "^" (regexp-quote pwd) "\\(.+\\)")
> (expand-file-name file))
>(concat "video:"
>(match-string 1 (expand-file-name file
>   (t (concat "video:" file)
>
> (org-link-set-parameters "video"
>  :follow #'org-video-link-open
>  :complete #'org-video-complete-link)
> #+end_src
>
> --
> [ stardiviner ]
>I try to make every word tell the meaning what I want to express.
>
>Blog: https://stardiviner.github.io/
>IRC(freenode): stardiviner, Matrix: stardiviner
>GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
>
>



Re: Using Org and eev together - problem with source blocks

2019-11-11 Thread Eduardo Ochs
Perfect!
I've added several mentions to ":results output" to the tutorial:
  http://angg.twu.net/eev-intros/find-org-intro.html
Thanks a lot! =)
  Eduardo
http://angg.twu.net/#eev


On Sun, 10 Nov 2019 at 14:13, Ken Mankoff  wrote:

>
> On 2019-11-10 at 15:36 +01, Eduardo Ochs  wrote...
> > Changing the Python source block to
> >
> > #+BEGIN_SRC python :output results
> >
> > Are you sure that you wrote it correctly?
>
> I'm pretty sure I did not. Try ":results output"
>
>   -k.
>
>


Re: Using Org and eev together - problem with source blocks

2019-11-10 Thread Eduardo Ochs
Changing the Python source block to

#+BEGIN_SRC python :output results
def square (x):
return x*x

print(square(5))
#+END_SRC

didn't change anything here, neither with emacs24 nor with git emacs,
and I grepped (recursively) for ":output" in the directory where I
cloned https://code.orgmode.org/bzg/org-mode.git and only found
references to ":output-dir" - except for a single occurrence of
":output" in contrib/lisp/ob-sclang.el...

Are you sure that you wrote it correctly?

  Cheers, E. =)
  http://angg.twu.net/#eev


On Sun, 10 Nov 2019 at 08:39, Ken Mankoff  wrote:

>
> On 2019-11-10 at 02:54 +01, Eduardo Ochs  wrote...
> > #+BEGIN_SRC python
> > def square (x):
> > return x*x
> >
> > print(square(5))
> > #+END_SRC
> >
> > [...] when I run the Python block with C-c C-c I always get a results
> > block like this (without the indentation):
> >
> >   #+RESULTS:
> >   : None
> >
> > What am I doing wrong? I expected an output of "25"... =(
>
> Adding ":output results" makes this work for me, but I'm not using emacs24.
>
>   -k.
>


Using Org and eev together - problem with source blocks

2019-11-09 Thread Eduardo Ochs
Hi list,

I gave a presentation about eev at the EmacsConf a few days ago, and
after the conference I started to work on a tutorial to explain how to
use Org and eev together... links:

  http://angg.twu.net/emacsconf2019.html
  http://angg.twu.net/LATEX/2019emacsconf-long.pdf (slides)
  http://www.youtube.com/watch?v=86yiRG8YJD0=774 (demo)
  http://www.youtube.com/watch?v=86yiRG8YJD0=956 (demo: eepitch)
  http://angg.twu.net/eev-intros/find-org-intro.html (eev+Org, html)
  http://angg.twu.net/eev-intros/find-org-intro  (eev+Org, src)
  https://lists.gnu.org/archive/html/emacs-orgmode/2013-11/msg00124.html

I am longtime Org user that only uses a few features of Org - mainly
the ones here,

  (info "(org)Document Structure")

and when I tried to explain in my tutorial how to execute org source
blocks I stumbled on a behavior that I found very puzzling... I will
copy the relevant code here. The section on preparation says to run
these sexps,

  (require 'org)
  (require 'ob-sh)
  ;; or: (require 'ob-shell)
  (require 'ob-python)

and then a bit later the tutorial has this:



# (info "(org)Working With Source Code")
# (info "(org)Evaluating code blocks")

#+BEGIN_SRC sh
seq 200 204
#+END_SRC

#+BEGIN_SRC python
def square (x):
return x*x

print(square(5))
#+END_SRC



but when I run the shell block with C-c C-c I get these errors

  Error reading results: (user-error No table at point)
  Code block produced no output.

and an empty "#+RESULTS:" block in Emacs24, and the right results
block in some later versions of Emacs, and when I run the Python block
with C-c C-c I always get a results block like this (without the
indentation):

  #+RESULTS:
  : None

What am I doing wrong? I expected an output of "25"... =(

Thanks in advance!

  Eduardo Ochs
  http://angg.twu.net/#eev


Re: [O] How to execute org babel src block line by line?

2016-04-19 Thread Eduardo Ochs
Hi Xor3,

Maybe you should take a look at eev - more specifically, at eepitch,
which is one of its modules... there's a demo here, starting at 0:16,

  http://angg.twu.net/eev-videos/video4-eepitch.mp4
  http://www.youtube.com/watch?v=Lj_zKC5BR64

and there's a tutorial here:

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

I am not sure if it is already as compatible with Org as it should - I
use Org all the time, but just a few basic features... if you want to
try it and stumble on any problems please let me know and I will fix
everything ASAP - I am in the middle of my holidays. =)

  Cheers!
Eduardo Ochs
eduardoo...@gmail.com
http://angg.twu.net/



P.S.: I am trying isend-mode now.

On Mon, Apr 18, 2016 at 5:44 AM, Xor3 <eude...@foxmail.com> wrote:
> Hi community,
>I want to execute org babel src block one line a time.
>Here is what I have tried.
>I use `isend' to send things to REPL buffer. When "C-"  is pressed 
> at first time,  a REPL buffer which is decided by  `lang' params  is startd. 
> Then everything send to that buffer. An additional param `:dir' is configured 
> to decide the starting `default-directry' of the REPL command.
>
> =
> (eval-after-load "org"
>   '(progn
> ;; ;; (org-defkey org-mode-map (kbd "C-") 'org-isend-send)
> (define-key org-mode-map (kbd "C-") 'org-isend-send)
>
> (defun org-isend-send()
>   (interactive)
>   (let* ((oldbuf (current-buffer))
>  (info (org-babel-get-src-block-info))
>  (lang (nth 0 info))
>  (body (nth 1 info))
>  (params (nth 2 info))
>  (session (cdr (assoc :session params)))
>  (dir (cdr (assoc :dir params)))
>  (isend--command-buffer (concat "*" session "*"))
>  (working-directory
>   (or (and dir (file-name-as-directory dir)) 
> default-directory)))
> (when  (not (get-buffer isend--command-buffer))
>   (cond
>((string-equal lang "python") (save-current-buffer
>(let ((default-directory 
> working-directory))
>  (call-interactively 
> 'run-python)
>  (with-current-buffer 
> "*Python*"
>(rename-buffer 
> isend--command-buffer)
>((string-equal lang "sh") (save-current-buffer
>(let ((default-directory 
> working-directory))
>  (if (string-equal session 
> "eshell")
>  (eshell)
>(progn
>  (shell)
>  (with-current-buffer 
> "*shell*"
>(rename-buffer 
> isend--command-buffer)))
>(t (error "session?")))
>   (require 'isend)
>   (require 'isend-mode)
>   (when (not isend-mode)
> (isend-mode 1)
> (make-local-variable 'isend-mode-map)
> (define-key isend-mode-map (kbd "C-") nil)
> (local-set-key (kbd "C-") 'org-isend-send))
>   (cond
>((string-equal lang "python") (isend-ipython-setup))
>(t (isend-shell-setup)))
>   )
> ;; (display-buffer isend--command-buffer)
> (isend-display-buffer)
> (call-interactively 'isend-send)
> ;; (with-current-buffer isend--command-buffer
> ;;   (goto-char (point-max))
> ;;   (comint-send-input)
> ;;   (funcall (key-binding (kbd "RET")))
> ;;   )
> 
>   
>
>   I want to execute my shells/python/ruby scirpts  this way by writing out 
> them first, then `C-' doing the rest.
>
>   Does anyone know a better or more native `org' way to do this?
>   Thank you for your help.



Re: [O] Embedding diagrams in Org

2015-02-18 Thread Eduardo Ochs
On Wed, Feb 18, 2015 at 12:19 PM, Eric S Fraga e.fr...@ucl.ac.uk wrote:
 On Wednesday, 18 Feb 2015 at 13:34, Marcin Borkowski wrote:
 Hello all,

 I need to embed some diagrams (graphs of functions, for instance, or
 trees) in an Org file.  Any suggestions on how to do it?  In case of
 ditaa, I can use a source block and the results line, and see the
 image with C-c C-x C-v.  Can I do a similar thing with Asymptote?  How
 hard/time-consuming would it be to add support e.g. for tikz or other
 such tools?

 Support for tikz is there implicitly in that there is support for
 LaTeX.  I use tikz all the time.

 Simple example attached.

 I do believe others have used asymptote in the past.

 HTH,
 eric
 --
 : Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org 
 release_8.3beta-843-ga5f1a3.dirty

Hi Eric,

I tested your example - with `C-c C-e l o' to export to LaTeX and open
the PDF file -, and the ellipse in the middle of the sentence appeared,
but the block

#+begin_src latex :results latex raw :exports results
  \begin{tikzpicture}
\node[red!50!black] (a) {A};
\node (b) [right of=a] {B};
\draw[-] (a) -- (b);
  \end{tikzpicture}
#+end_src

did not make its way to the t.tex file... I asked for help in the
#org-mode channel at freenode, as I am an Org newbie, and found a fix.
Your example is one of the best one I've seen so far of diagrams-
in-Org-for-newbies, but it seems to be at least one micro-bug from
perfect, as it supposes that the person trying it has already enabled
latex support in babel!

Here is an idea to make your example more newbie-friendly: add the
comments below to it.

# Note that you may have to add latex support to babel
# to make the tikzpicture block work...
# see: (info (org)Languages)
# try: (org-babel-do-load-languages 'org-babel-load-languages '((latex . t)))
#
# To disable to question Evaluate this latex code block on your system?,
# see: (info (org)Code evaluation security)
# try: (setq org-confirm-babel-evaluate nil)

Cheers =),
  Eduardo Ochs
  eduardoo...@gmail.com
  http://angg.twu.net/
  http://angg.twu.net/eev-intros/find-eval-intro.html



Re: [O] Moving my init.el to Org

2014-09-06 Thread Eduardo Ochs
Hi all, I hope you don't mind me jumping into this thread to ask an
org-beginner question...

My .emacs is about 15000 lines long, and that's fine for me because I
have anchors at some points of it, and an index at the top, and
convenient ways to jump quickly to any anchors. If anyone is curious,
here are some links - my package that implements those things is
called eev.

  http://angg.twu.net/.emacs.html
  http://angg.twu.net/eev-intros/find-eval-intro.html
  http://angg.twu.net/eev-intros/find-anchors-intro.html
  http://angg.twu.net/#eev

I know that Org implements something similar to that, but I don't know
how to use it. This sexp, when executed,

  (find-angg .emacs unquote-printable)

Jumps to the first occurrence of the string unquote-printable in
my ~/.emacs - in the htmlized version, the target of that sexp is:

  http://angg.twu.net/.emacs.html#unquote-printable

So, questions:

1) what is the user-ish way to create a link in Org to the first
   occurrence of the string unquote-printable in ~/.emacs?

2) I know that Org lets users implement new kinds of hyperlinks. If
   the syntax for doing what I asked in (1) is too clumsy, how do we
   implement a better syntax?

3) The

 (find-angg .emacs unquote-printable)

   calls my functions to visit a file and jump to a position. How can
   I jump to that position using Org's functions *from Lisp*? Or,
   better, how do we write sexps to expose what Org does? My guess is
   that that would be done be several sexps, more or less like this
   pseudocode:

 (org-hyperlink-method-and-args file:///~/.emacs#unquote-printable)
 ;; -- (file-and-anchor ~/.emacs unquote-printable)

 (org-hyperlink-do 'file-and-anchor ~/.emacs unquote-printable)


  Thanks in advance! =)
  Eduardo Ochs
  eduardoo...@gmail.com
  http://angg.twu.net/#eev

On Fri, Sep 5, 2014 at 11:49 PM, Thorsten Jolitz tjol...@gmail.com wrote:
 Marcin Borkowski mb...@wmi.amu.edu.pl writes:

 Hi,

 and thanks for all the great replies!

 I ended up using orgstruct mode, which is probably the simplest one,
 and (AFAIU) it will enable me to switch easily to outshine if (when?)
 orgstruct is not enough for me.

 And now there's another problem: I'd like to have my init file
 collapsed to only headlines on opening.  Since I visit my init file
 through a custom command (which finds it and turns on orgstruct), I
 don't need to use file local variables for that - I just need a
 command to do it.  So:

 how do I (programmatically, in elisp) collapse the view of
 an orgstruct .el file?

 Try 'org-overview'. Both, 'org-overview' and 'show-all' work
 with outshine too, so they should work with org-struct.

 --
 cheers,
 Thorsten





Re: [O] org mode and eev

2013-11-08 Thread Eduardo Ochs
On Fri, Nov 8, 2013 at 6:29 AM, Alan Schmitt alan.schm...@polytechnique.org
 wrote:

 Hi Eduardo,

 eduardoo...@gmail.com writes:

  I am the author of eev...

 Nice! I knew I had seen you around here ;-)

  How can I help?

 Your message already answered one question I had, but I have still one
 pending.

  I still know far less about org-mode than I would like to - maybe
  because I have been using Emacs in a very idiosyncratic way for ages
  8-\ - but it seems trivial to create code blocks that can be executed
  by both org and eev. Here is a example - just replace each *
  below with a real char 15.

 This was my first question: '*' are not '*' so they won't interfere with
 org-mode. This is great. (Quick question: how do I enter such a char 15
 star?)

  ;; 3. Now the char 15s will be displayed as red star glyphs, and the
  ;; code block above can be executed both with org's `C-c C-c' and with
  ;; eev's f8. Try to type f8 on each line below, starting on the
  ;; first one with the (eepitch-shell):
 
  * (eepitch-shell)
  * (eepitch-kill)
  * (eepitch-shell)
  #+begin_src sh
  rm -Rv /tmp/eev/
  mkdir  /tmp/eev/
  cd /tmp/eev/
  wget http://angg.twu.net/eev-current/eev2.tgz
  tar -xvzf eev2.tgz
  #+end_src

 This works great because '#' is a comment prefix for shell, so the
 begin_src lines won't be processed. I want to use eev with other
 toplevels, and so I cannot rely on this. Is it possible to tweak eepitch
 so that lines starting with #+begin_src and #+end_src are not sent at
 all?

 Thanks,

 Alan


About the char 15s / red stars: I spent many years inserting them
all by hand with C-q C-o... Now there is an easier way to create
what I call eepitch blocks, which are the things like these:

* (eepitch-foobar)
* (eepitch-kill)
* (eepitch-foobar)

The easier way is to create an eepitch block for foobar as above
is to type foobar in a line and then type M-T (meta-shift-t).

Note that all these things are explained here,

  (find-eepitch-intro)
  http://angg.twu.net/eev-intros/find-eepitch-intro.html

and that we should definitely create a sandboxed tutorial like that
for using eev with Org... I'm saying we just because I'll need
help with (at least) some details!

About ignoring the #+ lines: this can be done by changing
eepitch-comment-regexp, but there a default way that already
works, which is to skip the #+ lines with down instead of
typing f8 on them...

  Cheers!
Eduardo


Re: [O] org mode and eev

2013-11-07 Thread Eduardo Ochs
On Thu, Nov 7, 2013 at 7:33 AM, Sebastien Vauban sva-n...@mygooglest.comwrote:

 Hello Alan,

 Alan Schmitt wrote:
  I finally took the time to watch the eev video
  (http://angg.twu.net/eev-videos/video2.mp4) and I'm quite impressed by
  it. I find it may be redundant for some features of org mode (such as
  basic links to files) but I find the driving of external shell-based
  programs very nice. As I've seen it mentioned on this list before, I was
  wondering if some of you use it in addition to org mode.

 I've always dreamed of being able to use it from Org, to document
 deployment
 procedures (for example), and execute them.

 With Org only, we're not far when we execute sh code blocks in a session.
 Though, it's possible there must be missing things.

 Best regards,
   Seb

 --
 Sebastien Vauban



Hello all,

I am the author of eev...  How can I help?

I still know far less about org-mode than I would like to - maybe
because I have been using Emacs in a very idiosyncratic way for ages
8-\ - but it seems trivial to create code blocks that can be executed
by both org and eev. Here is a example - just replace each *
below with a real char 15.


1. Execute the code block below with org's `C-c C-c':

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
#+begin_src sh
rm -Rv /tmp/eev/
mkdir  /tmp/eev/
cd /tmp/eev/
wget http://angg.twu.net/eev-current/eev2.tgz
tar -xvzf eev2.tgz
#+end_src


;; 2. Eval this to activate eev-mode:
(progn (add-to-list 'load-path /tmp/eev/)
   (require 'eev2-all)
   (eev-mode 1))


;; 3. Now the char 15s will be displayed as red star glyphs, and the
;; code block above can be executed both with org's `C-c C-c' and with
;; eev's f8. Try to type f8 on each line below, starting on the
;; first one with the (eepitch-shell):

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
#+begin_src sh
rm -Rv /tmp/eev/
mkdir  /tmp/eev/
cd /tmp/eev/
wget http://angg.twu.net/eev-current/eev2.tgz
tar -xvzf eev2.tgz
#+end_src


;; 4. Now links like these should work - note that it is possible to
;; follow them with `M-e' and to go back with `M-k', as explained
;; here: http://angg.twu.net/eev-intros/find-eval-intro.html
;;
;;   (find-eepitch-intro)
;;   (find-eval-intro)
;;   (eek M-5 M-j)



Cheers,
  Eduardo Ochs
  eduardoo...@gmail.com
  http://angg.twu.net/#eev
  http://angg.twu.net/eev-videos/video4-eepitch.mp4


Re: [O] Org Tutorials need more structure

2013-09-30 Thread Eduardo Ochs
On Mon, Sep 30, 2013 at 3:36 PM, Peter Neilson neil...@windstream.netwrote:

 1. Non-video presentations for beginners. Some of us are (for one reason
 or another) badly set up to use video. Perhaps our network connection is
 slow, or our system is flaky and crashes with video. Or perhaps we only
 have five or ten minutes at a time to study. Or perhaps we are mostly
 trying to learn from hard copy we've printed out. A few of us might even be
 blind.


Any chance of an MP4 version of Carsten's Google Tech talk being
produced and uploaded to a public place, with a wget-able URL? It
would be trivial to add to this tutorial - or to some other - the code
to download it and to make mplayer play it from given positions...

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

and integrating into Org the feature described there - namely: with a
certain minor mode activated `M-p' opens the current default video at
the first time offset of the current line - should be little more than
a 10-line hack...

Btw, that would make indices of time offsets in videos like the one in

http://orgmode.org/worg/org-tutorials/org-screencasts/org-mode-google-tech-talk.html
http://orgmode.org/worg/org-tutorials/org-screencasts/org-mode-google-tech-talk.org.html

trivial to execute. I don't have (yet) the skills to make things like
=1:23= become active links that do that in Org, though.

Cheers,
  Eduardo Ochs
  eduardoo...@gmail.com
  http://angg.twu.net/#eev
  edrx at freenode.org (at #eev, #org-mode, etc)


Re: [O] Connect to the ssh and execute any command

2013-09-12 Thread Eduardo Ochs
Hi Andrey,

you can use eev - take a look at the demo that starts at 0:18 in this
video here:

  http://www.youtube.com/watch?v=Lj_zKC5BR64
  http://angg.twu.net/eev-videos/video4-eepitch.mp4

There are many things that I do in the server that hosts my home page
by using this to set up a connection,

  (eepitch-do ssh e...@angg.twu.net)

and then typing f8 on each line that needs to be sent.

If you have any difficulty in setting things up feel free to get in
touch by e-mail, IRC (#eev at Freenode) or gmail chat - there are some
new features that do not appear in videos yet (the videos I have are a
few months old), and I am just resurecting my screencast-making
scripts to make some new ones... and I am exactly at the point where
tests and feedback can clarify a lot my ideas about the best ways to
present things.

  Cheers! =)
Eduardo Ochs
eduardoo...@gmail.com
http://angg.twu.net/



On Thu, Sep 12, 2013 at 6:56 PM, Andrey Tykhonov atykho...@gmail.comwrote:

 Hi all!

 During last several days I was trying to implement quite simple script
 which:

 1. Creates new buffer with the shell (M-x shell)
 2. Executes there ssh usern...@domain.com. As result -- the password
 prompt appears in the minibuffer. I manually input password.
 3. Then script executes any command in the recently created buffer
 (shell), for example: ls -la. So I expect to see directory listing on
 the domain.com.

 but, for sorry, I cannot to do so that ls -la will be executed!

 I googled, I have tried many different approaches but without any luck :-(

 Here I should mention quite important thing: I cannot use TRAMP because
 it does not work with the server to which the script connects and then
 on which executes ls -la. (I suppose that TRAMP uses FUSE, but for
 sorry FUSE does not work with mine server). So TRAMP is not available
 for me.

 For example I tried:

 (progn
   (make-comint-in-buffer ssh *ssh* ssh nil usern...@domain.com)
   (make-comint-in-buffer ls *ssh* ls nil -la)
 )
 ls -la does not executes.

 (progn
   (make-comint-in-buffer ssh *ssh* ssh nil usern...@domain.com)
   ; instead of ls -la here is pwd
   (start-file-process pwd *ssh* pwd)
 )
 In *scratch* outputs just Process pwd finished

 (progn
   (start-process-shell-command ssh *ssh* ssh userna...@domain.com)
   (process-send-string (get-buffer-process *ssh*) pwd\n)
 )
 Seems this one -- is overall wrong approach because
 start-process-shell-command
 does not want to show shell after I put the password in the prompt.

 Also I tried call-process instead of start-process-shell-command:
 (call-process ssh nil *ssh* t usern...@domain.com)

 I got Pseudo-terminal will not be allocated because stdin is not a
 terminal.

 Then...

 (progn
   (setq buffer (get-buffer-create *ssh*))
   ; switch to buffer
   (switch-to-buffer-other-window buffer)
   ; execute there a shell
   (shell buffer)
   ; then executes there mine commands
   (process-send-string (get-buffer-process *ssh*) ssh
 usern...@domain.com)
   (comint-send-input)
   ; and
   (process-send-string (get-buffer-process *ssh*) ls -la)
   (comint-send-input)
 )
 Last process-send-string does not execute in time because it is not
 synchronous.
 Last process-send-string does not wait for previous...

 Also I tried set-process-filter but filter just eats password prompt so
 I could not input password


 How my task could be implemented without TRAMP?

 Please help!



 Regards,
 Andrey









Re: [O] naming and/or directly addressing particular windows?

2012-12-01 Thread Eduardo Ochs
Hi Matt,

if you are considering using a little language to create window
configurations
then maybe you will find this interesting:

  http://angg.twu.net/eev-intros/find-multiwindow-intro.html
  http://angg.twu.net/eev-current/eev-multiwindow.el.html

Cheers!
  Eduardo Ochs
  eduardoo...@gmail.com
  http://angg.twu.net/#eev



On Sat, Dec 1, 2012 at 1:22 PM, Matt Price mopto...@gmail.com wrote:

 Hi,

 After the recent conversation about Scrivener (on help-gnu-emacs) I
 thought the very first step would be to write a simple function that
 would create a window layout and populate the windows with a set of
 buffers, then set mjor and minor modes for some of hte buffers.
 (After that I guess I will have to figure out how to write some very
 simple minor modes, or at least some functions that allow e.g. direct
 editing of org-mode properties on a selected node.)

 So, what I have so far is quite trivial but doesn't seem to work
 exactly as I expected:

 (delete-other-windows)
 (split-window-horizontally)
 (windmove-right)
 (split-window-horizontally)
 (enlarge-window-horizontally 20)
 (windmove-right)
 (split-window-vertically)


 Anyway presumably I'll fiddle with this and eventually it will work,
 but something better would be

 (set-window-name outline)
 (split-named-window-horizontally-and-name-the-other-window outline
 main)
 (split-named-window-horizontally-and-name-the-other-window main
 metadata)
 (set-width-named-window main 60)

 and then write a function, bound to say Ctrl-Enter,

 open-node-as-indirect-buffer-in-named-window

 Anyway:  is it possible to give/get a name for a window that persists
 long enough to be called in functions?

 Thanks,
 Matt




Re: [O] Org HTML-PDF publishing

2012-09-18 Thread Eduardo Ochs
On Tue, Sep 18, 2012 at 2:58 PM, Marcelo de Moraes Serpa 
celose...@gmail.com wrote:

 Hey guys,

 Is it feasible to publish something (say an ebook) to html and then
 convert it to pdf?

 I know *TeX is the most powerful framework for creating PDFs, but given
 that I'm more familiar with CSS, I'm sure I could come up with a
 better style for the document in much less time than if, say, using LaTeX,
 as of now.

 My thought is, publish to HTML via org using a custom CSS, and then
 convert this HTML+CSS to PDF somehow - I'm still not sure how exactly -
 printing to PDF from the browser might be an option, however, I'm afraid
 that the final PDF quality will not be enough for the given publication.

 Has anyone tried this workflow?

 Cheers,

 - Marcelo.


This works very well, but it's non-free:

  http://news.ycombinator.com/item?id=501897
  http://tomayko.com/writings/princexml
  http://www.youtube.com/watch?v=vcXUrNSvjhU

[[]], Eduardo Ochs
  eduardoo...@gmail.com
  http://angg.twu.net/


Re: [O] Org without X on Debian

2012-02-01 Thread Eduardo Ochs
On Tue, Jan 31, 2012 at 6:55 PM, Jay Belanger jay.p.belan...@gmail.com wrote:
  I want to use a small netbook exclusively for Org-mode.
  That's why I think I do not need X.
 
  You may not need it, but a lightweight window manager like WindowMaker
  fvwm or maybe a tiling WM like awesome may be worth a second look.  Have
  a look here:

 If the netbook will only be used for org-mode, and so perhaps only
 running Emacs, a WM might not even be necessary.  If only one Emacs
 frame is used, it could probably be run on bare X.

This works for me:

cat  /tmp/em.sh '%%%'
#!/bin/sh
/usr/bin/emacs
%%%

chmod 755 /tmp/em.sh

XINITRC=/tmp/em.sh xinit -- :2.0 

  Cheers,
Eduardo Ochs
eduardoo...@gmail.com
http://angg.twu.net/



[O] Quick and dirty code blocks: eepitch

2011-11-24 Thread Eduardo Ochs
Hello list,

I just discovered org-babel-screen... I haven't done my org-homework
yet, but I can't resist making an announcement: the package
eepitch.el, at

  http://angg.twu.net/eev-current/eepitch.el.html
  http://angg.twu.net/eev-current/eepitch.el
  http://angg.twu.net/eev-current/eepitch.readme.html

has some goals in common with org-babel - eepitch also lets us script
external programs from Emacs - but it does that in a very different
style from org. In eepitch the emphasys is in the simplicity of the
implementation - its core is less than 200 lines, it runs on plain
Emacs, it uses only two keybindings, support for a new language can
usually be implemented in just one or two lines of Lisp, and eepitch
code blocks can appear in any file and be used in any mode (by the
way, I've been using them in org files for ages). Eepitch's approach
has several downsides, of course - one of them is that eepitch code
blocks will look UGLY to org users, as I never worked on ways of
fontifying them... I will try to implement an org-babel language for
eepitch code blocks (this is part of my homework).

Oh, by the way: org-babel-screen was inspired by the ancestor of
eepitch...

  http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-screen.html
  http://angg.twu.net/eev-current/anim/channels.anim.html

Cheers, :-)
  Eduardo Ochs
  eduardoo...@gmail.com
  http://angg.twu.net/