unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eduardo Ochs <eduardoochs@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Examples of use of svg.el?
Date: Sat, 2 Apr 2022 07:46:01 -0300	[thread overview]
Message-ID: <CADs++6i-Z4fTu3L=Qw-AOWKQH7mHEqXXDwZKwfjBFNais2rUVQ@mail.gmail.com> (raw)
In-Reply-To: <87tubcxotr.fsf@web.de>

On Fri, 1 Apr 2022 at 22:21, Michael Heerdegen <michael_heerdegen@web.de> wrote:
>
> Calc is a cool interactive Calculator, but IMHO it's not so super useful
> as programming language or for writing scripts, and it seems that's what
> you want to do.
>
> With my current Calc skills I would solve the above task like
>
> ' [x0-1 .. x0+1] RET      ; interval
> ' [y0-1 .. y0+1] RET      ; ditto
> ' (x-x0)^2 - (y-y0)^2 + 2 ; you could alternatively define a named function
> 3 s t x0                  ; set x0 to 3
> 2 s t y0                  ; ditto y0 to 2
> M-3 =                     ; updates topmost 3 stack values with vars substituted
> g F                       ; draw it


Hi Michael,

thanks a lot!!! I found a way to record an interaction with Calc, but
the way to set up the windows is still very fragile. Here is a video,

  http://angg.twu.net/eev-videos/2022eev-calc-0.mp4

and here is the code:



(defun eek-at-window (window keyseq)
  (save-selected-window
    (select-window (get-buffer-window window))
    (eek keyseq)))

(defun eec (keyseq) (eek-at-window "*Calculator*" keyseq))

(defun ee-show-calc-windows ()
  (interactive)
  (find-wset "13o_3o_o"
    '(find-ebuffer "*Calculator*")
    '(find-ebuffer "*Calc Trail*")))

• (calc) (eek "C-x 3 M-1 M-j")
• (ee-show-calc-windows)
• (eec "' [x0-1 .. x0+1] RET             ;; interval")
• (eec "' [y0-1 .. y0+1] RET             ;; ditto")
• (eec "' (x-x0)^2 - (y-y0)^2 + 2 RET    ;; alt: define a named function")
• (eec "3 s t x0 RET                     ;; set x0 to 3")
• (eec "2 s t y0 RET                     ;; set y0 to 2")
• (eec "M-3 =          ;; updates topmost 3 stack values with vars substituted")
• (eec "g F            ;; draw it")



...it needs to be run from ~/TODO, and it is very fragile. The line

  (calc) (eek "C-x 3 M-1 M-j")

will start Calc, and Calc will (usually?) make the frame display the
"*Calculator*" window at the left and the "*Calc Trail*" window at the
right. Then in the `eek' sexp the `C-x 3' splits the "*Calculator*"
window into a left half and a right half, and the `M-1 M-j' makes the
left half visit the file "~/TODO". The

  (ee-show-calc-windows)

resizes the windows to make the "~/TODO" window take 50% of the width
of the frame and the window "*Calculator*" and "*Calc Trail*" take 25%
each.

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



  parent reply	other threads:[~2022-04-02 10:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01  7:05 Examples of use of svg.el? Eduardo Ochs
2022-04-01 11:11 ` Tomas Hlavaty
2022-04-01 21:47 ` Michael Heerdegen
2022-04-02  0:12   ` Eduardo Ochs
2022-04-02  1:21     ` Michael Heerdegen
2022-04-02  3:56       ` Michael Heerdegen
2022-04-02 10:46       ` Eduardo Ochs [this message]
2022-04-03  4:58         ` Michael Heerdegen

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++6i-Z4fTu3L=Qw-AOWKQH7mHEqXXDwZKwfjBFNais2rUVQ@mail.gmail.com' \
    --to=eduardoochs@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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).