unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: Eduardo Ochs <eduardoochs@gmail.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Better ways to inspect text properties?
Date: Sat, 29 Oct 2022 16:46:07 -0700	[thread overview]
Message-ID: <CAJcAo8u__piK-8nJ7tozTVQ68UaA2aR0vyqJwf30ggGjOfeK4Q@mail.gmail.com> (raw)
In-Reply-To: <CADs++6jxk1NGo54LEszDP44P3vjhAyQMoYmwqaiZC+3Vih5d0g@mail.gmail.com>

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.

On 10/26/22, Eduardo Ochs <eduardoochs@gmail.com> wrote:
> Hi list...
>
> suppose that I create a file /tmp/foo.org whose contents are just
> this:
>
>   a[[http://b/][c]]d
>
> and then I visit /tmp/foo.org, and I pretty-print the result of
> (buffer-substring (point-min) (point-max)). The result is:
>
> #("a[[http://b/][c]]d\n" 0 1
>   (fontified t)
>   1 13
>   (face org-link font-lock-multiline t keymap
>         (keymap
>          (follow-link . mouse-face)
>          (mouse-3 . org-find-file-at-mouse)
>          (mouse-2 . org-open-at-mouse))
>         mouse-face highlight invisible org-link htmlize-link
>         (:uri "http://b/")
>         help-echo "LINK: http://b/" fontified t)
>   13 14
>   (face org-link font-lock-multiline t keymap
>         (keymap
>          (follow-link . mouse-face)
>          (mouse-3 . org-find-file-at-mouse)
>          (mouse-2 . org-open-at-mouse))
>         mouse-face highlight invisible org-link rear-nonsticky
>         (mouse-face highlight keymap invisible intangible help-echo
> org-linked-text htmlize-link)
>         htmlize-link
>         (:uri "http://b/")
>         help-echo "LINK: http://b/" fontified t)
>   14 15
>   (font-lock-multiline t keymap
>                        (keymap
>                         (follow-link . mouse-face)
>                         (mouse-3 . org-find-file-at-mouse)
>                         (mouse-2 . org-open-at-mouse))
>                        mouse-face highlight face org-link rear-nonsticky
>                        (mouse-face highlight keymap invisible
> intangible help-echo org-linked-text htmlize-link)
>                        htmlize-link
>                        (:uri "http://b/")
>                        help-echo "LINK: http://b/" fontified t)
>   15 16
>   (font-lock-multiline t keymap
>                        (keymap
>                         (follow-link . mouse-face)
>                         (mouse-3 . org-find-file-at-mouse)
>                         (mouse-2 . org-open-at-mouse))
>                        mouse-face highlight invisible org-link face
> org-link htmlize-link
>                        (:uri "http://b/")
>                        help-echo "LINK: http://b/" fontified t)
>   16 17
>   (font-lock-multiline t keymap
>                        (keymap
>                         (follow-link . mouse-face)
>                         (mouse-3 . org-find-file-at-mouse)
>                         (mouse-2 . org-open-at-mouse))
>                        mouse-face highlight invisible org-link face
> org-link htmlize-link
>                        (:uri "http://b/")
>                        help-echo "LINK: http://b/" rear-nonsticky
>                        (mouse-face highlight keymap invisible
> intangible help-echo org-linked-text htmlize-link)
>                        fontified t)
>   17 18
>   (rear-nonsticky t fontified t)
>   18 19
>   (fontified t))
>
> This is not very human-friendly (to me). Can you recommend me ways to
> optimize that output?
>
>   Thanks in advance,
>     Eduardo Ochs
>     http://angg.twu.net/eepitch.html
>
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



  parent reply	other threads:[~2022-10-29 23:46 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 [this message]
2022-10-30  1:08   ` Eduardo Ochs
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=CAJcAo8u__piK-8nJ7tozTVQ68UaA2aR0vyqJwf30ggGjOfeK4Q@mail.gmail.com \
    --to=samologist@gmail.com \
    --cc=eduardoochs@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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).