From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qKYhA0fYRGMgsQAAbAwnHQ (envelope-from ) for ; Tue, 11 Oct 2022 04:43:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WBFDA0fYRGOi0QAAauVa8A (envelope-from ) for ; Tue, 11 Oct 2022 04:43:19 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 69BCE1249C for ; Tue, 11 Oct 2022 04:43:18 +0200 (CEST) Received: from localhost ([::1]:38990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oi5Ej-0007cV-1c for larch@yhetil.org; Mon, 10 Oct 2022 22:43:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oi5EA-0007cN-2M for emacs-orgmode@gnu.org; Mon, 10 Oct 2022 22:42:42 -0400 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]:33393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oi5E8-00058Y-5d for emacs-orgmode@gnu.org; Mon, 10 Oct 2022 22:42:41 -0400 Received: by mail-qv1-xf2c.google.com with SMTP id i9so8224973qvo.0 for ; Mon, 10 Oct 2022 19:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=pmO5SeZgwbkXTb15ISNtkDk//oMxenNn1jSoazbLDW0=; b=O2CNAY1+6I32kybPrtEPvbfVxEj4RxhFYoNeH0wANMiaNuBFC7BCIp/FBeuDyTiGgu g/w+9zcEbwMPJuipKMNibgclWWP6wBVwNg3u4IEDnlUYCKxU9SBBRWz7zlif2uOmCwIc gi0s6clG7VRJtmhJGUgKQGefkGwjI6r0jTD0QpFx/PmEL14ksMTdQjoWYj7KuD4ztKC3 sGieYb7tOZaN/yBvRUTSEKZsZiM2nq2VihNrPs4SqG9PcQnJfKpwsctPExsvAjFB7/Jj hQzeb/QEXKbOzd95K0mEr/r1tllbd7QdnTOmsOgCNfF3RtSQDh5flWoyvEeFtsNTWpBV W6Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pmO5SeZgwbkXTb15ISNtkDk//oMxenNn1jSoazbLDW0=; b=KM39pg0TvgnivuPrexbkbakx5m+/59XRF1WElTFvxQAZY8Bcilo9RCn4fFrYWDixtl LT4WwGisbm8zTWNEtNv9O5b5tKjLt9cPklBplJFATLHFNxAybNl7FjbtWHHsYQpBLTUK QUJXbQuBpFZh+9562kvjqjE1VQgWHM3+5W+LGqz92TumEIKU+ykkrRfwSVMiCAuVcRzT Opu3n+xQMgWA/vxWmUgCmCOf55/3QweJyRTEzif7WSNQBtm2cYpFtYm10mXWm33vssvK T7ejLo5H9PfikSEZfDwXFnLhW5subuwG9m/x28eEeGZ/W0rzfJnlUpY2pFhqROBgM1Ep zq+g== X-Gm-Message-State: ACrzQf1IXF/K3tjEfRAMStg8svFRvfUXS6fz32eO9kCrFGByMvE7TrmB xsb/beGQUehao19H27hXEicuMyr6S3o= X-Google-Smtp-Source: AMsMyM4rw0Yv/NTZiAGGKSuzmWGhcXjTMdaQVxLNO9zwz+JsL4L3BHPxn+5mhNcLCB59tbSkaC34kg== X-Received: by 2002:ad4:5f0b:0:b0:4b1:7a60:399a with SMTP id fo11-20020ad45f0b000000b004b17a60399amr17372314qvb.101.1665456158098; Mon, 10 Oct 2022 19:42:38 -0700 (PDT) Received: from smtpclient.apple (ool-2f1480e0.dyn.optonline.net. [47.20.128.224]) by smtp.gmail.com with ESMTPSA id dt39-20020a05620a47a700b006ec59941acasm6132133qkb.11.2022.10.10.19.42.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Oct 2022 19:42:37 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Robert Weiner Mime-Version: 1.0 (1.0) Subject: Re: Org, Hyperbole, and eev Date: Mon, 10 Oct 2022 22:42:36 -0400 Message-Id: References: Cc: Eduardo Ochs , emacs-org list In-Reply-To: To: Jean Louis X-Mailer: iPhone Mail (19H12) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2c; envelope-from=rswgnu@gmail.com; helo=mail-qv1-xf2c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665456198; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=pmO5SeZgwbkXTb15ISNtkDk//oMxenNn1jSoazbLDW0=; b=HPwaOnD4Oi9vxSayhoXYBGTwoZxOHCd9xwhPEhO2ziY1Jz4hWo+b5z9V4GraCPE5JaJ8gR tu3or6+9FilLZB9SCOp4PQZL2Cxqah4qe+kff9ZtpkeQt2ODbcFDv1LXDzOo9bsGTdlzpS BN293yxC7YvV4ae4NpQMLfrdmPXzE1U7YC3i52QcbAa2RTAycu6mL5DZg+Uu4oSnaLzQtR CWLIJ1/5eTW9wUunTZaoBfjBKqz75cKokRr8Wogw3yFDRee1DPemfjFA6KklAQ8xmsKWQx vmtl8dIbG/LPXE82yMTC4yHFFSNoIJD4hXAZJBgo9mi/QSw3IWxoI4CQIN09Jw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665456198; a=rsa-sha256; cv=none; b=Z90aoRH1zjbTvhwqRFWh6yfkiFVvv59/klikYZWsqA5JACNTKBlaTWhA0g1hyMjSWLWUo4 RnzfUQldHoYjMBXTUZzVxt3M8EbZW4gTIS+xvJELMbGBHYkq8S8MPfgTPUf/eLeqRD+rps sHj3ZbDeIx6Cql2sm9ZTcLUJwmVIPMXQok8gk6R/aiLaB+mKWY9nhGdzk+98MeMn5OqhDM E3yy5AK6cfOsSIQjt4pSrv0HtWMtH5KAiUz7/HbLzhuWRaSieP5ZlkjqNcd93AflL8hxPR zuxzESqH+WXPHD2mW5VWZ2n11+FGD1cm9Qh7XzrpujK/Dslc24T4C9KfM4V4GA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=O2CNAY1+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.69 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=O2CNAY1+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 69BCE1249C X-Spam-Score: -4.69 X-Migadu-Scanner: scn0.migadu.com X-TUID: XX+zKsTCxgi5 Hi Jean: I know this does not address everything you want but if you leverage Hyperbo= le=E2=80=99s capabilities, you=E2=80=99ll probably be able to get what you w= ant with a lot less code. First, creating an explicit button displays only the button name as you like= , fontified as you like, and with the button action hidden. So then you nee= d to write a function that adds or removed the button action from the buffer= when you want to see it, utilizing existing Hyperbole code from the actype o= r action class for manipulating actions. For your generalized syntax, I think you would be better off using the angle= brackets of Hyperbole=E2=80=99s action buttons but you could instead use th= e defil macro to create your own link button type and delimiter format with j= ust a few lines of code. Just follow the example in the docstring for that m= acro. Org probably has similar capabilities with its link types though not as flex= ible with the syntax. -- rsw > On Oct 8, 2022, at 1:00 AM, Jean Louis wrote: >=20 > =EF=BB=BF* Eduardo Ochs [2022-10-08 03:28]: >>> On Thu, 29 Sept 2022 at 06:22, Jean Louis wrote: >>>=20 >>> I am definitely interested, make prototype please. Just can't answer pro= perly on travel. >>=20 >> Hi Jean Louis, >>=20 >> Sorry, I will have to put that on hold until my holidays... I wrote a >> very primitive prototype, but I never had to write much code that >> generates text with text properties, my friends are not interested in >> playing with that together with me, and I don't know where to borrow >> ideas from, so adding each new small feature by myself is a >> struggle... and right now writing code "whose inner details don't >> matter" is exactly the opposite of my notion of fun... =3D( >=20 > Fine, solution will come up with time.=20 >=20 > In the sense is similar to Org links, though just universal. With the > RCD Template Interpolation System for Emacs: > https://hyperscope.link/3/7/1/3/3/RCD-Template-Interpolation-System-for-Em= acs.html > and this function, I can easily replace such snippets as below to their va= lues: >=20 > ** Hello heading >=20 > =E2=9F=A6 (format "[[https://www.example.com][Hello there %s]]" user-full-= name) =E2=9F=A7 >=20 > (defun rcd-org-interpolate () > "Extrapolate Org buffer before dispatch." > (interactive) > (let ((my-org (buffer-substring (point-min) (point-max)))) > (with-temp-buffer > (insert (rcd-template-eval my-org)) > (org-export-dispatch)))) >=20 > (keymap-set org-mode-map "C-c C-e" 'rcd-org-interpolate) >=20 > to get Org hyperlinks. Or any other type of a link? >=20 > (defun hyperscope-hyperlink (id &optional markup) > (let ((name (hyperscope-name id)) > (link (hyperscope-hyperdocument-url id)) > (markup (or markup (hyperscope-markup-type id)))) > ;; (unless (or (eq (last-key-binding) 'newline) > ;; (=3D (last-key) 13)) > ;;(rcd-button-insert name (lambda (_) (hyperscope id)))) > (cond ((or (eq major-mode 'markdown-mode) > (and (not rcd-current-table-id) > (or (=3D markup 2) > (=3D markup 3) > (=3D markup 6)))) > (format "[%s](%s \"%s\")" name link name)) > ((eq major-mode 'adoc-mode) (format "%s[%s]" (hyperscope-hyperdocume= nt-url id) name)) > ((eq major-mode 'org-mode) (format "[[%s][%s]]" link name))))) >=20 > Same may be used to insert buttons: >=20 > (defun rcd-button-insert (button-text action-function &optional how-many) > "Insert button BUTTON-TEXT with ACTION-FUNCTION. >=20 > Optional number HOW-MANY adds superscript digits to BUTTON-TEXT." > (insert-text-button button-text > 'action > action-function > 'follow-link t) > (when how-many > (insert (rcd-superscript-digits how-many)))) >=20 > (rcd-button-insert "Hello" (lambda (_) (message "I said Hello"))) >=20 > now if button can be inserted, it means =E2=9F=A6 (could insert button as w= ell) =E2=9F=A7=20 > and make the link invisible part of text. Once toggled, invisible > part could become visible and saved as such link. >=20 >=20 > --=20 > Jean >=20 > Take action in Free Software Foundation campaigns: > https://www.fsf.org/campaigns >=20 > In support of Richard M. Stallman > https://stallmansupport.org/