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 03:45:40 -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="7808"; 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 08:49:31 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 1onwhn-0001h8-6E for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 27 Oct 2022 08:49:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onwfP-0001rP-LI; Thu, 27 Oct 2022 02:47:03 -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 1onweP-0008B6-GZ for help-gnu-emacs@gnu.org; Thu, 27 Oct 2022 02:46:04 -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 1onweL-0004u6-J1; Thu, 27 Oct 2022 02:46:00 -0400 Original-Received: by mail-io1-xd29.google.com with SMTP id r73so368755iod.10; Wed, 26 Oct 2022 23:45:54 -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=cVCc5N/CgpFuiy7gh/SVInsJ6mPp++0DjSJONWsQ7Nk=; b=Rs+NoTFlGkm+sbe8qMYoQ96yNS3EFslm6+G41Ow3vJlrHwD0ouw3EQ7cCiibHC0lwe GtMD6CCCA8O6p90DCCntFj6s0FM8YhG2y2haKOgdAvfB8apEJoOqGRqJtJ+ZcRpgFdvH wHUUWVFlejriX4H8OlkMEWR6EWDP2NRSWV4IrWc44fPkd0/Cz9LSu69a7QoviyVForJd ZlJH7QjNCC8ZxqvO7JN9sLXjAl1qMXPCxDVks6kzARthwhAyIOjdEwFTWb7L2Dm7nrNw HJ59b8Ip4axcsSL1IdvF4/z+hM1o7d1R6yr+gVlSmjlUJiPOUS/CLMCEqIheahhI1wo9 J5rg== 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=cVCc5N/CgpFuiy7gh/SVInsJ6mPp++0DjSJONWsQ7Nk=; b=J069m8rpjBx2ABhW51SZRGnh5HmMQoO6qu/QAeQ4zwXB985wuQ83B1FPRWoVgtsmrF kHQSdCVttRobzv01oAbE+TheQDxqa5ZFXQhN3YcubgQg+Ev6JQ7U6rydgln4cg5tf1vL 73BoAa8KYCIb+yCn+kpDvJhtgAd1ETdK7yPMRxi4SIDS3v5txt/Ply8y1ogC2RLoT3CC Vo/6x3Yypq3qCzZtz6wu5anHdULBO1VSsBnaE6GBSeACsT+KzT8IqqxPZCqW6AmwoyX/ w4OzTJhPu6b5J5FoezYMB06FxCMWUhruPGw2hbxSXbL1SEF0/aQtnbH5gtDrUkU/LTVY D0Aw== X-Gm-Message-State: ACrzQf1yXQ8Jsu7+e+EoPeDvtEMIbrBe3q6HUtKmMfLPPDMMf7nue7hp HnXm80V+XuxfRa664t6V/na/NtFFatkkOkmhx9Q5kl2Nj4A= X-Google-Smtp-Source: AMsMyM4KnxN1I2mg8GOJwGMX537m7QToJ7T7akh7PHaWOTFpw5kW+Y+Q2SOt8X5wf5L8mZLprDmvoxhfpmpIguwcfcs= X-Received: by 2002:a02:b717:0:b0:371:ca98:8311 with SMTP id g23-20020a02b717000000b00371ca988311mr13273170jam.320.1666853153259; Wed, 26 Oct 2022 23:45:53 -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:140425 Archived-At: On Thu, 27 Oct 2022 at 02:48, Eli Zaretskii wrote: > > > From: Eduardo Ochs > > 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