emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problem in removing the invisible brackets of a link
@ 2018-06-29  9:36 Alain.Cochard
  2018-06-29 13:39 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Alain.Cochard @ 2018-06-29  9:36 UTC (permalink / raw)
  To: emacs-orgmode

Hello.

The manual says:

      If you place the cursor at the beginning or just behind the end
   of the displayed text and press <BACKSPACE>, you will remove the
   (invisible) bracket at that location.

The problem for me it that it depends on the way I arrive at those
locations.  For example, for '[[xx]]', seen as 'xx' underlined, if I
have the cursor on the right of it and have it go towards the left
just after the second 'x' and press <BACKSPACE>, then the behavior is
as I expect (I see '[[xx]'), but, if I have the cursor on the left and
have it go to towards the right just after the second 'x' and press
<BACKSPACE>, then I see a single underlined 'x' (after a second
<BACKSPACE> I see '[[]]').

Is this normal?  (tested with emacs -Q with master, with emacs 24.5.1
and 26.1)

Incidentally, is there a way to have things like [[xx]] behave as
plain text?  (I am not talking about literal links which are still
understood as links.)  I have tried 'quote', 'verse', 'verbatim',
'comment', 'example', and org code block: none work.

In the case of 'example' the 'xx' string is not underlined, yet
hitting <RET> on it generates "org-link-search: No match for fuzzy
expression: xx".

In the case of an org code block the 'xx' remains underlined but <RET>
on it generates "Evaluate this org code block on your system? (yes or
no)", which is strange to me...

PS: for me this is not a theoretical issue: In many circumstances I
would like '[[xx]]' instances not behave as links.  I would be happy
if I could change the link format (e.g., use {{xx}} instead -- is it
possible? (I fear it is not.)


Thank you.

Regards


-- 
EOST (École et Observatoire des Sciences de la Terre) 
IPG (Institut de Physique du Globe) | alain.cochard@unistra.fr
5 rue René Descartes   [bureau 106] | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France    | Fax:   +33 (0)3 68 85 01 25     

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

* Re: Problem in removing the invisible brackets of a link
  2018-06-29  9:36 Problem in removing the invisible brackets of a link Alain.Cochard
@ 2018-06-29 13:39 ` Nicolas Goaziou
  2018-07-03 13:12   ` Alain.Cochard
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2018-06-29 13:39 UTC (permalink / raw)
  To: Alain.Cochard; +Cc: emacs-orgmode

Hello,

Alain.Cochard@unistra.fr writes:

> The manual says:
>
>       If you place the cursor at the beginning or just behind the end
>    of the displayed text and press <BACKSPACE>, you will remove the
>    (invisible) bracket at that location.
>
> The problem for me it that it depends on the way I arrive at those
> locations.  For example, for '[[xx]]', seen as 'xx' underlined, if I
> have the cursor on the right of it and have it go towards the left
> just after the second 'x' and press <BACKSPACE>, then the behavior is
> as I expect (I see '[[xx]'), but, if I have the cursor on the left and
> have it go to towards the right just after the second 'x' and press
> <BACKSPACE>, then I see a single underlined 'x' (after a second
> <BACKSPACE> I see '[[]]').
>
> Is this normal?  (tested with emacs -Q with master, with emacs 24.5.1
> and 26.1)

Yes, it is normal Emacs behaviour. See (info "(elisp) Invisible Text").

I guess we could clarify the manual. Suggestions welcome.

> Incidentally, is there a way to have things like [[xx]] behave as
> plain text?

Yes, there is. Insert a zero width space after the opening brackets.

> (I am not talking about literal links which are still
> understood as links.)  I have tried 'quote', 'verse', 'verbatim',
> 'comment', 'example', and org code block: none work.

=[[xx]]= and ~[[xx]]= are not links; try to export them. 

However, `org-open-at-point' still treats them as such -- see last
paragraph in its docstring -- because this was a desirable feature for
some users, IIRC.

> PS: for me this is not a theoretical issue: In many circumstances I
> would like '[[xx]]' instances not behave as links.  I would be happy
> if I could change the link format (e.g., use {{xx}} instead -- is it
> possible? (I fear it is not.)

No, you cannot change link syntax, but you don't need to, either.

Regards,

-- 
Nicolas Goaziou

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

* Re: Problem in removing the invisible brackets of a link
  2018-06-29 13:39 ` Nicolas Goaziou
@ 2018-07-03 13:12   ` Alain.Cochard
  2018-10-14  8:07     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Alain.Cochard @ 2018-07-03 13:12 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou writes on Fri 29 Jun 2018 15:39:

 > > The manual says:
 > >
 > >       If you place the cursor at the beginning or just behind the end
 > >    of the displayed text and press <BACKSPACE>, you will remove the
 > >    (invisible) bracket at that location.
 > >
 > > The problem for me it that it depends on the way I arrive at those
 > > locations.  For example, for '[[xx]]', seen as 'xx' underlined, if I
 > > have the cursor on the right of it and have it go towards the left
 > > just after the second 'x' and press <BACKSPACE>, then the behavior is
 > > as I expect (I see '[[xx]'), but, if I have the cursor on the left and
 > > have it go to towards the right just after the second 'x' and press
 > > <BACKSPACE>, then I see a single underlined 'x' (after a second
 > > <BACKSPACE> I see '[[]]').
 > >
 > > Is this normal?  [...]

 > Yes, it is normal Emacs behaviour. See (info "(elisp) Invisible
 > Text").

OK, thanks a lot.

> I guess we could clarify the manual. Suggestions welcome.

I guess you could simply add a footnote after "location." in the
excerpt above.

- Minimalist: See (info "(elisp) Invisible Text").

- Hardly more: For more details, see (info "(elisp) Invisible Text").

- Facetious: If unexpected behavior occurs, check (info "(elisp)
  Invisible Text").

- Too kind: Beware, the precise behavior depends on how the cursor has
  been placed there -- see (info "(elisp) Invisible Text").

 > > Incidentally, is there a way to have things like [[xx]] behave as
 > > plain text?

 > Yes, there is. Insert a zero width space after the opening
 > brackets.

Thanks again.  I would also advocate some mention of this in the
manual (if not already there somewhere, which I did not find).  I was
thinking about an extra sentence at the end of "4.1 Link format";
something like:

   To have ‘[[text]]’ constructs behave as plain text and not as
   links, insert a zero-width space (C-x 8 <RET> ZERO WIDTH SPACE
   <RET>) between the opening (or the closing) brackets.

However, I still don't see how this can be something convenient for
massive and frequent use.  In my case, I often yank and work on code
fragments written in the Mathematica language, for which the [[]]
syntax is used for list indexing.  Well, I guess I'll have to learn to
live with that...

 > > (I am not talking about literal links which are still
 > > understood as links.)  I have tried 'quote', 'verse', 'verbatim',
 > > 'comment', 'example', and org code block: none work.

 > =[[xx]]= and ~[[xx]]= are not links; try to export them.

Indeed.  Thanks once more.

Regards

-- 
EOST (École et Observatoire des Sciences de la Terre) 
IPG (Institut de Physique du Globe) | alain.cochard@unistra.fr
5 rue René Descartes   [bureau 106] | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France    | Fax:   +33 (0)3 68 85 01 25     

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

* Re: Problem in removing the invisible brackets of a link
  2018-07-03 13:12   ` Alain.Cochard
@ 2018-10-14  8:07     ` Nicolas Goaziou
  2018-10-14 12:11       ` Kaushal Modi
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2018-10-14  8:07 UTC (permalink / raw)
  To: Alain.Cochard; +Cc: emacs-orgmode

Hello,

Alain.Cochard@unistra.fr writes:

>  > =[[xx]]= and ~[[xx]]= are not links; try to export them.
>
> Indeed.  Thanks once more.

For the record, I fixed fontification of verbatim markup. Links within
=...= and ~...~ are no longer fontified.

Regard,s

-- 
Nicolas Goaziou

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

* Re: Problem in removing the invisible brackets of a link
  2018-10-14  8:07     ` Nicolas Goaziou
@ 2018-10-14 12:11       ` Kaushal Modi
  0 siblings, 0 replies; 5+ messages in thread
From: Kaushal Modi @ 2018-10-14 12:11 UTC (permalink / raw)
  To: Alain.Cochard, emacs-org list

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

On Sun, Oct 14, 2018, 4:08 AM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Alain.Cochard@unistra.fr writes:
>
> >  > =[[xx]]= and ~[[xx]]= are not links; try to export them.
> >
> > Indeed.  Thanks once more.
>
> For the record, I fixed fontification of verbatim markup. Links within
> =...= and ~...~ are no longer fontified.
>

You fixed a little long time pet peeve :) Many thanks!

>

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

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

end of thread, other threads:[~2018-10-14 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-29  9:36 Problem in removing the invisible brackets of a link Alain.Cochard
2018-06-29 13:39 ` Nicolas Goaziou
2018-07-03 13:12   ` Alain.Cochard
2018-10-14  8:07     ` Nicolas Goaziou
2018-10-14 12:11       ` Kaushal Modi

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).