Re: [O] [bug] Asterisks in source and example blocks interpreted as headings

2011-08-31 Thread Jason Dunsmore
Bastien b...@altern.org writes:

 Hi Jason,

 Jason Dunsmore emacs-orgm...@dunsmor.com writes:

 Bastien b...@altern.org writes:

 Hi Jason,

 Jason Dunsmore emacs-orgm...@dunsmor.com writes:

 I noticed that lines with leading asterisks inside of source and example
 blocks are interpreted as headings:

 The attached patch should fix this -- please confirm.

 Hm, I'm still seeing the same issue with both source and example
 blocks.

 Yes -- my patch only took care of not allowing *manually* folding
 headlines in selected environments.  But those headlines were still
 folded when finding an org file with #+STARTUP: fold in it.

 In the meantime, is it okay for you to TAB and have the commas
 automatically added, as Sébastien suggested?

Sure, that works.  I've turned on `org-src-tab-acts-natively' as Carsten
suggested.  I also re-enabled `org-edit-src-content-indentation', which
was previously set to 0.



Re: [O] [bug] Asterisks in source and example blocks interpreted as headings

2011-08-25 Thread Bastien
Hi Jason,

Jason Dunsmore emacs-orgm...@dunsmor.com writes:

 Bastien b...@altern.org writes:

 Hi Jason,

 Jason Dunsmore emacs-orgm...@dunsmor.com writes:

 I noticed that lines with leading asterisks inside of source and example
 blocks are interpreted as headings:

 The attached patch should fix this -- please confirm.

 Hm, I'm still seeing the same issue with both source and example
 blocks.

Yes -- my patch only took care of not allowing *manually* folding
headlines in selected environments.  But those headlines were still
folded when finding an org file with #+STARTUP: fold in it.

In the meantime, is it okay for you to TAB and have the commas
automatically added, as Sébastien suggested?

-- 
 Bastien



Re: [O] [bug] Asterisks in source and example blocks interpreted as headings

2011-08-25 Thread Carsten Dominik

On Aug 25, 2011, at 3:27 PM, Bastien wrote:

 Hi Jason,
 
 Jason Dunsmore emacs-orgm...@dunsmor.com writes:
 
 Bastien b...@altern.org writes:
 
 Hi Jason,
 
 Jason Dunsmore emacs-orgm...@dunsmor.com writes:
 
 I noticed that lines with leading asterisks inside of source and example
 blocks are interpreted as headings:
 
 The attached patch should fix this -- please confirm.
 
 Hm, I'm still seeing the same issue with both source and example
 blocks.
 
 Yes -- my patch only took care of not allowing *manually* folding
 headlines in selected environments.  But those headlines were still
 folded when finding an org file with #+STARTUP: fold in it.
 
 In the meantime, is it okay for you to TAB and have the commas
 automatically added, as Sébastien suggested?


This requires

(setq org-src-tab-acts-natively t)

- Caraten


 
 -- 
 Bastien
 

- Carsten






Re: [O] [bug] Asterisks in source and example blocks interpreted as headings

2011-08-19 Thread Eric Schulte
Using org-edit-special bound to C-c ' to edit the contents of source or
example blocks will inserted the leading ,s automatically when they
are required.

Best -- Eric

Daniel Bausch danielbau...@gmx.de writes:

 Hi,

 AFAIK that is exactly the case, for which the , rule is for.
 Just put a , in front of the offending line and everything will be fine.
 On export the , is removed.

 best regards,
 Daniel

 Am Dienstag 16 August 2011, 20:27:01 schrieb Jason Dunsmore:
 Hello,
 
 I noticed that lines with leading asterisks inside of source and example
 blocks are interpreted as headings:
 
 --8---cut here---start-8---
 * Heading 1
 
 #+begin_example
 foo
 * bar
 blah
 #+end_example
 
 * Heading 2
 --8---cut here---end---8---
 
 If you put the point on Heading 1 and hit TAB, you'll see the
 following:
 
 --8---cut here---start-8---
 * Heading 1...
 * bar
 blah
 #+end_example
 
 * Heading 2
 --8---cut here---end---8---
 
 I'm using GNU Emacs 23.2.1 and Org-mode version 7.7
 (release_7.7.97.g9d5c5)
 
 Regards,
 Jason




-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



Re: [O] [bug] Asterisks in source and example blocks interpreted as headings

2011-08-19 Thread Sebastien Vauban
Hi,

Eric Schulte wrote:
 Daniel Bausch danielbau...@gmx.de writes:
 AFAIK that is exactly the case, for which the , rule is for.
 Just put a , in front of the offending line and everything will be fine.
 On export the , is removed.

 Using org-edit-special bound to C-c ' to edit the contents of source or
 example blocks will inserted the leading ,s automatically when they
 are required.

Or TAB'ing inside the code block in the source Org buffer.

Best regards,
  Seb

PS- I (almost) never use the indirect buffer anymore, thanks to native
highlighting.

-- 
Sebastien Vauban




Re: [O] [bug] Asterisks in source and example blocks interpreted as headings

2011-08-17 Thread Daniel Bausch
Hi,

AFAIK that is exactly the case, for which the , rule is for.
Just put a , in front of the offending line and everything will be fine.
On export the , is removed.

best regards,
Daniel

Am Dienstag 16 August 2011, 20:27:01 schrieb Jason Dunsmore:
 Hello,
 
 I noticed that lines with leading asterisks inside of source and example
 blocks are interpreted as headings:
 
 --8---cut here---start-8---
 * Heading 1
 
 #+begin_example
 foo
 * bar
 blah
 #+end_example
 
 * Heading 2
 --8---cut here---end---8---
 
 If you put the point on Heading 1 and hit TAB, you'll see the
 following:
 
 --8---cut here---start-8---
 * Heading 1...
 * bar
 blah
 #+end_example
 
 * Heading 2
 --8---cut here---end---8---
 
 I'm using GNU Emacs 23.2.1 and Org-mode version 7.7
 (release_7.7.97.g9d5c5)
 
 Regards,
 Jason





[O] [bug] Asterisks in source and example blocks interpreted as headings

2011-08-16 Thread Jason Dunsmore
Hello,

I noticed that lines with leading asterisks inside of source and example
blocks are interpreted as headings:

--8---cut here---start-8---
* Heading 1

#+begin_example
foo
* bar
blah
#+end_example

* Heading 2
--8---cut here---end---8---

If you put the point on Heading 1 and hit TAB, you'll see the
following:

--8---cut here---start-8---
* Heading 1...
* bar
blah
#+end_example

* Heading 2
--8---cut here---end---8---

I'm using GNU Emacs 23.2.1 and Org-mode version 7.7
(release_7.7.97.g9d5c5)

Regards,
Jason



Re: [O] [bug] Asterisks in source and example blocks interpreted as headings

2011-08-16 Thread Bastien
Hi Jason,

Jason Dunsmore emacs-orgm...@dunsmor.com writes:

 I noticed that lines with leading asterisks inside of source and example
 blocks are interpreted as headings:

The attached patch should fix this -- please confirm.

Thanks!

From 4ff6f7a78c07654e70ac8473c911b873340f0b67 Mon Sep 17 00:00:00 2001
From: Bastien Guerry b...@altern.org
Date: Tue, 16 Aug 2011 21:51:02 +0200
Subject: [PATCH] org.el: Fix bug about headlines in blocks.

* org.el (org-cycle): Use `org-at-heading-p'.
(org-heading-forbidden-blocks): Variable alias to
`org-list-forbidden-blocks'.
(org-on-heading-p, org-at-heading-p): only perform the check
when we are in allowed blocks, otherwise just return nil.

Thanks to Jason Dunsmor for pointing at this.
---
 lisp/org.el |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 2c38b33..2eabcb8 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5994,8 +5994,7 @@ in special contexts.
 
;; At an item/headline: delegate to `org-cycle-internal-local'.
((and (or (and org-cycle-include-plain-lists (org-at-item-p))
-		 (save-excursion (beginning-of-line 1)
- (looking-at org-outline-regexp)))
+		 (org-at-heading-p))
 	 (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol
 	(org-cycle-internal-local))
 
@@ -20067,10 +20066,17 @@ This version does not only check the character property, but also
 (end-of-line)
 (null (re-search-backward org-outline-regexp-bol nil t
 
+(defvaralias 'org-heading-forbidden-blocks 'org-list-forbidden-blocks
+  List of blocks where a heading should not be treated as such.
+See `org-list-forbidden-blocks'.)
+
 (defun org-on-heading-p (optional ignored)
-  (outline-on-heading-p t))
+  (unless (org-in-block-p org-heading-forbidden-blocks)
+(outline-on-heading-p t)))
+
 (defun org-at-heading-p (optional ignored)
-  (outline-on-heading-p t))
+  (unless (org-in-block-p org-heading-forbidden-blocks)
+(outline-on-heading-p t)))
 
 (defun org-point-at-end-of-empty-headline ()
   If point is at the end of an empty headline, return t, else nil.
-- 
1.7.5.2


-- 
 Bastien


Re: [O] [bug] Asterisks in source and example blocks interpreted as headings

2011-08-16 Thread Jason Dunsmore
Bastien b...@altern.org writes:

 Hi Jason,

 Jason Dunsmore emacs-orgm...@dunsmor.com writes:

 I noticed that lines with leading asterisks inside of source and example
 blocks are interpreted as headings:

 The attached patch should fix this -- please confirm.

Hm, I'm still seeing the same issue with both source and example blocks.