emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add mode for automatically unhiding emphasis markers in the


From: Gustavo Barros
Subject: Re: [PATCH] Add mode for automatically unhiding emphasis markers in the current region
Date: Mon, 22 Jun 2020 08:25:18 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux)

Hi Kyle, Hi Shankar,

On Mon, 22 Jun 2020 at 05:40, Kyle Meyer <kyle@kyleam.com> wrote:

> Shankar Rao writes:
>
>> This patch adds a minor mode that makes emphasis markers be automatically
>> unhidden when the point is inside the region of emphasis and then the
>> markers are rehidden when the point is moved elsewhere. I posted this on
>> /r/orgmode on reddit (
>> https://www.reddit.com/r/orgmode/comments/gss1g4/update_i_made_my_own_sbrorgemphasizemode_that/),
>> and people there suggested that I submit this here as a patch.
>
> I don't prefer my emphasis markers hidden (i.e. I leave
> org-hide-emphasis-markers at nil), so perhaps I'm not the best to judge,
> but that does sound like a nice feature.
>
> I'm hoping others will try this out and give their thoughts.

Just an user here, but I'd like to leave my +1 to this proposed feature.
I did use org-hide-emphasis-markers in the past and I liked it, but
eventually dropped it because of the inconveniences of editing at the
border of an emphasized region.  This proposed feature eliminates the
"which side of the invisible character are we?" ambiguity, so I repute
it very nice indeed.  I would certainly appreciate the inclusion of such
a feature and, since I've been around, I've seen folks demanding
something of the sort (memory here, no hard data).  Indeed, I was one of
the people at Reddit who suggested Shankar submitted this to the list.

I did (lightly) test the code as posted on Reddit, and liked what I
saw.  I tried a number of cases I could think of: multiple lines, nested
emphasis markers etc.  As far as I tried, it did work as advertised.

I also did report a corner case I found:

> The only edge case I found, which in no way mars the absolute coolness
> of this, is when you are actually inserting the emphasis marker. For
> example, if you type *word*. Right after you type the last "*" the
> emphasis will be hidden, even though the point position would have it to
> be shown. Same thing if you select word and "C-c C-x C-f *". You have to
> actually move point, for the mode to work in this situation.

Shankar replied me this behavior is the same in prettify-symbols-mode,
on which the code is based.  I do not use prettify-symbols-mode myself,
but did play with it a little because of this, and could not infer a
regularity, so I must trust Shankar's point here.  And it is indeed just
a corner situation, which has no further implication I can conceive, and
which does not diminish the usefulness of the feature.

I can add another thought on the matter.  While prettify-symbols is a
mode, org-hide-emphasis-markers is an option/variable.  So I wonder if
the feature would fit better the current state of things in Org as
either another option/defcustom or by simply expanding the range of
possible values for org-hide-emphasis-markers (e.g. t, nil,
not-at-point, not-at-point-right-edge).  But this is just a thought, I'd
be happy to see this feature be included either way.

So, thanks Shankar for proposing the patch, and thanks Kyle for
reviewing it.

HTH.
Best,
Gustavo.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]