From: Arthur Miller <arthur.miller@live.com>
To: Joost Kremers <joostkremers@fastmail.fm>
Cc: emacs-devel@gnu.org
Subject: Re: Q: Invisible text spec + define minor mode macro
Date: Wed, 21 Apr 2021 12:02:53 +0200 [thread overview]
Message-ID: <AM9PR09MB4977752F77247B09DAF9E59796479@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <871rb4x8uj.fsf@fastmail.fm> (Joost Kremers's message of "Wed, 21 Apr 2021 11:36:10 +0200")
Joost Kremers <joostkremers@fastmail.fm> writes:
> On Wed, Apr 21 2021, Arthur Miller wrote:
>> I am not sure what is going on here. I have this minor mode defined,
>> as shown yesterday, where I just iterate through a buffer and try to
>> make certain lines invisible.
>
> Wouldn't it be easier to use the font lock mechanism for this? That way, you
> basically only need to worry about getting the regexp right. Finding matches,
> updating the display, etc. is all handled by Emacs.
>
> The `invisible' property is not normally handled by font lock, I guess, but
> there is a variable `font-lock-extra-managed-props', which, by the looks of it,
> should be able to remedy that.
>
> Mind you, I only understand the basics of the font lock mechanism and I haven't
> tried this, so it's possible this is a silly suggestion. It's just the first
> thing I'd try...
I don't think it is a silly, but I think it would be more complicated. I
don't know to be honest, I am not so acquinted with font-lock mechanism
and I don't wanna dive into that one.
I really just need to find each #+begin|end_src which usually start at
line beginning and put the invisible property to 't. That is really
simple. If you check the code, it is almost trivial. I am embarassed I
can't spot what is wrong there :-). The regex in the source file
works. I checked, I counted all matches and got 401 for 200 src blocks.
I think it should be 400, but I am good with 401 :-).
But thanks for the suggestion anyway.
prev parent reply other threads:[~2021-04-21 10:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 8:04 Q: Invisible text spec + define minor mode macro Arthur Miller
2021-04-21 9:16 ` Eli Zaretskii
2021-04-21 9:55 ` Arthur Miller
2021-04-21 17:19 ` Arthur Miller
2021-04-21 17:46 ` Eli Zaretskii
2021-04-21 19:25 ` Tassilo Horn
2021-04-21 20:14 ` Arthur Miller
2021-04-21 9:36 ` Joost Kremers
2021-04-21 10:02 ` Arthur Miller [this message]
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=AM9PR09MB4977752F77247B09DAF9E59796479@AM9PR09MB4977.eurprd09.prod.outlook.com \
--to=arthur.miller@live.com \
--cc=emacs-devel@gnu.org \
--cc=joostkremers@fastmail.fm \
/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).