emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Inserted Heading Starts on Prior Heading's Fold Mark
@ 2015-04-06 17:05 Daniel E. Doherty
  2015-04-06 18:12 ` John Hendy
  2015-04-06 23:41 ` Nicolas Goaziou
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel E. Doherty @ 2015-04-06 17:05 UTC (permalink / raw)
  To: emacs-orgmode


I don't know when this started, but recently I've seen the following annoying
behavior from M-RET in org files.

Here is a minimal file to demonstrate what I'm seeing lately:

============================== demo.org ==============================
* First Header
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.

* Second Header
=======================================================================

When the headings are completely folded, I see the following, as expected:

============================== demo.org ==============================
 * First Header...
^* Second Header
=======================================================================

With my cursor on the ^, I hit M-RET to insert a new heading between "First
Header" and "Second Header", and I get the following:

=======================================================================

When the headings are completely folded, I see the following, as expected:

============================== demo.org ==============================
 * First Header...* ^
 * Second Header
=======================================================================

In other words, the new heading is being placed after the elipses for the
folded content of the first heading.

Naturally, I expect the following:

============================== demo.org ==============================
 * First Header...
 * ^
 * Second Header
=======================================================================

I'm trying to determine if this is an odd intereaction from some of my
settings, or if it is a bug in the org code.

It does the same whether I have org-indent-mode toggled on or off.

Does anyone else see this behavior?

My emacs-version is:
GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23) of 2014-10-28 on micah

Here are the main org settings from my init file:

,----[ init.el ]
| #+BEGIN_SRC emacs-lisp :tangle yes
|   (setq org-directory (expand-file-name "~/Dropbox/Projects/"))
|   (setq org-agenda-files (concat org-directory "agenda-files"))
|   (setq
|      org-attach-directory user-data-dir
|      org-agenda-include-diary t
|      org-agenda-span 3
|      org-todo-keywords '((sequence "TODO(t)" "WAIT(w)" "|" "DONE(d)" "CNCL(x)"))
|      org-todo-interpretation 'sequence
|      org-return-follows-link t
|      org-cycle-separator-lines 2
|      org-completion-use-ido t
|      org-refile-use-outline-path 'file
|      org-outline-path-complete-in-steps nil
|      org-refile-allow-creating-parent-nodes t)
| #+END_SRC
`----

And here is what I have set in my custom.el files:

,----[ custom.el ]
| #+BEGIN_SRC emacs-lisp
|  '(org-agenda-span (quote day))
|  '(org-blank-before-new-entry (quote ((heading) (plain-list-item . auto))))
|  '(org-confirm-babel-evaluate nil)
|  '(org-entities-ascii-explanatory t)
|  '(org-export-babel-evaluate nil)
|  '(org-file-apps
|    (quote
|     ((auto-mode . emacs)
|      ("\\.mm\\'" . default)
|      ("\\.x?html?\\'" . default)
|      ("\\.pdf\\'" . default)
|      ("ods" . "oocalc"))))
|  '(org-footnote-fill-after-inline-note-extraction t)
|  '(org-format-latex-options
|    (quote
|     (:foreground "OliveDrab" :background default :scale 1.2 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers
|                  ("begin" "$1" "$" "$$" "\\(" "\\["))))
|  '(org-highlight-latex-and-related (quote (latex)))
|  '(org-icalendar-include-todo t)
|  '(org-icalendar-use-plain-timestamp t)
|  '(org-latex-pdf-process
|    (quote
|     ("/usr/bin/pdflatex -interaction nonstopmode -output-directory %o %f" "/usr/bin/pdflatex -interaction nonstopmode -output-directory %o %f" "/usr/bin/pdflatex -interaction nonstopmode -output-directory %o %f")))
|  '(org-list-demote-modify-bullet (quote (("+" . "-") ("-" . "*") ("*" . "+"))))
|  '(org-list-indent-offset 2)
|  '(org-log-refile (quote time))
|  '(org-modules
|    (quote
|     (org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-protocol org-vm org-wl org-w3m)))
|  '(org-outline-path-complete-in-steps nil)
|  '(org-pretty-entities-include-sub-superscripts nil)
|  '(org-refile-targets (quote ((org-agenda-files :maxlevel . 1))))
|  '(org-refile-use-outline-path (quote file))
|  '(org-special-ctrl-a/e t)
|  '(org-special-ctrl-k t)
|  '(org-src-fontify-natively t)
|  '(org-src-tab-acts-natively t)
|  '(org-startup-align-all-tables t)
|  '(org-startup-folded t)
|  '(org-table-number-regexp
|    "^\\([<>]?\\(\\$ *\\)?[-+^.,0-9]*[0-9][-+^.0-9eEdDx()%:]*\\|\\(0[xX]\\)[0-9a-fA-F]+\\|nan\\)$")
|  '(org-time-stamp-custom-formats (quote ("<%b %d, %Y (%a)>" . "<%b %d, %Y (%a) @ %H:%M>")))
| #+END_SRC
`----

I've tried tweaking a number of these settings with no luck.

Any ideas about what is going wrong here?

Dan Doherty

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

* Re: Inserted Heading Starts on Prior Heading's Fold Mark
  2015-04-06 17:05 Inserted Heading Starts on Prior Heading's Fold Mark Daniel E. Doherty
@ 2015-04-06 18:12 ` John Hendy
  2015-04-06 20:16   ` Daniel E. Doherty
  2015-04-06 23:41 ` Nicolas Goaziou
  1 sibling, 1 reply; 6+ messages in thread
From: John Hendy @ 2015-04-06 18:12 UTC (permalink / raw)
  To: Daniel E. Doherty; +Cc: emacs-orgmode

On Mon, Apr 6, 2015 at 12:05 PM, Daniel E. Doherty <ded-law@ddoherty.net> wrote:
>
> I don't know when this started, but recently I've seen the following annoying
> behavior from M-RET in org files.

I have this on my main Org file and just assumed it was due to it
being big and Org having a tough time keeping track of all the various
blocks (src, example, etc.), properties, ids, and whatnot. I figured
I'd messed up the syntax in there somewhere and would just have to
deal with this quirky behavior.

I think others have experienced this as well (e.g.
http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg00457.html).

Can you try commenting out:

#+begin_src .emacs
;;(setq org-blank-before-new-entry nil)
#_end_src

I copied my .emacs into a new config, started with emacs -Q, loaded
that file, and then tried your original post's exercise, repeating
after commenting out various lines in my own config file. We both had
the above setting, and that turned out to fix it for me on your test
file. Not sure if there's another interaction between your options vs.
mine, though, so confirmation is needed.


John

>
> I've tried tweaking a number of these settings with no luck.
>
> Any ideas about what is going wrong here?
>
> Dan Doherty
>
>

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

* Re: Inserted Heading Starts on Prior Heading's Fold Mark
  2015-04-06 18:12 ` John Hendy
@ 2015-04-06 20:16   ` Daniel E. Doherty
  2015-04-06 21:26     ` John Hendy
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel E. Doherty @ 2015-04-06 20:16 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

John,

You nailed it.  I had that variable set in my custom file to

'(org-blank-before-new-entry (quote ((heading) (plain-list-item . auto))))

which is not a proper alist.  When I chaned it back to 

'(org-blank-before-new-entry (quote ((heading . auto) (plain-list-item . auto))))

the bad behavior went away.

Thanks a ton for taking a look at this, John.  Back to loving org-mode!


On Mon, 06 Apr 2015 13:12:21 -0500,
John Hendy <jw.hendy@gmail.com> wrote:
> 
> On Mon, Apr 6, 2015 at 12:05 PM, Daniel E. Doherty <ded-law@ddoherty.net> wrote:
> >
> > I don't know when this started, but recently I've seen the following annoying
> > behavior from M-RET in org files.
> 
> I have this on my main Org file and just assumed it was due to it
> being big and Org having a tough time keeping track of all the various
> blocks (src, example, etc.), properties, ids, and whatnot. I figured
> I'd messed up the syntax in there somewhere and would just have to
> deal with this quirky behavior.
> 
> I think others have experienced this as well (e.g.
> http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg00457.html).
> 
> Can you try commenting out:
> 
> #+begin_src .emacs
> ;;(setq org-blank-before-new-entry nil)
> #_end_src
> 
> I copied my .emacs into a new config, started with emacs -Q, loaded
> that file, and then tried your original post's exercise, repeating
> after commenting out various lines in my own config file. We both had
> the above setting, and that turned out to fix it for me on your test
> file. Not sure if there's another interaction between your options vs.
> mine, though, so confirmation is needed.
> 
> 
> John
> 
> >
> > I've tried tweaking a number of these settings with no luck.
> >
> > Any ideas about what is going wrong here?
> >
> > Dan Doherty
> >
> >
> 

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

* Re: Inserted Heading Starts on Prior Heading's Fold Mark
  2015-04-06 20:16   ` Daniel E. Doherty
@ 2015-04-06 21:26     ` John Hendy
  0 siblings, 0 replies; 6+ messages in thread
From: John Hendy @ 2015-04-06 21:26 UTC (permalink / raw)
  To: John Hendy, emacs-orgmode

On Mon, Apr 6, 2015 at 3:16 PM, Daniel E. Doherty <ded-law@ddoherty.net> wrote:
> John,
>
> You nailed it.  I had that variable set in my custom file to
>
> '(org-blank-before-new-entry (quote ((heading) (plain-list-item . auto))))
>
> which is not a proper alist.  When I chaned it back to
>
> '(org-blank-before-new-entry (quote ((heading . auto) (plain-list-item . auto))))
>
> the bad behavior went away.
>
> Thanks a ton for taking a look at this, John.  Back to loving org-mode!

Glad it worked! Thankfully it only took me a couple tries before
hitting the right variable. Plus, it was of interest as I've long
noticed this issue myself. Out of curiosity... *should* this work
without the =. auto=? It's been in my config so long I'm not really
even sure why I put it there, but from re-googling around I think it's
just an appearance/preference thing. Do you want your headlines
separated by a newline or not -- is that the gist?

If so, should this be glitching?

I've had other odd behavior where I'll fold the last headline and it's
last few characters will end up after the ellipsis and now wonder if
this was causing that as well.


Anyway, glad you're all set!
John

>
>
> On Mon, 06 Apr 2015 13:12:21 -0500,
> John Hendy <jw.hendy@gmail.com> wrote:
>>
>> On Mon, Apr 6, 2015 at 12:05 PM, Daniel E. Doherty <ded-law@ddoherty.net> wrote:
>> >
>> > I don't know when this started, but recently I've seen the following annoying
>> > behavior from M-RET in org files.
>>
>> I have this on my main Org file and just assumed it was due to it
>> being big and Org having a tough time keeping track of all the various
>> blocks (src, example, etc.), properties, ids, and whatnot. I figured
>> I'd messed up the syntax in there somewhere and would just have to
>> deal with this quirky behavior.
>>
>> I think others have experienced this as well (e.g.
>> http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg00457.html).
>>
>> Can you try commenting out:
>>
>> #+begin_src .emacs
>> ;;(setq org-blank-before-new-entry nil)
>> #_end_src
>>
>> I copied my .emacs into a new config, started with emacs -Q, loaded
>> that file, and then tried your original post's exercise, repeating
>> after commenting out various lines in my own config file. We both had
>> the above setting, and that turned out to fix it for me on your test
>> file. Not sure if there's another interaction between your options vs.
>> mine, though, so confirmation is needed.
>>
>>
>> John
>>
>> >
>> > I've tried tweaking a number of these settings with no luck.
>> >
>> > Any ideas about what is going wrong here?
>> >
>> > Dan Doherty
>> >
>> >
>>

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

* Re: Inserted Heading Starts on Prior Heading's Fold Mark
  2015-04-06 17:05 Inserted Heading Starts on Prior Heading's Fold Mark Daniel E. Doherty
  2015-04-06 18:12 ` John Hendy
@ 2015-04-06 23:41 ` Nicolas Goaziou
  2015-04-07  7:51   ` John Hendy
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2015-04-06 23:41 UTC (permalink / raw)
  To: Daniel E. Doherty; +Cc: emacs-orgmode

Hello,

Daniel E. Doherty <ded-law@ddoherty.net> writes:

> I don't know when this started, but recently I've seen the following annoying
> behavior from M-RET in org files.
>
> Here is a minimal file to demonstrate what I'm seeing lately:
>
> ============================== demo.org ==============================
> * First Header
> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
> tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
> veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
> commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
> velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
> occaecat cupidatat non proident, sunt in culpa qui officia deserunt
> mollit anim id est laborum.
>
> * Second Header
> =======================================================================
>
> When the headings are completely folded, I see the following, as expected:
>
> ============================== demo.org ==============================
>  * First Header...
> ^* Second Header
> =======================================================================
>
> With my cursor on the ^, I hit M-RET to insert a new heading between "First
> Header" and "Second Header", and I get the following:
>
> =======================================================================
>
> When the headings are completely folded, I see the following, as expected:
>
> ============================== demo.org ==============================
>  * First Header...* ^
>  * Second Header
> =======================================================================

Fixed in edeb7fd8e17733cc516fbb6620a21092bac0d765. Thank you.

Regards,

-- 
Nicolas Goaziou

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

* Re: Inserted Heading Starts on Prior Heading's Fold Mark
  2015-04-06 23:41 ` Nicolas Goaziou
@ 2015-04-07  7:51   ` John Hendy
  0 siblings, 0 replies; 6+ messages in thread
From: John Hendy @ 2015-04-07  7:51 UTC (permalink / raw)
  To: Daniel E. Doherty, emacs-orgmode

On Mon, Apr 6, 2015 at 6:41 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>
> Fixed in edeb7fd8e17733cc516fbb6620a21092bac0d765. Thank you.
>

Awesome! Just confirmed that re-enabling =(setq
org-blank-before-new-entry nil)= now works perfectly for me.

Thanks,
John

> Regards,
>
> --
> Nicolas Goaziou
>

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

end of thread, other threads:[~2015-04-07  7:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-06 17:05 Inserted Heading Starts on Prior Heading's Fold Mark Daniel E. Doherty
2015-04-06 18:12 ` John Hendy
2015-04-06 20:16   ` Daniel E. Doherty
2015-04-06 21:26     ` John Hendy
2015-04-06 23:41 ` Nicolas Goaziou
2015-04-07  7:51   ` John Hendy

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