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 16:46:07 -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="17738"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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 01:47:02 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 1oovXa-0004N5-MP for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 30 Oct 2022 01:47:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oovWs-0000sc-Cc; Sat, 29 Oct 2022 19:46:18 -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 1oovWo-0000sB-Go for help-gnu-emacs@gnu.org; Sat, 29 Oct 2022 19:46:16 -0400 Original-Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oovWm-0007Bi-K2 for help-gnu-emacs@gnu.org; Sat, 29 Oct 2022 19:46:14 -0400 Original-Received: by mail-lj1-x22c.google.com with SMTP id o4so12666748ljp.8 for ; Sat, 29 Oct 2022 16:46:11 -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=zfSZNgr43HG/8/dvw+eU9NXBBMpvX37Ras1okYi1LQE=; b=GGmSE9xPX6XXVdlg9FfxvTMOJEWGCd+iRr9zECT44QdHKXNr26EduQNwQ/61lqQ2NT mUsKYMzabq+bSvuAp/SVSOaBhCZXZkpDJ3lUwnCwZQCywFv1ekoGhu1zq1xM25rZXxnR JL26PYDpdvIXimzi7KyOKH39p2V9Cx+o3sH2yS9R+EE7erIoLnkUU2loVdZ5qMe7cVK4 uOX84GNj0yhXQkTe5nyRzqO3Nmpgf96os2wCMnXgqKVbN1EtWT/3iP6MPRB32zxUeCZ4 qGuGvVAh8fHB+CYXECLYO5fYoQedpvBs9AYa5ImxI3cr6Xw6x9MnlsBbhRS0HOPu2YhE 2DAw== 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=zfSZNgr43HG/8/dvw+eU9NXBBMpvX37Ras1okYi1LQE=; b=2BcAPBHTczLzUryGYEgbozdwGrZWc7w1GU4Ey0BQZfIXOH2Iq/s4gJjGt4nUwgcHZp AZu7jsR/tbhmIO+s3yAHZXv9MASWkL6K2O7v78Qs+FgUTyJg149NmNuQlHXgUsz7u9my Gk/R6XhmBX4nWYUrB5JsXhvzse51r2gI47G0wUa060qH7PFEhg+tQQfUHalmSXYqboUU PlRTIr90yJd8bG1SjiT3HIEZ8yr/PDrydh1dMJ0obfr1fMpMNwWikA/imeItV3UnxvWu KTz68nV1F/MaqQ4CV0/YKuYBxvpndNQwvnRYk3YVW98mJjTWhYDR6nRKg2npeWHD5hZd Hpbg== X-Gm-Message-State: ACrzQf3eJaBmfzSuUoZ+rj51OdRIBtPtwCIrkCPDdwh+d3WEDWXF8VGn vp8Y3Eukinsa3KDHuTPHNKWBvchOz97zGKhlIDQ= X-Google-Smtp-Source: AMsMyM4Vh1hurWbKcQPZ/WTSjQeEKJxnVZT267BIfVMH5/IH1ScIKHGgf5ltSZbIpL3JTtw7BCppZxeZrYRw7oUiVLE= X-Received: by 2002:a2e:8e27:0:b0:277:353:aab with SMTP id r7-20020a2e8e27000000b0027703530aabmr2282772ljk.185.1667087169485; Sat, 29 Oct 2022 16:46:09 -0700 (PDT) Original-Received: by 2002:a05:6520:4af1:b0:22a:e96a:7f9b with HTTP; Sat, 29 Oct 2022 16:46:07 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=samologist@gmail.com; helo=mail-lj1-x22c.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:140501 Archived-At: 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. On 10/26/22, Eduardo Ochs wrote: > Hi list... > > 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? > > Thanks in advance, > Eduardo Ochs > http://angg.twu.net/eepitch.html > > -- The Kafka Pandemic A blog about science, health, human rights, and misopathy: https://thekafkapandemic.blogspot.com