[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatic minor modes?

From: Ted Zlatanov
Subject: Re: Automatic minor modes?
Date: Sun, 14 Oct 2018 03:59:29 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On Tue, 09 Oct 2018 19:44:05 +0000 Ted Zlatanov <address@hidden> wrote: 

TZ> On Mon, 08 Oct 2018 10:57:23 -0400 Stefan Monnier <address@hidden> wrote: 
>>> Any ideas here? This is still a feature worth having, I think. But
>>> Clément and Stefan's comments have confused me so I don't know if it's
>>> waiting for something and if there's a "right" way to do it?

SM> IIUC there are many different right ways.

TZ> Stefan, can you recommend one? We all trust your expertise and you did a
TZ> lot of the work on prettify-symbols-mode that would apply here :)

I found several other threads about this, asking more or less the same
things "how to I use prettify-symbols-mode with strings/regexps"


and "how do I hide secrets in Emacs"


The users are asking for this--it's not just us here. From my side, I
wanted to add support for it to JSON mode (for authinfo.json users) and
a netrc minor mode or something.

So... I looked at several things:

`reveal-mode`: the docs are simply unclear about how to use it:

;; Reveal mode is a minor mode that makes sure that text around point
;; is always visible.  When point enters a region of hidden text,
;; `reveal-mode' temporarily makes it visible.
;; It only works with packages that hide text using overlays.

...but no explanation of how to use it, practically, just references to
other packages which don't explain it either. It all seems custom-fitted
together in a way that's hard to reuse.

Then I looked at "(elisp) Replacing Specs" which let me to "(elisp)
Other Display Specs" and "(elisp) Overlay Properties" and... it was
not easy to follow when I just wanted to use reveal-mode. OK, I can make
overlays with special display properties... but how do I hook that with
font-lock and why do I have to know these details?

I then looked at the hideshow and outline modes, and they didn't have
generic functionality either, and it wasn't clear to me how to use them.

I looked at prettify-symbols-mode but extending it for strings and
regexps seems a bit inconsistent with how it was designed. I could hack
it probably.

Thus I was not able to make progress on this one. Maybe someone else
will, or be able to help me.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]