unofficial mirror of emacs-orgmode@gnu.org
 help / color / mirror / Atom feed
* [PATCH] org.el: Adapt org-cycle to work with headlines with hidden stars
@ 2020-09-11 12:45 Marlin Strub
  2020-09-13 17:18 ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Marlin Strub @ 2020-09-11 12:45 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 869 bytes --]

Hello everyone,

I looked into using text properties to hide all the stars in org headings
(with org-starless-mode [1]),
and noticed that `org-cycle' didn't reliably cycle the visibility of
headings anymore.

Trying to find the reason for this, I found that `org-cycle' uses
`move-beginning-of-line' in combination
with a regexp to detect headings. The problem is that
`move-beginning-of-line' ignores invisible text
such that the regexp fails to match. The attached patch changes
`move-beginning-of-line' to
`beginning-of-line', which does not ignore invisible text.

This solves the issue with hidden stars, but I have a feeling that I'm
missing something. Is there a
problem with using `beginning-of-line' instead of `move-beginning-of-line'
or could this patch be
applied?

Thanks a lot for looking into this,
Marlin

[1] https://github.com/TonCherAmi/org-starless

[-- Attachment #1.2: Type: text/html, Size: 1196 bytes --]

[-- Attachment #2: 0001-org.el-Adapt-org-cycle-to-work-with-headlines-with-h.patch --]
[-- Type: application/octet-stream, Size: 1191 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] org.el: Adapt org-cycle to work with headlines with hidden stars
  2020-09-11 12:45 [PATCH] org.el: Adapt org-cycle to work with headlines with hidden stars Marlin Strub
@ 2020-09-13 17:18 ` Bastien
  2020-09-14  7:12   ` Marlin Strub
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2020-09-13 17:18 UTC (permalink / raw)
  To: Marlin Strub; +Cc: emacs-orgmode

Hi Marlin,

Marlin Strub <marlin.strub@gmail.com> writes:

> I looked into using text properties to hide all the stars in org
> headings (with org-starless-mode [1]),
> and noticed that `org-cycle' didn't reliably cycle the visibility of
> headings anymore.

there was a recent fix for this in the master branch: can you test
latest Org (from master) and see if your fix is still needed?

Thanks a lot,

-- 
 Bastien


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] org.el: Adapt org-cycle to work with headlines with hidden stars
  2020-09-13 17:18 ` Bastien
@ 2020-09-14  7:12   ` Marlin Strub
  2020-09-14 13:37     ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Marlin Strub @ 2020-09-14  7:12 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 692 bytes --]

Hi Bastien,

Thanks for looking into this. I just tested with 9c31cba00 and
org-cycle does not work reliably when org-starless-mode is
enabled unless the patch is applied.

Best,
Marlin

On Sun, 13 Sep 2020 at 19:18, Bastien <bzg@gnu.org> wrote:

> Hi Marlin,
>
> Marlin Strub <marlin.strub@gmail.com> writes:
>
> > I looked into using text properties to hide all the stars in org
> > headings (with org-starless-mode [1]),
> > and noticed that `org-cycle' didn't reliably cycle the visibility of
> > headings anymore.
>
> there was a recent fix for this in the master branch: can you test
> latest Org (from master) and see if your fix is still needed?
>
> Thanks a lot,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 1182 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] org.el: Adapt org-cycle to work with headlines with hidden stars
  2020-09-14  7:12   ` Marlin Strub
@ 2020-09-14 13:37     ` Bastien
  2020-09-14 13:48       ` Marlin Strub
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2020-09-14 13:37 UTC (permalink / raw)
  To: Marlin Strub; +Cc: emacs-orgmode

Hi Marlin,

Marlin Strub <marlin.strub@gmail.com> writes:

> Thanks for looking into this. I just tested with 9c31cba00 and
> org-cycle does not work reliably when org-starless-mode is
> enabled unless the patch is applied.

Applied now, thanks for checking.

-- 
 Bastien


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] org.el: Adapt org-cycle to work with headlines with hidden stars
  2020-09-14 13:37     ` Bastien
@ 2020-09-14 13:48       ` Marlin Strub
  0 siblings, 0 replies; 5+ messages in thread
From: Marlin Strub @ 2020-09-14 13:48 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

Awesome, thanks!

On Mon, 14 Sep 2020 at 15:37, Bastien <bzg@gnu.org> wrote:

> Hi Marlin,
>
> Marlin Strub <marlin.strub@gmail.com> writes:
>
> > Thanks for looking into this. I just tested with 9c31cba00 and
> > org-cycle does not work reliably when org-starless-mode is
> > enabled unless the patch is applied.
>
> Applied now, thanks for checking.
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 759 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-14 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 12:45 [PATCH] org.el: Adapt org-cycle to work with headlines with hidden stars Marlin Strub
2020-09-13 17:18 ` Bastien
2020-09-14  7:12   ` Marlin Strub
2020-09-14 13:37     ` Bastien
2020-09-14 13:48       ` Marlin Strub

unofficial mirror of emacs-orgmode@gnu.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git