unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eduardo Ochs <eduardoochs@gmail.com>
To: Samuel Wales <samologist@gmail.com>,
	Mariano Montone <marianomontone@gmail.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Better ways to inspect text properties?
Date: Sat, 29 Oct 2022 22:08:14 -0300	[thread overview]
Message-ID: <CADs++6gr5XG7HzgB2zo_e9uX4c_LVQvdu9YP5_J-swyV97Vo7A@mail.gmail.com> (raw)
In-Reply-To: <CAJcAo8u__piK-8nJ7tozTVQ68UaA2aR0vyqJwf30ggGjOfeK4Q@mail.gmail.com>

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



  reply	other threads:[~2022-10-30  1:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 23:19 Better ways to inspect text properties? Eduardo Ochs
2022-10-27  2:54 ` Emanuel Berg
2022-10-27  5:46 ` Eli Zaretskii
2022-10-27  6:45   ` Eduardo Ochs
2022-10-27  7:25     ` Emanuel Berg
2022-10-27 14:03   ` Eduardo Ochs
2022-10-27 15:05     ` Emanuel Berg
2022-10-28 15:19       ` Eduardo Ochs
2022-10-29 23:46 ` Samuel Wales
2022-10-30  1:08   ` Eduardo Ochs [this message]
2022-10-30  4:51     ` Samuel Wales

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=CADs++6gr5XG7HzgB2zo_e9uX4c_LVQvdu9YP5_J-swyV97Vo7A@mail.gmail.com \
    --to=eduardoochs@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=marianomontone@gmail.com \
    --cc=samologist@gmail.com \
    /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.
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).