help-gnu-emacs
[Top][All Lists]
Advanced

[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: Thu, 27 Oct 2022 03:45:40 -0300

On Thu, 27 Oct 2022 at 02:48, Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Eduardo Ochs <eduardoochs@gmail.com>
> > Date: Wed, 26 Oct 2022 20:19:59 -0300
> >
> > 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?
>
> Please tell which part(s) is/are not very human-friendly in the above.
> Otherwise it's hard to suggest improvements, because to me the above
> is quite friendly and easy to read and understand.

Ooops, sorry! My problem is that that output is too big, and many
parts are repeated... I was wondering that there could be functions
around that would split the original string into substrings with
constant properties, and also would rewrite that output in other
formats, putting one property-value pair in each line, sorting these
pairs by property name, and maybe doing something nice with the
keymaps... I am trying to write something like that myself, but I
thought that maybe I could be reinventing the wheel...

  Cheers,
    Eduardo Ochs
    http://angg.twu.net/eepitch.html



reply via email to

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