From: Eduardo Ochs <eduardoochs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Better ways to inspect text properties?
Date: Thu, 27 Oct 2022 11:03:29 -0300 [thread overview]
Message-ID: <CADs++6g5vacg5s66PNETT9nq39WqsH2kavc6JqKvQ_oEmmuHnQ@mail.gmail.com> (raw)
In-Reply-To: <83h6zpn7i0.fsf@gnu.org>
On Thu, 27 Oct 2022 at 02:48, Eli Zaretskii <eliz@gnu.org> wrote:
> 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.
Hi Eli,
...problem solved. The main function that I am using is this one,
(defun ee-string-intervals (str)
"This is similar to `object-intervals', but uses another output format."
(let ((pair< (lambda (pair1 pair2)
(string< (symbol-name (car pair1))
(symbol-name (car pair2))))))
(cl-loop for (b e props) in (object-intervals str)
for s = (substring-no-properties str b e)
for pairs = (cl-loop for (x y) on props by 'cddr
collect (list x y))
collect (list s (sort pairs pair<)))))
and it can be tested with:
(setq mystr (concat (propertize "a" 'p1 'v1 'p2 'v2)
(propertize "b" 'p3 'v3 'p4 'v4)))
(ee-string-intervals mystr)
I am experimenting with functions that extract the region with
buffer-substring, use `ee-string-intervals' to convert that
string with properties to something that I find better to work
with, and then deletes the uninteresting properties and
pretty-prints the result. I'll see if that helps me to understand
dired and org and then make a blog-ish post about that - now
without much fear that I am reinventing the wheel and making it
square...
Cheers =),
Eduardo Ochs
http://angg.twu.net/eepitch.html
next prev parent reply other threads:[~2022-10-27 14:03 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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADs++6g5vacg5s66PNETT9nq39WqsH2kavc6JqKvQ_oEmmuHnQ@mail.gmail.com \
--to=eduardoochs@gmail.com \
--cc=eliz@gnu.org \
--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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.