emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Gustavo Barros <gusbrs.2016@gmail.com>
To: Kyle Meyer <kyle@kyleam.com>
Cc: emacs-orgmode@gnu.org, Shankar Rao <shankar.rao@gmail.com>
Subject: Re: [PATCH] Add mode for automatically unhiding emphasis markers in the current region
Date: Mon, 22 Jun 2020 08:25:18 -0300	[thread overview]
Message-ID: <87d05rcpgh.fsf@gmail.com> (raw)
In-Reply-To: <877dvzwtdy.fsf@kyleam.com> (Kyle Meyer's message of "Mon, 22 Jun 2020 05:40:09 +0000")

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.


  reply	other threads:[~2020-06-22 11:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 14:14 Shankar Rao
2020-06-01 15:33 ` Shankar Rao
2020-06-22  5:40   ` Kyle Meyer
2020-06-22 11:25     ` Gustavo Barros [this message]
2020-06-23  0:07       ` Kyle Meyer
2020-06-24 12:53         ` Shankar Rao
2020-06-24 13:49           ` Gustavo Barros
2020-06-24 15:46             ` Nicolas Goaziou
2020-06-24 16:34               ` Shankar Rao
2020-06-26  7:32                 ` Nicolas Goaziou
2020-07-03 15:19                   ` Shankar Rao
2020-07-05 10:50                     ` Nicolas Goaziou
2020-07-05 20:49                       ` Gustavo Barros
2020-07-06 14:01                         ` Gustavo Barros
2020-07-07 15:57                       ` Shankar Rao
2020-06-24 17:27               ` Gustavo Barros

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:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d05rcpgh.fsf@gmail.com \
    --to=gusbrs.2016@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kyle@kyleam.com \
    --cc=shankar.rao@gmail.com \
    --subject='Re: [PATCH] Add mode for automatically unhiding emphasis markers in the current region' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


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).