* Using double square brackets literally (escaping link conversion) in org-mode
@ 2012-09-04 10:20 Giuseppe Pagnoni
2012-09-04 11:01 ` Charles Philip Chan
0 siblings, 1 reply; 7+ messages in thread
From: Giuseppe Pagnoni @ 2012-09-04 10:20 UTC (permalink / raw)
To: emacs-orgmode
Hi all,
I use org-mode for taking notes and I often need to jot down code
examples. In the language R, subscription is often done with double
square brackets (for instance, I can extract the 2nd element of a
`list' object x with the code: x[[2]]). Now, I haven't been able to
write such example code within org-mode, without them turning
automatically into hyperlinks (I am talking about the plain emacs
interface here, which is what I use most, not about exporting into
formats such as latex or HTML).
Is there a way to disable automatic link conversion for text enclosed
into double square brackets on a case-by-case basis (i.e., use double
square brackets as verbatim, non-link, text)? I have found that I can
still *see* the brackets if I toggle org-toggle-link-display, but that
seems like a poor workaround since the text within the brackets is
still considered a hyperlink. I have looked quite a bit into the
manual and on the mailing list for an answer, but to no avail...
Thanks in advance for any suggestion
best
giuseppe
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Using double square brackets literally (escaping link conversion) in org-mode
2012-09-04 10:20 Giuseppe Pagnoni
@ 2012-09-04 11:01 ` Charles Philip Chan
0 siblings, 0 replies; 7+ messages in thread
From: Charles Philip Chan @ 2012-09-04 11:01 UTC (permalink / raw)
To: Org-mode
[-- Attachment #1: Type: text/plain, Size: 923 bytes --]
Giuseppe Pagnoni <gpagnoni@gmail.com> writes:
Hi Giuseppe:
> I use org-mode for taking notes and I often need to jot down code
> examples. In the language R, subscription is often done with double
> square brackets (for instance, I can extract the 2nd element of a
> `list' object x with the code: x[[2]]). Now, I haven't been able to
> write such example code within org-mode, without them turning
> automatically into hyperlinks (I am talking about the plain emacs
> interface here, which is what I use most, not about exporting into
> formats such as latex or HTML).
Use a src block. For example:
#+BEGIN_SRC R
bla..bla..
#+END_SRC
Please refer to this section:
http://orgmode.org/manual/Working-With-Source-Code.html#Working-With-Source-Code
in the manual.
Cheers,
Charles
--
"...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and
the Ugly)."
(By Matt Welsh)
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Using double square brackets literally (escaping link conversion) in org-mode
@ 2012-09-04 11:40 Giuseppe Pagnoni
2012-09-04 11:59 ` Charles Philip Chan
0 siblings, 1 reply; 7+ messages in thread
From: Giuseppe Pagnoni @ 2012-09-04 11:40 UTC (permalink / raw)
To: cpchan, emacs-orgmode
Hello Charles,
thank you for the fast reply. I had actually tried to use the SRC
block, but the bracket-enclosed text is still converted to hyperlink
format in the Emacs GUI, with the consequent vanishing of the
brackets. My understanding is that by using the SRC blocks, the
brackets are actually preserved (and the text printed verbatim) when
*exporting* to formats such as LaTeX or HTML, but they are *not*
displayed verbatim within the Emacs GUI. Unless I am missing
something obvious here...
thanks again
giuseppe
--
Giuseppe Pagnoni
Dip. Scienze Biomediche, Metaboliche e Neuroscienze
Sezione Fisiologia e Neuroscienze
Univ. di Modena e Reggio Emilia
Via Campi 287
I-41125 Modena, Italy
Tel: +39-059-205-5742
Fax: +39-059-205-5363
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Using double square brackets literally (escaping link conversion) in org-mode
2012-09-04 11:40 Giuseppe Pagnoni
@ 2012-09-04 11:59 ` Charles Philip Chan
0 siblings, 0 replies; 7+ messages in thread
From: Charles Philip Chan @ 2012-09-04 11:59 UTC (permalink / raw)
To: Org-mode
[-- Attachment #1: Type: text/plain, Size: 577 bytes --]
Giuseppe Pagnoni <gpagnoni@gmail.com> writes:
Hi Giuseppe:
> thank you for the fast reply. I had actually tried to use the SRC
> block, but the bracket-enclosed text is still converted to hyperlink
> format in the Emacs GUI, with the consequent vanishing of the
> brackets.
Works fine for me- they do not show up as hyperlinks for me within a
block and they export correctly.
Maybe your version of org-mode is too old. I am using the current git
version.
Charles
--
"It's God. No, not Richard Stallman, or Linus Torvalds, but God."
(By Matt Welsh)
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Using double square brackets literally (escaping link conversion) in org-mode
@ 2012-09-04 13:59 Giuseppe Pagnoni
2012-09-04 14:16 ` Charles Philip Chan
0 siblings, 1 reply; 7+ messages in thread
From: Giuseppe Pagnoni @ 2012-09-04 13:59 UTC (permalink / raw)
To: cpchan, emacs-orgmode
Hello Charles,
I upgraded to the latest Emacs and org-mode versions, but then I found
out that the text does reformat correctly if I position the cursor at
the beginning of the SRC block (that is, on the first `#') and enter a
newline (or, alternatively, if I close and reopen the file). I have
no idea why you need to do that in order to have org-mode recognize
that it should use a code syntax, but it works.
thanks for all your help!
best
giuseppe
--
Giuseppe Pagnoni
Dip. Scienze Biomediche, Metaboliche e Neuroscienze
Sezione Fisiologia e Neuroscienze
Univ. di Modena e Reggio Emilia
Via Campi 287
I-41125 Modena, Italy
Tel: +39-059-205-5742
Fax: +39-059-205-5363
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Using double square brackets literally (escaping link conversion) in org-mode
2012-09-04 13:59 Giuseppe Pagnoni
@ 2012-09-04 14:16 ` Charles Philip Chan
0 siblings, 0 replies; 7+ messages in thread
From: Charles Philip Chan @ 2012-09-04 14:16 UTC (permalink / raw)
To: Org-mode
[-- Attachment #1: Type: text/plain, Size: 817 bytes --]
Giuseppe Pagnoni <gpagnoni@gmail.com> writes:
Hi Giuseppe:
> I upgraded to the latest Emacs and org-mode versions, but then I found
> out that the text does reformat correctly if I position the cursor at
> the beginning of the SRC block (that is, on the first `#') and enter a
> newline (or, alternatively, if I close and reopen the file). I have
> no idea why you need to do that in order to have org-mode recognize
> that it should use a code syntax, but it works.
In order to enter code comfortably, I suggest you use C-c' on the
block. This will bring up a major mode buffer for the language you are
using.
Cheers.
Charles
--
"On a normal ascii line, the only safe condition to detect is a 'BREAK'
- everything else having been assigned functions by Gnu EMACS."
(By Tarl Neustaedter)
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Using double square brackets literally (escaping link conversion) in org-mode
@ 2012-09-05 10:09 Giuseppe Pagnoni
0 siblings, 0 replies; 7+ messages in thread
From: Giuseppe Pagnoni @ 2012-09-05 10:09 UTC (permalink / raw)
To: cpchan, emacs-orgmode
good tip, thanks!
giuseppe
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-09-05 10:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-05 10:09 Using double square brackets literally (escaping link conversion) in org-mode Giuseppe Pagnoni
-- strict thread matches above, loose matches on Subject: below --
2012-09-04 13:59 Giuseppe Pagnoni
2012-09-04 14:16 ` Charles Philip Chan
2012-09-04 11:40 Giuseppe Pagnoni
2012-09-04 11:59 ` Charles Philip Chan
2012-09-04 10:20 Giuseppe Pagnoni
2012-09-04 11:01 ` Charles Philip Chan
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.