eev
[Top][All Lists]
Advanced

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

Overlays for "understand" and "don't understand"


From: Eduardo Ochs
Subject: Overlays for "understand" and "don't understand"
Date: Tue, 20 Dec 2022 15:54:00 -0300

Hi Quiliro!

I had some ideas.

The first one was to write some kind of parser that would show the
"category" of each line - in some sense - and if that line should be
executed with f8, M-e, or what. That would be hard to do... even a
barebones prototype would take me more than one day to write.

The second one is this:

  (defun gr (beg end)
    "Green: create an green overlay over the region"
    (interactive "r")
    (deactivate-mark 'force)
    (let ((ovl (make-overlay beg end)))
      (overlay-put ovl 'face '(:background "DarkOliveGreen" :extend t))))

  (defun rd (beg end)
    "Red: create an red overlay over the region"
    (interactive "r")
    (deactivate-mark 'force)
    (let ((ovl (make-overlay beg end)))
      (overlay-put ovl 'face '(:background "DarkRed" :extend t))))

  (defun nc ()
    "No color: delete all overlays at point"
    (interactive)
    (cl-loop for ovl in (overlays-at (point))
             do (delete-overlay ovl)))

Try to eval these defuns with `M-e' or `M-x eval-region'.
Then mark a  region and run `M-x rd' - that region will become red.
Mark another region and run `M-x gr' - that region will green.
Then put the point inside one of the red or green regions and
type `M-x nc' - that should delete all the red or green regions
that cover that point, and no others.

Can you try to use that on a temporary buffer generated by eev to mark
the parts that you don't understand with red, the parts that you
understand with green, and leave the parts that are between these two
extremities - "understand" and "don't understand" - unmarked? Do you
know how to take screenshots? Can you send one of these screenshots to
me?

My friends who are programmers know how to mark the parts that they
understand and that they don't understand of a buffer with _imaginary_
red and green overlays... let's see if these concrete red and green
overlays can help you!

  Cheers,
    Eduardo Ochs



reply via email to

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