unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Automatic minor modes?
Date: Sun, 14 Oct 2018 03:59:29 +0000	[thread overview]
Message-ID: <sh19w53y.fsf@lifelogs.com> (raw)
In-Reply-To: <o9c2ykfu.fsf@lifelogs.com> (Ted Zlatanov's message of "Tue, 09 Oct 2018 19:44:05 +0000")

On Tue, 09 Oct 2018 19:44:05 +0000 Ted Zlatanov <tzz@lifelogs.com> wrote: 

TZ> On Mon, 08 Oct 2018 10:57:23 -0400 Stefan Monnier <monnier@iro.umontreal.ca> 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"

https://emacs.stackexchange.com/questions/36572/prettify-symbols-mode-and-multi-character-replacements?noredirect=1&lq=1
https://emacs.stackexchange.com/questions/34808/using-prettify-symbols-with-strings-instead-of-characters?noredirect=1&lq=1

and "how do I hide secrets in Emacs"

https://www.reddit.com/r/emacs/comments/9ncypp/hide_copy_and_edit_secrets_in_gpg_encrypted_file/

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.

Ted



  reply	other threads:[~2018-10-14  3:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-14 14:56 Automatic minor modes? Lars Ingebrigtsen
2018-04-14 11:49 ` Charles A. Roelli
2018-04-14 18:59   ` Lars Ingebrigtsen
2018-04-14 15:23 ` Yuri Khan
2018-04-14 15:27   ` Lars Ingebrigtsen
2018-06-27  1:31     ` Ted Zlatanov
2018-07-22 12:26       ` Lars Ingebrigtsen
2018-07-22 15:51         ` Clément Pit-Claudel
2018-07-22 19:01           ` Stefan Monnier
2018-07-22 20:06             ` Clément Pit-Claudel
2018-10-08  1:05               ` Ted Zlatanov
2018-10-08 14:57                 ` Stefan Monnier
2018-10-09 19:44                   ` Ted Zlatanov
2018-10-14  3:59                     ` Ted Zlatanov [this message]
2018-10-14 14:44                       ` Eli Zaretskii
2018-10-14 15:48                         ` Ted Zlatanov
2018-10-14 16:05                           ` Eli Zaretskii
2018-10-14 18:23                           ` Hiding passords in authinfo (was: Automatic minor modes?) Stefan Monnier
2018-10-14 19:31                             ` Hiding passords in authinfo Ted Zlatanov
2018-10-14 20:55                               ` Stefan Monnier
2018-04-14 15:39 ` Automatic minor modes? Clément Pit-Claudel
2018-04-14 15:45   ` Lars Ingebrigtsen
2018-04-14 16:40     ` Clément Pit-Claudel

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sh19w53y.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).