From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "T.V Raman" <raman@google.com>
Cc: emacs-devel@gnu.org
Subject: Re: HowTo: EWW: Tagging regions with properties
Date: Mon, 12 Dec 2022 10:04:31 -0500 [thread overview]
Message-ID: <jwvk02wk6rj.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <p91ilihe43k.fsf@google.com> (T. V. Raman's message of "Sun, 11 Dec 2022 18:41:03 -0800")
> An around advice on shr-tag-li puts text property 'li with value
> 'eww-tag on the region produced by rendering from the <li> tag.
[ I assume you don't really mean that and it's the `eww-tag` *property*
which gets the `li` *value*, right? Nitpick: I suggest you use
`shr-tag` as property name, since it's done by `shr` rather than by `eww`,
and `shr` is also used in other contexts such as by Gnus. ]
> I suspect it's because some other part of shr ie outside of shr-tag-li
> in this instance shifts the block of text from the <li> tag to get it
> indented --- and I was hoping that default stickiness of text
> properties would just take care of that -- sdly, that doesn't
> happen. So question: How do I achieve what I want?
Text properties are fundamentally "not sticky" (they're defined as
adding a property to each character individually). The stickiness
applies only to a few special cases, basically those that use
`insert-and-inherit`. So you'll probably have to change `shr.el` so it
uses `insert-and-inherit` when inserting that whitespace.
Another approach might be to rely on overlays rather than text
properties.
Stefan
next prev parent reply other threads:[~2022-12-12 15:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 2:41 HowTo: EWW: Tagging regions with properties T.V Raman
2022-12-12 15:04 ` Stefan Monnier [this message]
2022-12-12 15:38 ` T.V Raman
2022-12-12 15:45 ` T.V Raman
2022-12-12 18:14 ` Yuri Khan
2022-12-12 20:36 ` T.V Raman
2022-12-12 17:54 ` Stefan Monnier
2022-12-12 17:55 ` T.V Raman
2022-12-12 18:13 ` Stefan Monnier
2022-12-12 23:13 ` T.V Raman
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvk02wk6rj.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=raman@google.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).