From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: Better ways to inspect text properties? Date: Thu, 27 Oct 2022 11:03:29 -0300 Message-ID: References: <83h6zpn7i0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11419"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 27 16:07:54 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oo3Y2-0002jI-0N for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 27 Oct 2022 16:07:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oo3U3-0003Kg-Di; Thu, 27 Oct 2022 10:03:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo3U1-00033A-IO for help-gnu-emacs@gnu.org; Thu, 27 Oct 2022 10:03:45 -0400 Original-Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oo3Tz-0005FW-SA; Thu, 27 Oct 2022 10:03:45 -0400 Original-Received: by mail-io1-xd29.google.com with SMTP id y143so737324iof.9; Thu, 27 Oct 2022 07:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=UDNTeZtMQcHg+8HtTPYuH5VJ1CURjbNEkJ28rtxs5RI=; b=owz7ScXqFklo1YC61R5ees3NWXOWI3Fd6zasBprmIueMQB80no2g0rhu4Zunej71p6 JbG/xn+Id88g8/qGYG7lMYQ6Xy8R+6MH9NR7nKOi/5MFWpwpo6S8sanNMfBfeginXui2 Xpl0CH1QNlduULvCnJUoPO7GGFceomJObv4pyPwFppVkkq2cMj1ACvV1FkJw/pXNQ1cd HRka5+XVGKyY8xh2HTAAsERRlBLxtTI9TDEOKGk1BiYpozhnUnccycr/LT1zHRWBEymv 3xnKpLN7j+sIrX0VlHq9WZ37n/Uy787QUYs7tXqp9uKw3VYvBoSVdC77Z4I+FHwuASzb I5Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UDNTeZtMQcHg+8HtTPYuH5VJ1CURjbNEkJ28rtxs5RI=; b=bWcf+JrnQEccgf0jZeHa0fRfWLlcDw5eMQZ3QD5IySxHTPC/Yukw12wqIfUeT8mWOQ tx0Jsl6KWpV0lv1WSPOQ6r4LPmxXKV4x6zKZ9Mvu6DN/16yLA7BXjJi2XBp2dm4ALvLp KPrYp6/YqQnWoxxKNdZ9LXqvQ1Z0fIXbbnWgawCHYd+D2n+0W9IwIg8Z8om+JUIg+nnr aptkjgkCms/KrEDQCC19CHtJtW+/DpnbSsLI/HYK0yqkoDrupF9TeptFSoNTee16MT/F /UaaoqxnEuhCyLmBVNQv5U+KHGs62WDSpM3TMUpbtlRKOrI0E052OU0mJ7CWlBULvKkx 1i/g== X-Gm-Message-State: ACrzQf0vdr3sFHxNV3EwQHQ0Macmfe9s2sUUUPCRbcRQL81IZ99SaaD/ sEBTKtLkhGHYlnQ3dtrnaE9ifu+1AJxHVOyoQKMAbYrPAAY= X-Google-Smtp-Source: AMsMyM5pXfBLwNiQiZNvWPOgUSKJzIDEsRuI7X0eAU4nibyq/SrdIZGwUtRYexOHbri8Cwh5715JAT8K7N9xnUOebo8= X-Received: by 2002:a05:6638:1613:b0:364:d83:b3de with SMTP id x19-20020a056638161300b003640d83b3demr32836763jas.299.1666879421312; Thu, 27 Oct 2022 07:03:41 -0700 (PDT) In-Reply-To: <83h6zpn7i0.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::d29; envelope-from=eduardoochs@gmail.com; helo=mail-io1-xd29.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "help-gnu-emacs" Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:140431 Archived-At: On Thu, 27 Oct 2022 at 02:48, Eli Zaretskii 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