Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

It's ten o'clock; do you know where your processes are?


computers / comp.editors / Hiding/Showing Text

SubjectAuthor
* Hiding/Showing TextLawrence D'Oliveiro
+- Re: Hiding/Showing TextJanis Papanagnou
`* Re: Hiding/Showing TextJohanne Fairchild
 `* Re: Hiding/Showing TextLawrence D'Oliveiro
  +* Re: Hiding/Showing TextJohanne Fairchild
  |`- Re: Hiding/Showing TextLawrence D'Oliveiro
  `- Re: Hiding/Showing TextAxel Reichert

1
Hiding/Showing Text

<uu52n5$3su5b$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=245&group=comp.editors#245

  copy link   Newsgroups: comp.editors
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.editors
Subject: Hiding/Showing Text
Date: Fri, 29 Mar 2024 00:41:10 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 57
Message-ID: <uu52n5$3su5b$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 29 Mar 2024 00:41:10 +0100 (CET)
Injection-Info: dont-email.me; posting-host="521a9234fa531f5fbb354bce794424cb";
logging-data="4094123"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bcuCLTfPrvDMyK++skZvD"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:eI1bx8FALeDWBbj9przAUm4bjjQ=
 by: Lawrence D'Oliv - Fri, 29 Mar 2024 00:41 UTC

Emacs has this feature called “overlays”, which let you set custom
display attributes for portions of a text buffer. This can include
completely hiding the text. That can be handy if you want to look at
two parts of a source file while temporarily ignoring some irrelevant
details in-between.

Here is a command that hides a selected region of text, replacing it
with a distinctive marker symbol, and also attaching a distinctive
category identifier for the overlay:

(defun hide_text (beg end)
(interactive "r")
(let
(
(olay (make-overlay beg end))
)
(overlay-put olay 'category 'collapsar)
(overlay-put olay
'display #("🐧\n" 0 1 (face '(:foreground "turquoise" :background "yellow")))
)
(overlay-put olay 'evaporate t)
(deactivate-mark)
) ; let
) ; hide_text

Here is a function that invokes a specified callback for all overlays
of that category that overlap a specified position:

(defun foreach_hidden_text_at (act pos)
(dolist (olay (overlays-at pos))
(when (eq (overlay-get olay 'category) 'collapsar)
(funcall act olay)
) ; when
) ; dolist
) ; foreach_hidden_text_at

And here is a command that uses foreach_hidden_text_at to reveal all
hidden text at the current position:

(defun reveal_text ()
(interactive)
(let
(
(revealed-something)
)
(foreach_hidden_text_at
(lambda (olay)
(delete-overlay olay)
(setq revealed-something t)
) ; lambda
(point)
) ; foreach_hidden_text_at
(unless revealed-something
(ding)
) ; unless
) ; let
) ; reveal_text

Re: Hiding/Showing Text

<uu635i$7h3b$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=246&group=comp.editors#246

  copy link   Newsgroups: comp.editors
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.editors
Subject: Re: Hiding/Showing Text
Date: Fri, 29 Mar 2024 10:54:57 +0100
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <uu635i$7h3b$1@dont-email.me>
References: <uu52n5$3su5b$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 29 Mar 2024 09:54:59 +0100 (CET)
Injection-Info: dont-email.me; posting-host="e69c431b514d7dea0b983a8ae814ccd0";
logging-data="246891"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19wFb48Up87R1Aa+nM9GXHp"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:5nkCUNt6tQAzlJSENj3TaQFtLrY=
In-Reply-To: <uu52n5$3su5b$3@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Fri, 29 Mar 2024 09:54 UTC

On 29.03.2024 01:41, Lawrence D'Oliveiro wrote:
> Emacs has this feature called “overlays”, which let you set custom
> display attributes for portions of a text buffer. This can include
> completely hiding the text. That can be handy if you want to look at
> two parts of a source file while temporarily ignoring some irrelevant
> details in-between.
>
> [...]

I was astonished to read that there's a necessity to add such
functions to Emacs. Would have expected that it's there already
as Emacs being one of the prominent and widely used editors.

If I inspect https://en.wikipedia.org/wiki/Code_folding the table
shows three (of four) "Yes" for folding support, albeit marked
with footnotes (which might indicate some restriction/workaround?).

Since I'm not using that editor I'm just curious what deficiency
the posted functions solve or add to the existing folding features
in Emacs as seen in Wikipedia. (From the code I cannot derive that,
so I'm asking.)

Janis

Re: Hiding/Showing Text

<87zfuhxokt.fsf@tudado.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=247&group=comp.editors#247

  copy link   Newsgroups: comp.editors
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jfairchild@tudado.org (Johanne Fairchild)
Newsgroups: comp.editors
Subject: Re: Hiding/Showing Text
Date: Fri, 29 Mar 2024 08:30:26 -0300
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <87zfuhxokt.fsf@tudado.org>
References: <uu52n5$3su5b$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 29 Mar 2024 11:30:27 +0100 (CET)
Injection-Info: dont-email.me; posting-host="f666225367230cb092212f4ff55a99ef";
logging-data="292547"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19i/pKbF3mra6V49J1XL4TnX7YvNtZDxgA="
Cancel-Lock: sha1:RDSZQAzCGNzqmsO1l7UNmfI1jRc=
sha1:tOQI9kLggJ5UTyiTJdz6G2mVYaU=
 by: Johanne Fairchild - Fri, 29 Mar 2024 11:30 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

> Emacs has this feature called “overlays”, which let you set custom
> display attributes for portions of a text buffer. This can include
> completely hiding the text. That can be handy if you want to look at
> two parts of a source file while temporarily ignoring some irrelevant
> details in-between.

That's one of the fundamental objectives of literate programming. By
the way, comp.programming.literate has been restored very recently.

Re: Hiding/Showing Text

<uuvc9f$32mbm$4@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=248&group=comp.editors#248

  copy link   Newsgroups: comp.editors
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.editors
Subject: Re: Hiding/Showing Text
Date: Mon, 8 Apr 2024 00:03:59 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <uuvc9f$32mbm$4@dont-email.me>
References: <uu52n5$3su5b$3@dont-email.me> <87zfuhxokt.fsf@tudado.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 08 Apr 2024 00:04:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ba48ee83c2dfe27d1f58abbb170b1e26";
logging-data="3234166"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HKjkLnUteG04fROkbE9KL"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:M9b++lB3UV38z6aNBckYCJzTbZg=
 by: Lawrence D'Oliv - Mon, 8 Apr 2024 00:03 UTC

On Fri, 29 Mar 2024 08:30:26 -0300, Johanne Fairchild wrote:

> That's one of the fundamental objectives of literate programming.

As far as I’m aware, “literate programming” is only a way of presenting
code, not for letting you mess around with it. Jupyter notebooks not only
let you present code, they also encourage experimentation. And they let
the code itself produce rich output, like images, audio, video and even
interactive widgets.

Re: Hiding/Showing Text

<877ch82k8w.fsf@tudado.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=249&group=comp.editors#249

  copy link   Newsgroups: comp.editors
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jfairchild@tudado.org (Johanne Fairchild)
Newsgroups: comp.editors
Subject: Re: Hiding/Showing Text
Date: Mon, 08 Apr 2024 07:59:11 -0300
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <877ch82k8w.fsf@tudado.org>
References: <uu52n5$3su5b$3@dont-email.me> <87zfuhxokt.fsf@tudado.org>
<uuvc9f$32mbm$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 08 Apr 2024 10:59:12 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ab8f92d7e7afa40ad3b5c21c97686c83";
logging-data="3629898"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19R1VCOKtbpV0ldPG6KPBaE5cBanKP1PHc="
Cancel-Lock: sha1:6OhYbbaQ6HM9hRMRFjhpABLbmUk=
sha1:rFv/2wLse2FDp01d/7jYu3nLmsU=
 by: Johanne Fairchild - Mon, 8 Apr 2024 10:59 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

> On Fri, 29 Mar 2024 08:30:26 -0300, Johanne Fairchild wrote:
>
>> That's one of the fundamental objectives of literate programming.
>
> As far as I’m aware, “literate programming” is only a way of presenting
> code, not for letting you mess around with it.

Literate programming allows you take entire chunks of error verification
out of the way by replacing them with a chunk tag. (Now you look at the
relevant part of your code without having to look at irrelevant parts.)
When you want to compile your program, the literate programming tool
replaces the chunk tag with the code to which it refers.

Re: Hiding/Showing Text

<87frvv52x0.fsf@axel-reichert.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=250&group=comp.editors#250

  copy link   Newsgroups: comp.editors
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mail@axel-reichert.de (Axel Reichert)
Newsgroups: comp.editors
Subject: Re: Hiding/Showing Text
Date: Mon, 08 Apr 2024 16:45:15 +0200
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <87frvv52x0.fsf@axel-reichert.de>
References: <uu52n5$3su5b$3@dont-email.me> <87zfuhxokt.fsf@tudado.org>
<uuvc9f$32mbm$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 08 Apr 2024 14:45:15 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="bd07ed447c466329d3a503135ac3fb1e";
logging-data="3741414"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19DheXdSYFj7iH3noIAsohtUJjPF9mjQBc="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:EKKWVoqBGuuHfzBsCTXMjQtBtI8=
sha1:der7w8dJQvbQ0jkmgb5VWnf6yAo=
 by: Axel Reichert - Mon, 8 Apr 2024 14:45 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

> As far as I’m aware, “literate programming” is only a way of presenting
> code, not for letting you mess around with it. Jupyter notebooks not only
> let you present code, they also encourage experimentation. And they let
> the code itself produce rich output, like images, audio, video and even
> interactive widgets.

Have a look at org-babel in Emacs.

Axel

Re: Hiding/Showing Text

<uv233i$3q9do$9@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=251&group=comp.editors#251

  copy link   Newsgroups: comp.editors
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.editors
Subject: Re: Hiding/Showing Text
Date: Tue, 9 Apr 2024 00:45:39 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <uv233i$3q9do$9@dont-email.me>
References: <uu52n5$3su5b$3@dont-email.me> <87zfuhxokt.fsf@tudado.org>
<uuvc9f$32mbm$4@dont-email.me> <877ch82k8w.fsf@tudado.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 09 Apr 2024 00:45:39 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c62da5eaa27d15bf3b04834dfd3595c9";
logging-data="4007352"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187WKu1ElzMLuTsIFFy72Vj"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:Z8LCCSkMZo8UWmh4VH/cGRZV0U4=
 by: Lawrence D'Oliv - Tue, 9 Apr 2024 00:45 UTC

On Mon, 08 Apr 2024 07:59:11 -0300, Johanne Fairchild wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> On Fri, 29 Mar 2024 08:30:26 -0300, Johanne Fairchild wrote:
>>
>>> That's one of the fundamental objectives of literate programming.
>>
>> As far as I’m aware, “literate programming” is only a way of presenting
>> code, not for letting you mess around with it.
>
> Literate programming allows you take entire chunks of error verification
> out of the way by replacing them with a chunk tag.

Interesting, but maybe not very useful nowadays.


computers / comp.editors / Hiding/Showing Text

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor