emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Parens matching off in babel code block
@ 2019-05-02  2:56 Lawrence Bottorff
  2019-05-02 15:35 ` Berry, Charles
  0 siblings, 1 reply; 11+ messages in thread
From: Lawrence Bottorff @ 2019-05-02  2:56 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

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

Wondering if you have seen this
<https://emacs.stackexchange.com/questions/50216/org-mode-code-block-parentheses-mismatch>
over
at emacs.stackexchange. Very puzzling why the parens mismatch in a babel
emacs-lisp block, but not anywhere else in Emacs.

LB

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

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

* Re: Parens matching off in babel code block
  2019-05-02  2:56 Parens matching off in babel code block Lawrence Bottorff
@ 2019-05-02 15:35 ` Berry, Charles
  2019-05-02 16:01   ` Lawrence Bottorff
  0 siblings, 1 reply; 11+ messages in thread
From: Berry, Charles @ 2019-05-02 15:35 UTC (permalink / raw)
  To: Lawrence Bottorff; +Cc: emacs-orgmode Mailinglist



> On May 1, 2019, at 7:56 PM, Lawrence Bottorff <borgauf@gmail.com> wrote:
> 
> Wondering if you have seen this over at emacs.stackexchange. Very puzzling why the parens mismatch in a babel emacs-lisp block, but not anywhere else in Emacs.

I don't know the details but this ECM might help:

#+begin_src emacs-lisp
  (> 1 2)
#+end_src

The right broken bracket matches the left parenthesis in org-mode, but not in a Lisp Interaction Mode buffer.

HTH

Chuck 

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

* Re: Parens matching off in babel code block
  2019-05-02 15:35 ` Berry, Charles
@ 2019-05-02 16:01   ` Lawrence Bottorff
  2019-05-02 20:11     ` Bruno BARBIER
  0 siblings, 1 reply; 11+ messages in thread
From: Lawrence Bottorff @ 2019-05-02 16:01 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

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

Not sure what you mean. This is the problem, i.e., just this code

#+begin_src emacs-lisp
  (> 1 2)
#+end_src

in an org file produces a parens mismatch, which, BTW, check-parens also
flags. Anywhere else (e.g., *scratch*) in Emacs this code produces no
mismatch.

On Thu, May 2, 2019 at 10:35 AM Berry, Charles <ccberry@ucsd.edu> wrote:

>
>
> > On May 1, 2019, at 7:56 PM, Lawrence Bottorff <borgauf@gmail.com> wrote:
> >
> > Wondering if you have seen this over at emacs.stackexchange. Very
> puzzling why the parens mismatch in a babel emacs-lisp block, but not
> anywhere else in Emacs.
>
> I don't know the details but this ECM might help:
>
> #+begin_src emacs-lisp
>   (> 1 2)
> #+end_src
>
> The right broken bracket matches the left parenthesis in org-mode, but not
> in a Lisp Interaction Mode buffer.
>
> HTH
>
> Chuck
>

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

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

* Re: Parens matching off in babel code block
  2019-05-02 16:01   ` Lawrence Bottorff
@ 2019-05-02 20:11     ` Bruno BARBIER
  2019-05-02 20:28       ` Marco Wahl
  0 siblings, 1 reply; 11+ messages in thread
From: Bruno BARBIER @ 2019-05-02 20:11 UTC (permalink / raw)
  To: Lawrence Bottorff, emacs-orgmode Mailinglist


Hi Lawrence,

Lawrence Bottorff <borgauf@gmail.com> writes:

> Not sure what you mean. This is the problem, i.e., just this code
>
> #+begin_src emacs-lisp
>   (> 1 2)
> #+end_src
>
> in an org file produces a parens mismatch, which, BTW, check-parens also
> flags. Anywhere else (e.g., *scratch*) in Emacs this code produces no
> mismatch.
>
In an org buffer, '>' is a closing delimiter. In an elisp buffer (like
the *scratch* one), '>' is just a symbol (you can use the command
'describe-char' to have a description of the character at point).

In short, if I understand correctly, it's not supposed to work like you
expect; you need to edit the source block to do things that really
depend on the code source syntax (C-c ').

Bruno


> On Thu, May 2, 2019 at 10:35 AM Berry, Charles <ccberry@ucsd.edu> wrote:
>
>>
>>
>> > On May 1, 2019, at 7:56 PM, Lawrence Bottorff <borgauf@gmail.com> wrote:
>> >
>> > Wondering if you have seen this over at emacs.stackexchange. Very
>> puzzling why the parens mismatch in a babel emacs-lisp block, but not
>> anywhere else in Emacs.
>>
>> I don't know the details but this ECM might help:
>>
>> #+begin_src emacs-lisp
>>   (> 1 2)
>> #+end_src
>>
>> The right broken bracket matches the left parenthesis in org-mode, but not
>> in a Lisp Interaction Mode buffer.
>>
>> HTH
>>
>> Chuck
>>

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

* Re: Parens matching off in babel code block
  2019-05-02 20:11     ` Bruno BARBIER
@ 2019-05-02 20:28       ` Marco Wahl
  2019-05-02 21:38         ` Nicolas Goaziou
  0 siblings, 1 reply; 11+ messages in thread
From: Marco Wahl @ 2019-05-02 20:28 UTC (permalink / raw)
  To: emacs-orgmode

>> Not sure what you mean. This is the problem, i.e., just this code
>>
>> #+begin_src emacs-lisp
>>   (> 1 2)
>> #+end_src
>>
>> in an org file produces a parens mismatch, which, BTW, check-parens also
>> flags. Anywhere else (e.g., *scratch*) in Emacs this code produces no
>> mismatch.

> In an org buffer, '>' is a closing delimiter. In an elisp buffer (like
> the *scratch* one), '>' is just a symbol (you can use the command
> 'describe-char' to have a description of the character at point).

> In short, if I understand correctly, it's not supposed to work like you
> expect; you need to edit the source block to do things that really
> depend on the code source syntax (C-c ').

Using < and > as parenthesis in Org is questionable, I think.  Also this
behavior is not documented AFAICT.

What about removing this special?  Or does anyone enjoy this behavior?

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

* Re: Parens matching off in babel code block
  2019-05-02 20:28       ` Marco Wahl
@ 2019-05-02 21:38         ` Nicolas Goaziou
  2019-05-03  2:11           ` Lawrence Bottorff
  2019-05-03  8:20           ` Marco Wahl
  0 siblings, 2 replies; 11+ messages in thread
From: Nicolas Goaziou @ 2019-05-02 21:38 UTC (permalink / raw)
  To: Marco Wahl; +Cc: emacs-orgmode

Hello,

Marco Wahl <marcowahlsoft@gmail.com> writes:

> Using < and > as parenthesis in Org is questionable, I think.  

In Org syntax, < and > often come in pair (timestamps, some links,
targets, radio targets). There is at least some interest in the current
behaviour.

> Also this behavior is not documented AFAICT.

I don't think you can document every single detail. Even if it was
possible, it wouldn't be desirable.

> What about removing this special?  Or does anyone enjoy this behavior?

This needs to be carefully tested and weighted.

Regards,

-- 
Nicolas Goaziou

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

* Re: Parens matching off in babel code block
  2019-05-02 21:38         ` Nicolas Goaziou
@ 2019-05-03  2:11           ` Lawrence Bottorff
  2019-05-03  9:23             ` Fraga, Eric
  2019-05-03  8:20           ` Marco Wahl
  1 sibling, 1 reply; 11+ messages in thread
From: Lawrence Bottorff @ 2019-05-03  2:11 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

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

Well, at least there is a sane explanation. Ironically, I was also about to
complain about all my loose ">"s getting flagged. So they are related!
Would there be a way to make an exception for < and > inside of actual code
forms? Languages need them for "greater than" and "less than".

On Thu, May 2, 2019 at 4:39 PM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Marco Wahl <marcowahlsoft@gmail.com> writes:
>
> > Using < and > as parenthesis in Org is questionable, I think.
>
> In Org syntax, < and > often come in pair (timestamps, some links,
> targets, radio targets). There is at least some interest in the current
> behaviour.
>
> > Also this behavior is not documented AFAICT.
>
> I don't think you can document every single detail. Even if it was
> possible, it wouldn't be desirable.
>
> > What about removing this special?  Or does anyone enjoy this behavior?
>
> This needs to be carefully tested and weighted.
>
> Regards,
>
> --
> Nicolas Goaziou
>
>

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

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

* Re: Parens matching off in babel code block
  2019-05-02 21:38         ` Nicolas Goaziou
  2019-05-03  2:11           ` Lawrence Bottorff
@ 2019-05-03  8:20           ` Marco Wahl
  1 sibling, 0 replies; 11+ messages in thread
From: Marco Wahl @ 2019-05-03  8:20 UTC (permalink / raw)
  To: Marco Wahl; +Cc: emacs-orgmode

Hi,

>> Using < and > as parenthesis in Org is questionable, I think.  
>
> In Org syntax, < and > often come in pair (timestamps, some links,
> targets, radio targets). There is at least some interest in the current
> behaviour.

Yes, okay.

>> Also this behavior is not documented AFAICT.
>
> I don't think you can document every single detail. Even if it was
> possible, it wouldn't be desirable.

Agreed.  My statement was thought as a pointer to the possibility to
drop the <>-parenthesis-feature without touching the documentation.

>> What about removing this special?  Or does anyone enjoy this behavior?
>
> This needs to be carefully tested and weighted.

Yes, agreed.

Currently I run Org mode without the <> parenthesis using the patch:

modified   lisp/org.el
-  (modify-syntax-entry ?< "(>")
-  (modify-syntax-entry ?> ")<")
+  ;; (modify-syntax-entry ?< "(>")
+  ;; (modify-syntax-entry ?> ")<")

Up to now I don't miss the <> parenthesis.  But this is just me.


Ciao,
-- 
Marco

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

* Re: Parens matching off in babel code block
  2019-05-03  2:11           ` Lawrence Bottorff
@ 2019-05-03  9:23             ` Fraga, Eric
  2019-05-04 12:54               ` John Kitchin
  2019-05-05 15:02               ` Marco Wahl
  0 siblings, 2 replies; 11+ messages in thread
From: Fraga, Eric @ 2019-05-03  9:23 UTC (permalink / raw)
  To: Lawrence Bottorff; +Cc: emacs-orgmode Mailinglist

On Thursday,  2 May 2019 at 21:11, Lawrence Bottorff wrote:
> Well, at least there is a sane explanation. Ironically, I was also about to
> complain about all my loose ">"s getting flagged. So they are related!
> Would there be a way to make an exception for < and > inside of actual code
> forms? Languages need them for "greater than" and "less than".

I have the following in my org mode customization:

    (modify-syntax-entry ?< ".")
    (modify-syntax-entry ?> ".")

as many of my org files have these symbols not as paren but as operators.
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-290-g300f15

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

* Re: Parens matching off in babel code block
  2019-05-03  9:23             ` Fraga, Eric
@ 2019-05-04 12:54               ` John Kitchin
  2019-05-05 15:02               ` Marco Wahl
  1 sibling, 0 replies; 11+ messages in thread
From: John Kitchin @ 2019-05-04 12:54 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: emacs-orgmode Mailinglist, Lawrence Bottorff


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

This issue also pops up in python blocks for me alot.  For example, here is
a place where it does not work as it should.

[image: image.png]
John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Fri, May 3, 2019 at 5:24 AM Fraga, Eric <e.fraga@ucl.ac.uk> wrote:

> On Thursday,  2 May 2019 at 21:11, Lawrence Bottorff wrote:
> > Well, at least there is a sane explanation. Ironically, I was also about
> to
> > complain about all my loose ">"s getting flagged. So they are related!
> > Would there be a way to make an exception for < and > inside of actual
> code
> > forms? Languages need them for "greater than" and "less than".
>
> I have the following in my org mode customization:
>
>     (modify-syntax-entry ?< ".")
>     (modify-syntax-entry ?> ".")
>
> as many of my org files have these symbols not as paren but as operators.
> --
> Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-290-g300f15
>

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

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 3690 bytes --]

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

* Re: Parens matching off in babel code block
  2019-05-03  9:23             ` Fraga, Eric
  2019-05-04 12:54               ` John Kitchin
@ 2019-05-05 15:02               ` Marco Wahl
  1 sibling, 0 replies; 11+ messages in thread
From: Marco Wahl @ 2019-05-05 15:02 UTC (permalink / raw)
  To: emacs-orgmode

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> On Thursday,  2 May 2019 at 21:11, Lawrence Bottorff wrote:
>> Well, at least there is a sane explanation. Ironically, I was also about to
>> complain about all my loose ">"s getting flagged. So they are related!
>> Would there be a way to make an exception for < and > inside of actual code
>> forms? Languages need them for "greater than" and "less than".
>
> I have the following in my org mode customization:
>
>     (modify-syntax-entry ?< ".")
>     (modify-syntax-entry ?> ".")
>
> as many of my org files have these symbols not as paren but as operators.

I'll follow your lead and add the lines

	(add-hook
	 'org-mode-hook
	 (lambda ()
	    (modify-syntax-entry ?< ".")
	    (modify-syntax-entry ?> ".")))

to my config.


Thanks,
-- 
Marco 

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

end of thread, other threads:[~2019-05-05 15:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-02  2:56 Parens matching off in babel code block Lawrence Bottorff
2019-05-02 15:35 ` Berry, Charles
2019-05-02 16:01   ` Lawrence Bottorff
2019-05-02 20:11     ` Bruno BARBIER
2019-05-02 20:28       ` Marco Wahl
2019-05-02 21:38         ` Nicolas Goaziou
2019-05-03  2:11           ` Lawrence Bottorff
2019-05-03  9:23             ` Fraga, Eric
2019-05-04 12:54               ` John Kitchin
2019-05-05 15:02               ` Marco Wahl
2019-05-03  8:20           ` Marco Wahl

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