[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Better ways to inspect text properties?
From: |
Eduardo Ochs |
Subject: |
Re: Better ways to inspect text properties? |
Date: |
Sat, 29 Oct 2022 22:08:14 -0300 |
On Sat, 29 Oct 2022 at 20:46, Samuel Wales <samologist@gmail.com> wrote:
>
> a good question imo! tangentially, by coincidence i was wanting some
> similar things to understand better.
>
> showing the output prettily would be great. c-u c-x = is just a bit
> limited. some kind of inspector?
>
> what if we could show all text properties in a buffer kind of like
> visible-mode?
>
> is it possible to diff two buffers completely? i.e. not only the text
> as shown [or folded] but the properties too?
>
> that would allow regression testing of changes that affect only text
> properties. i don't mean displaying colors or so as a bespoke
> non-traditional diff but rather the text property differnces as text.
>
> can a buffer with text properties be saved to a file and reloaded
> preserving properties?
>
> what about visibility and folding? could they be preserved like that
> also? my regression testing could be improved.
>
> i also still struggle with visibility and folding and the fucntios for
> getting visible-only parts of a buffer, or copying and inserting in
> buffers, or looping only visible lines etc. i keep getting results i
> do not expect. [cannot debug now.] e.g. i am in magit and it is
> partly folded and i want to do various programmatic copy or operate
> type operations on visible.
>
> i have not even yet found a good protocol for pp and frineds yet to
> insert nicely into buffer at point, when called after a pp expression
> with c-x c-=. even for a paren-containing sexp, not only a string
> with text properties.
>
> so idk it is probably just me and not finding documentation that suits
> me well for it, but it seems a ripe area.
Hi Samuel!
By "an inspector" do you mean like what this package does?
https://github.com/mmontone/emacs-inspector
I have just tried this
(defun inspector-inspect-region (b e)
(interactive "r")
(inspector-inspect-expression (buffer-substring b e)))
in a grep buffer, and it seems that the current version of inspector
doesn't have support for treating strings with text properties as
trees... and then I tried this on the same grep buffer,
(defun inspector-inspect-region (b e)
(interactive "r")
(inspector-inspect-expression
'(ee-string-intervals
(buffer-substring b e))))
where ee-string-intervals is the function defined here,
(find-eev "eev-blinks.el" "find-eregionpp")
http://angg.twu.net/eev-current/eev-blinks.el.html#find-eregionpp
and it worked very well - it was even able to show that certain
#s(...) objects are structs of the kind "compilation--message", and it
showed its slots.
I have added inspector's author - Mariano Montone - to the list of
recipients of this message, let's see what happens... =)
Cheers,
Eduardo Ochs
http://angg.twu.net/eepitch.html