From: Ihor Radchenko <yantar92@posteo.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, 64696@debbugs.gnu.org
Subject: bug#64696: 30.0.50; indent-to inherits preceding text properties, including 'invisible
Date: Thu, 20 Jul 2023 09:10:02 +0000 [thread overview]
Message-ID: <87jzuvq785.fsf@localhost> (raw)
In-Reply-To: <831qh459sy.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> writes:
>> > Invisible text is skipped by current-column.
>>
>> I am not sure if I understand what you mean by "skipped".
>
> "Skipped" means that the invisible text is not counted as occupying
> columns on display. It is skipped without incrementing the column
> count. See this part of scan_for_column:
In my tests, invisible overlay property does not appear to affect things.
>> Consider the following file in outline-mode:
>> [...]
>
> Please make it easier for me to follow the questions you are asking
> and provide helpful responses by (a) making the recipes as simple as
> possible, and (b) by describing them in full detail. "Folded",
> "unfolded heading", "applied invisible text property", etc. -- all
> those might be crystal clear to you, but they aren't so to me, and
> require me to guess (and err) what exactly did you do and how.
Sure.
You can do M-x yant/full-test after evaluating the code below
(defun yant/test-indent-columns ()
(visible-mode -1)
(search-forward "word")
(warn "Moved point after first 'word'")
(warn "1:: current-column = %d" (current-column))
(redisplay)
(warn "redisplayed")
(warn "2:: current-column = %d" (current-column))
(indent-to 50)
(warn "Indented to column 50")
(warn "3:: current-column = %d" (current-column))
(redisplay)
(warn "redisplayed")
(warn "4:: current-column = %d" (current-column))
(visible-mode +1)
(warn "Enabled visible mode")
(warn "5:: current-column = %d" (current-column))
(redisplay)
(warn "redisplayed")
(warn "6:: current-column = %d" (current-column))
(visible-mode -1)
(read-char "Press any key")
(kill-buffer))
(defun yant/test-init-buffer ()
(switch-to-buffer (get-buffer-create "*Test*"))
(delete-other-windows)
(unless (eq major-mode 'outline-mode) (outline-mode))
(erase-buffer)
(insert "\n")
(insert "* Test\n")
(insert "word word\n")
(goto-char (point-min)))
(defun yant/full-test ()
(interactive)
(when (get-buffer "*Warnings*")
(with-current-buffer "*Warnings*" (with-silent-modifications (erase-buffer))))
(yant/test-init-buffer)
(warn "We are going to indent second 'word' to column 50 and check `current-column'.")
(outline-show-all)
(warn "Test #1:: Everything visible.")
(read-char "Press any key to start the test")
(yant/test-indent-columns)
(yant/test-init-buffer)
(warn "Test #2:: 'word' is inside folded heading (hidden using overlays).")
(outline-cycle-buffer)
(read-char "Press any key to start the test")
(yant/test-indent-columns)
(yant/test-init-buffer)
(warn "Test #3:: 'word' is hidden applying 'invisible text property to heading body.")
(outline-show-all)
(save-excursion
(search-forward "Test")
(with-silent-modifications (put-text-property (point) (point-max) 'invisible t)))
(read-char "Press any key to start the test")
(yant/test-indent-columns)
(yant/test-init-buffer)
(warn "Test #4:: 'word' is hidden applying non-sticky 'invisible text property to heading body.")
(outline-show-all)
(save-excursion
(search-forward "Test")
(with-silent-modifications (put-text-property (point) (point-max) 'invisible t))
(with-silent-modifications (put-text-property (point) (point-max) 'rear-nonsticky '(invisible))))
(read-char "Press any key to continue")
(yant/test-indent-columns))
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
next prev parent reply other threads:[~2023-07-20 9:10 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 7:58 bug#64696: 30.0.50; indent-to inherits preceding text properties, including 'invisible Ihor Radchenko
2023-07-18 11:23 ` Eli Zaretskii
2023-07-18 12:09 ` Ihor Radchenko
2023-07-18 13:10 ` Eli Zaretskii
2023-07-18 13:25 ` Ihor Radchenko
2023-07-18 16:13 ` Eli Zaretskii
2023-07-18 16:25 ` Ihor Radchenko
2023-07-18 17:08 ` Eli Zaretskii
2023-07-19 8:30 ` Ihor Radchenko
2023-07-19 13:07 ` Eli Zaretskii
2023-07-20 9:10 ` Ihor Radchenko [this message]
2023-07-21 8:32 ` Ihor Radchenko
2023-07-22 6:51 ` Eli Zaretskii
2023-07-22 7:09 ` Ihor Radchenko
2023-07-22 11:35 ` Eli Zaretskii
2023-07-22 14:10 ` Ihor Radchenko
2023-07-22 14:31 ` Eli Zaretskii
2023-07-22 6:49 ` Eli Zaretskii
2023-07-22 7:03 ` Ihor Radchenko
2023-07-22 11:22 ` Eli Zaretskii
2023-07-22 14:05 ` Ihor Radchenko
2023-07-22 14:28 ` Eli Zaretskii
2023-07-23 7:30 ` Ihor Radchenko
2023-07-23 10:05 ` Eli Zaretskii
2023-07-24 8:18 ` Ihor Radchenko
2023-07-24 13:09 ` Eli Zaretskii
2023-07-25 8:38 ` Ihor Radchenko
2023-07-25 12:37 ` Eli Zaretskii
2023-07-27 8:58 ` Ihor Radchenko
2023-07-27 9:15 ` Eli Zaretskii
2023-07-28 8:06 ` Ihor Radchenko
2023-07-28 11:52 ` Eli Zaretskii
2023-07-29 9:00 ` Ihor Radchenko
2023-07-29 10:33 ` Eli Zaretskii
2023-07-30 7:51 ` Ihor Radchenko
2023-07-30 9:59 ` Eli Zaretskii
2023-07-30 11:45 ` Ihor Radchenko
2023-07-30 17:11 ` Eli Zaretskii
2023-07-31 7:18 ` Ihor Radchenko
2023-07-31 11:49 ` Eli Zaretskii
2023-07-28 2:53 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-28 8:30 ` Ihor Radchenko
2023-07-28 12:06 ` Eli Zaretskii
2023-07-28 12:26 ` Ihor Radchenko
2023-07-28 12:48 ` Eli Zaretskii
2023-07-28 13:02 ` Ihor Radchenko
2023-07-28 14:17 ` Eli Zaretskii
2023-07-29 9:06 ` Ihor Radchenko
2023-07-22 13:32 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 14:15 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 16:20 ` Eli Zaretskii
2023-07-18 19:33 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-19 8:42 ` Ihor Radchenko
2023-07-19 13:10 ` Eli Zaretskii
2023-07-19 14:25 ` Ihor Radchenko
2023-07-19 15:09 ` Eli Zaretskii
2023-07-19 8:41 ` Ihor Radchenko
2023-07-19 13:51 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jzuvq785.fsf@localhost \
--to=yantar92@posteo.net \
--cc=64696@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.