From: Pip Cet <pipcet@gmail.com>
To: 33435@debbugs.gnu.org
Subject: bug#33435: 27.0.50; A use case for recursive display specifications
Date: Mon, 19 Nov 2018 18:51:37 +0000 [thread overview]
Message-ID: <CAOqdjBfbP4DsSnR9Zj92xJqB1LQyw5ehHK+JK94OYjRt5wCvGQ@mail.gmail.com> (raw)
This is a feature request: I'd like to be able to display an empty line
as a non-empty line with images in it.
If there's a way to do that with standard display specs, I haven't
found it. It's possible I'm merely missing an obvious way to do so.
I think there are two almost-equivalent approaches to achieving this:
1. interpret a list of display specifications by displaying the first
element of the list, then the second, and so, on, so I could use
(put-text-property beg end 'display `(,image1 ,image2 ,image3 "\n"))
2. allow a single level of recursion in display specifications, so I
could use
(put-text-property beg end 'display (concat (propertize " " 'display
image1) (propertize " " 'display image2) (propertize " " 'display
image3) "\n"))
I've tried simply disabling the checks for recursive display
specifications and (2) appears to work, but I don't know the precise
rationale for their existence, so it's possible that breaks the display
engine somehow.
If the problem is merely the possibility of creating an infinite loop
by setting a string's display property to the string itself (indeed,
in my test build, that crashes emacs), that could be avoided while
still allowing a single level of recursion.
(I'm using this to highlight syntactic indentation with SVG images,
and that's much prettier if empty lines are interpreted as being
indented to the minimum of the preceding and following levels of
indentation, rather than merely being empty.)
next reply other threads:[~2018-11-19 18:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-19 18:51 Pip Cet [this message]
2018-11-19 19:37 ` bug#33435: 27.0.50; A use case for recursive display specifications Eli Zaretskii
2018-11-20 15:16 ` Pip Cet
2018-11-20 16:30 ` Eli Zaretskii
2019-10-03 0:20 ` Stefan Kangas
2019-10-03 12:33 ` Pip Cet
2019-10-03 16:42 ` Stefan Kangas
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=CAOqdjBfbP4DsSnR9Zj92xJqB1LQyw5ehHK+JK94OYjRt5wCvGQ@mail.gmail.com \
--to=pipcet@gmail.com \
--cc=33435@debbugs.gnu.org \
/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).