From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: Examples of use of svg.el? Date: Sat, 2 Apr 2022 07:46:01 -0300 Message-ID: References: <878rsozdb2.fsf@web.de> <87tubcxotr.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37777"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 02 12:47:02 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nabHZ-0009dR-PA for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 02 Apr 2022 12:47:01 +0200 Original-Received: from localhost ([::1]:46212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nabHY-0002LZ-2k for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 02 Apr 2022 06:47:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nabGs-0002LO-5O for help-gnu-emacs@gnu.org; Sat, 02 Apr 2022 06:46:18 -0400 Original-Received: from [2a00:1450:4864:20::231] (port=40843 helo=mail-lj1-x231.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nabGq-0003Q1-Es for help-gnu-emacs@gnu.org; Sat, 02 Apr 2022 06:46:17 -0400 Original-Received: by mail-lj1-x231.google.com with SMTP id g24so6908279lja.7 for ; Sat, 02 Apr 2022 03:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=0YUZb3CvPyFSSsepeWIhtct78UOc/UkJHT5wTOOW0aw=; b=JYLf58ZhJsQmCddJYKT6ptdJAesa4pd0MpogkRkObwOiudaW+vaAPDLjJchIzj0EVV lHDL0yLtqDQQ3+WmqaafIb68vRzWl3235TnXC5g3RTG7+lUmLJp3ZcpVwsEiarNjKNyy CN0lAPDDf12oCG9x2ZZ4lVqBTStLAz453DJK2bVKxPD9Bjj+kTblHqKacgdg5Hj2zBkb byfYY4aC/jFJAuorFVtZTD32/BS8fllAYEgWVGZ7KmmZBNrDxRoW1ML2/Pvys/afn6ad GxdsQE7KoUzzI0hap6fPpOkRhGsQoUG2CEPzxOTk6Jj+GRQJv/g70RCN9RKfmYwm920M /TRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=0YUZb3CvPyFSSsepeWIhtct78UOc/UkJHT5wTOOW0aw=; b=ajmE2U8fAGp/5IgDhBsYhy95fCQw5KQ2tLRqhwgp30Qf+V2gB7Eg0yOtpDJVC8hTsG CA+K1m2TbcdU6yTuMbnSrsgD+n9lj8nUPK9s0g92DV861W5vr7TQKuVbrxyG+HDJ5dyS foO1fzXLcZyIw2CZhno5fWYj/OxquZNPdctsXt0DGi/FE6agR7fYFMD0LruLX1hLEChQ Eqib1dUP8tvrv0y/JrMAz3DVoEs+BGL+TB3m5do92EMJWQL948fXj5EwtUQ72edCoWsj pzTEtna35KDItrt1AQYIEkmZnb7f/5n5Ke71HHH/ZHlv2Rr/9uBtym3w3B0jfuLOgrmi vZ6A== X-Gm-Message-State: AOAM531FtXWDQM4VdJ93He0ijGHnkv2OsB6lFB8ejroQxYsHqtZtG/ZQ 7tgioivbe9K+w2swTVN/+xJ7cZU+PPOZnmzz4ek= X-Google-Smtp-Source: ABdhPJwKbc0mGcsG/n8vMsFqoQApZ0b3mL8FvE+GoNO2IANQAdcoHOztv/WUNk4oJcTOp3MNEInRMTpeBTbbLof/oEg= X-Received: by 2002:a2e:97c9:0:b0:249:8404:a5b7 with SMTP id m9-20020a2e97c9000000b002498404a5b7mr15698165ljj.57.1648896373771; Sat, 02 Apr 2022 03:46:13 -0700 (PDT) In-Reply-To: <87tubcxotr.fsf@web.de> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::231 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=eduardoochs@gmail.com; helo=mail-lj1-x231.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136829 Archived-At: On Fri, 1 Apr 2022 at 22:21, Michael Heerdegen w= rote: > > 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 functi= on > 3 s t x0 ; set x0 to 3 > 2 s t y0 ; ditto y0 to 2 > M-3 =3D ; updates topmost 3 stack values with vars su= bstituted > 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*"))) =E2=80=A2 (calc) (eek "C-x 3 M-1 M-j") =E2=80=A2 (ee-show-calc-windows) =E2=80=A2 (eec "' [x0-1 .. x0+1] RET ;; interval") =E2=80=A2 (eec "' [y0-1 .. y0+1] RET ;; ditto") =E2=80=A2 (eec "' (x-x0)^2 - (y-y0)^2 + 2 RET ;; alt: define a named fun= ction") =E2=80=A2 (eec "3 s t x0 RET ;; set x0 to 3") =E2=80=A2 (eec "2 s t y0 RET ;; set y0 to 2") =E2=80=A2 (eec "M-3 =3D ;; updates topmost 3 stack values with var= s substituted") =E2=80=A2 (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