unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ihor Radchenko <yantar92@gmail.com>, Lars Ingebrigtsen <larsi@gnus.org>
Cc: 56837@debbugs.gnu.org
Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text
Date: Sat, 30 Jul 2022 14:38:47 +0300	[thread overview]
Message-ID: <83ilne6da0.fsf@gnu.org> (raw)
In-Reply-To: <87lesargc2.fsf@localhost> (message from Ihor Radchenko on Sat, 30 Jul 2022 19:27:09 +0800)

> From: Ihor Radchenko <yantar92@gmail.com>
> Cc: 56837@debbugs.gnu.org
> Date: Sat, 30 Jul 2022 19:27:09 +0800
> 
> A simpler version would be let-binding buffer-invisibility-spec.

Really?

> Note that there is similar issue with current-column, though
> current-column is much less likely to be used without considering
> display properties.

These are all display-related, in that their results are supposed to
closely reflect what will be shown on display.

> Would it be possible to include the "text" versions of
> current-indentation and current-column into Emacs?
> 
> Something like
> 
> (defmacro org-current-text-indentation ()
>   "Like `current-indentation', but ignore display/invisible properties."
>   `(let ((buffer-invisibility-spec nil))
>      (current-indentation)))
> 
> (defmacro org-current-text-column ()
>   "Like `current-column', but ignore display/invisible properties."
>   `(string-width (buffer-substring-no-properties
> 		  (line-beginning-position) (point))))

Sounds strange to have this, but if Lars thinks it's useful, I won't
object.

> If not, could you at least mention the invisible text issues in
> `current-indentation' docstring?

OK.





  reply	other threads:[~2022-07-30 11:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-30  7:56 bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text Ihor Radchenko
2022-07-30  8:51 ` Eli Zaretskii
2022-07-30  9:08   ` Ihor Radchenko
2022-07-30 10:08     ` Eli Zaretskii
2022-07-30 11:27       ` Ihor Radchenko
2022-07-30 11:38         ` Eli Zaretskii [this message]
2022-07-30 11:49           ` Ihor Radchenko
2022-07-30 13:25             ` Eli Zaretskii
2022-07-30 16:35           ` Eli Zaretskii
2022-07-31  8:12           ` Lars Ingebrigtsen

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=83ilne6da0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=56837@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=yantar92@gmail.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).