From: Jean Louis <bugs@gnu.support>
To: Eduardo Ochs <eduardoochs@gmail.com>
Cc: Robert Weiner <rswgnu@gmail.com>, emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: Org, Hyperbole, and eev
Date: Wed, 28 Sep 2022 09:04:16 +0300 [thread overview]
Message-ID: <YzPj4OrVEwYq2Lyc@protected.localdomain> (raw)
In-Reply-To: <CADs++6iem8Xc4mtL7L8qr2x=boTSP-422PpCbq6NxCyh-FOhWA@mail.gmail.com>
* Eduardo Ochs <eduardoochs@gmail.com> [2022-09-28 03:54]:
> On Tue, 27 Sept 2022 at 18:59, Jean Louis <bugs@gnu.support> wrote:
> > (...)
>
> What did you do to inspect an Org link?
>
> Here's what I just tried: I created a file /tmp/foo.org containing
> " [[http://a/b/][ab]]\n" - i.e., a space, a link, and a newline -
> and then I marked the whole buffer and ran `M-1 M-x find-eregionpp'
> on it to pretty-print the region as a string with properties, with
> the flag `print-circle' turned on... see:
>
> (find-efunction 'find-eregionpp)
> http://angg.twu.net/eev-current/eev-blinks.el.html#find-eregionpp
>
> Apparently Org divided that file into 8 subsegments, each one with
> different text properties... and they mention all these keywords:
>
> face follow-link font-lock-multiline fontified help-echo highlight
> htmlize-link intangible invisible keymap mouse-2 mouse-3 mouse-face
> org-find-file-at-mouse org-link org-linked-text org-open-at-mouse
> rear-nonsticky
>
> I _think_ that it should be possible to make this
I have followed it, though it helps me little. You know that better.
I would like to have non-Org links so that my function for links
interpolates into a button. It works now in the presentation mode. I
would like to make links descriptive or non descriptive just as in
Org, so that it works in editing mode.
> ⟦ (hyperscope-wrap-eev "Hyperbole DEMO file" '(find-hyperbolefile "DEMO")) ⟧
>
> into a kind of button using only three subregions with different text
> properties: a first invisible region with this,
>
> ⟦ (hyperscope-wrap-eev "
>
> then a visible region with "button actions", with this,
>
> Hyperbole DEMO file
>
> and then another invisible region with:
>
> " '(find-hyperbolefile "DEMO")) ⟧
Not like that really. Anything within ⟦ ⟧ or other delimiters, I wish
to get interpolated depending of settings. I would like to find or mae
general non-specific library for any kind of links to be customized. I
know this does not explain it well.
I am using:
RCD Template Interpolation System for Emacs:
https://hyperscope.link/3/7/1/3/3/RCD-Template-Interpolation-System-for-Emacs.html
Right now I use ⟦ ⟧ delimiters, but I could use as well ()
Let us say ⟦ emacs-version ⟧ I get easily visible with C-a a which
invokes:
(defun rcd-lightweight-markup-preview ()
(interactive)
(cond ((string= rcd-markup-language "asciidoc") (rcd-asciidoc-preview))
((string= rcd-markup-language "asciidoctor") (rcd-asciidoctor-preview))
((eq major-mode 'adoc-mode) (rcd-asciidoctor-preview))
((eq major-mode 'markdown-mode) (rcd-markdown-preview))
((eq major-mode 'html-mode) (rcd-markdown-preview))
((eq major-mode 'mhtml-mode) (rcd-markdown-preview))
((eq major-mode 't2t-mode) (rcd-txt2tags-html-preview))
((eq major-mode 'text-mode) (rcd-template-buffer-preview))
((eq major-mode 'mail-mode) (rcd-template-buffer-preview))
(t (warn "I don't have preview for `%s'" major-mode))))
Example preview function:
(defun rcd-template-buffer-preview ()
(interactive)
(let* ((current (current-buffer))
(buffer (format "Preview of buffer %s" current))
(string (buffer-string))
(mode major-mode)
(point (point)))
(pop-to-buffer-same-window buffer)
(insert (rcd-template-eval string))
(goto-char point)
(funcall mode)
(message buffer)))
That function uses rcd-template-eval so it means:
⟦ emacs-version ⟧ becomes "29.0.50"
Thus I would like to cover ⟦ ⟧ delimiters to become button which name
and action will be returned by the function itself. I know how to
replace the buffer with interpolated values, and links would appear,
but when I save buffer, ⟦ ⟧ links would not appear. I can use any
delimiters.
It would be good to have generalized Org-link descriptive and
non-descriptive links for any kinds of links.
- let us say that buffer is in markdown-mode
- let us imagine that link is (link "Name of link" 12) where by 12 is
ID of the link and where by "link" is function that provides button
with button name "Name of link" and action that could be anything.
- function "link" would then recognize that it is in major-mode like
"markdown", and thus invoke formatting proper for markdown,
something like this:
⟦ (cond (rcd::description (format "[%s](%s \"%s\") - %s" rcd::name rcd::link rcd::name rcd::description))
(rcd::name (format "[%s](%s \"%s\")" rcd::name rcd::link rcd::name))
(t (format "<%s>" rcd::link))) ⟧
but if text is in Org mode, it would invoke different formatting:
⟦ (format "[[%s][%s \"%s\"]" rcd::link rcd::name)) ⟧
For that to work in editing mode (not only in presentation), I would
need generic library to capture my ⟦ ⟧ delimiters (or others) and that
when buffer is interpolated, that it can be saved so that links are
also saved, and not that interpolated values are saved instead of
links; also that one can show back the buffer without interpolated
values.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
⟦ (hyperscope-link 72828) ⟧
next prev parent reply other threads:[~2022-09-28 6:22 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-26 15:56 Org, Hyperbole, and eev Eduardo Ochs
2022-06-26 16:28 ` Robert Weiner
2022-06-26 17:51 ` Eduardo Ochs
2022-06-26 18:23 ` Robert Weiner
2022-06-26 19:45 ` Eduardo Ochs
2022-06-26 20:23 ` Robert Weiner
2022-06-26 23:25 ` Eduardo Ochs
2022-06-27 0:49 ` Robert Weiner
2022-06-27 3:48 ` Eduardo Ochs
2022-06-27 4:11 ` Robert Weiner
2022-06-28 4:43 ` Eduardo Ochs
2022-09-27 15:10 ` Jean Louis
2022-09-27 16:22 ` Eduardo Ochs
2022-09-27 21:16 ` Jean Louis
2022-09-27 21:58 ` Jean Louis
2022-09-28 0:52 ` Eduardo Ochs
2022-09-28 6:04 ` Jean Louis [this message]
2022-09-28 10:15 ` Eduardo Ochs
2022-09-29 9:22 ` Jean Louis
2022-10-08 0:28 ` Eduardo Ochs
2022-10-08 1:25 ` Jean Louis
2022-10-11 2:42 ` Robert Weiner
2022-10-11 4:59 ` Jean Louis
2022-09-29 9:42 ` Jean Louis
2022-09-29 11:55 ` Quiliro Ordóñez
2022-09-28 3:52 ` Ihor Radchenko
2022-09-28 9:16 ` Jean Louis
2022-09-29 4:07 ` Ihor Radchenko
2022-09-29 9:59 ` Jean Louis
2022-06-28 4:48 ` Eduardo Ochs
2022-06-28 6:26 ` Robert Weiner
2022-09-27 14:43 ` Jean Louis
2022-09-27 14:16 ` Jean Louis
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YzPj4OrVEwYq2Lyc@protected.localdomain \
--to=bugs@gnu.support \
--cc=eduardoochs@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=rswgnu@gmail.com \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.