From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Samuel Wales Newsgroups: gmane.emacs.help Subject: Re: Better ways to inspect text properties? Date: Sat, 29 Oct 2022 21:51:24 -0700 Message-ID: References: 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="2975"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mariano Montone , help-gnu-emacs To: Eduardo Ochs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 30 05:51:59 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 1op0Ih-0000ZN-1X for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 30 Oct 2022 05:51:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1op0IH-0003Mo-3z; Sun, 30 Oct 2022 00:51:33 -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 1op0IF-0003Mc-On for help-gnu-emacs@gnu.org; Sun, 30 Oct 2022 00:51:31 -0400 Original-Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1op0ID-0003Td-KU for help-gnu-emacs@gnu.org; Sun, 30 Oct 2022 00:51:31 -0400 Original-Received: by mail-lj1-x230.google.com with SMTP id u2so13104604ljl.3 for ; Sat, 29 Oct 2022 21:51:28 -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:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bOT5Ffyieykfat28hvmk4WfsvQkW03j+c1lKxALxWFI=; b=WhDbJU6ucSYm5wjf0/YUpYbKHO0Na8dlDmnx8EBnkZCpXOns//oKJICOkj+sRjwIUJ sabGIWVFQRYits9k/uealxNeSAH36bUB+aKxcw8GjGX4/lhnUJuGqf2iXMkfSt89/3zp lZvXiWMNbmVrg5WDqgdi9BKeNO34kMAGa8kL2fN+zyhkcbWzbEJObibIHpiJWHjJtlPC SsFi4zAeWkbgefdTfdkgRhBTRv3+P57BtMFk3vQetBxPAj1OWIQwH+eVfFKPQ8e9UOom /bHp+gSapLrxwUm9J4UP7isQyla/aJnktTL7Xotmgfaq7JRgxFQD/D6Lx1i6O60s6Ntc PgNg== 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:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bOT5Ffyieykfat28hvmk4WfsvQkW03j+c1lKxALxWFI=; b=gxKw8pgSIPndXcFNphtqSmW5ZQxrcyFzj9ObFs8U1bcm/sUDbC4OGGmVyvLeD3Rdg3 mdGpeBN364omGEmDmcDMuMYz2E5i0jF6/q24XMfX7oBUQqQ5Tv1Pn2JLNIa9mRLKo8Wl /NJqwDKlEJ4ltU7OWc4c0rS1jDiiPyMqPRZNPbIIASOe6c/k8oyAUVZmlybrcM27XwJZ 4VIfLO4sm7La8WwPtvCAtlIa5qZmBchh0MV81yknl+8Vxgz1SkoLUe2te/RU0HR83/+0 5P/XPuYv3yrrh+3Pp1Nwo+fba/9zqT1DdpWYdrse2PMms6BavsZCkN4PXlFWeK6YCY0m 2OtQ== X-Gm-Message-State: ACrzQf03yTHMRsHyxG753n8vpH1YBMn3xIKtE1vAiSTumVbVyCjcVJsO Uk1bWxpH0MP3dvTnnzZu9fF0/r/OKVCcn4NRcR0= X-Google-Smtp-Source: AMsMyM4tXae5D5xcIxDfOwmz4NMQV0txq0vL6eRWLroT5ZW+C3ICK72hUWUXJ01ZfdIGTT+JSj22HF/kjVnXWd/DNIc= X-Received: by 2002:a05:651c:88e:b0:26d:dd92:73e7 with SMTP id d14-20020a05651c088e00b0026ddd9273e7mr2628549ljq.503.1667105485165; Sat, 29 Oct 2022 21:51:25 -0700 (PDT) Original-Received: by 2002:a05:6520:4af1:b0:22a:e96a:7f9b with HTTP; Sat, 29 Oct 2022 21:51:24 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::230; envelope-from=samologist@gmail.com; helo=mail-lj1-x230.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:140504 Archived-At: more below. On 10/29/22, Eduardo Ochs wrote: > On Sat, 29 Oct 2022 at 20:46, Samuel Wales wrote: >> >> 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. > > Hi Samuel! > By "an inspector" do you mean like what this package does? > > https://github.com/mmontone/emacs-inspector i can't tell. white-background images are very hard on me so i can't look a them. i occasionally used symbolics and commercial unix cl inspectors, but i also meant inspector in a more generic and vague "let user explore" sense. the idea being to help the user understand all that behind hte scenes stuff in emacs buffers and strings, namely text properties, more richly than c-u c-x =. [never mind overlays for the time being.] great an inspector package exists though. ... and diff buffers by text properties and pp and serialize and have a full set of functions to do only visible stuff in various operations like in magit or org buffers and all the rest of the things one might want to do with text properties and folding. idk about anybody else but i often put comments above lisp code with some expression and then eval it in the .el buffer to show what the function does or so. and pp of some type should be useful for that. eev, i'm afraid, i have heard about and skimmed for many many years, but it has its terminology and sensibilities and never caught on for me for whatever reason and atm i can't investigate it. perhaps someday i will. [i have burning need for specific link and anchor functionality, specifically id markers, that are partly, but not completely, roughly in, but not covered by, embark, eev, hyperbole. and that would be the hook for me.] > > I have just tried this > > (defun inspector-inspect-region (b e) > (interactive "r") > (inspector-inspect-expression (buffer-substring b e))) > > in a grep buffer, and it seems that the current version of inspector > doesn't have support for treating strings with text properties as > trees... and then I tried this on the same grep buffer, > > (defun inspector-inspect-region (b e) > (interactive "r") > (inspector-inspect-expression > '(ee-string-intervals > (buffer-substring b e)))) > > where ee-string-intervals is the function defined here, > > (find-eev "eev-blinks.el" "find-eregionpp") > http://angg.twu.net/eev-current/eev-blinks.el.html#find-eregionpp > > and it worked very well - it was even able to show that certain > #s(...) objects are structs of the kind "compilation--message", and it > showed its slots. sounds ineresting. > > I have added inspector's author - Mariano Montone - to the list of > recipients of this message, let's see what happens... =) hehe. :) > > Cheers, > Eduardo Ochs > http://angg.twu.net/eepitch.html > -- The Kafka Pandemic A blog about science, health, human rights, and misopathy: https://thekafkapandemic.blogspot.com