org-element: Change return value for element at point in some corner cases
commit13e49a63853b95e6033e3e3230dda0b824bc350a
authorNicolas Goaziou <n.goaziou@gmail.com>
Sat, 19 Jan 2013 14:29:39 +0000 (19 15:29 +0100)
committerNicolas Goaziou <n.goaziou@gmail.com>
Sat, 19 Jan 2013 22:34:59 +0000 (19 23:34 +0100)
treeaa0833bebb534f3e18959b90f83cbbfd940a0e93
parentc300a50402c0225a033214729e2a0f5c4013bdb5
org-element: Change return value for element at point in some corner cases

* lisp/org-element.el (org-element-at-point): When point is before any
  element, in the first blank lines of the buffer, return nil.  When
  point is within blank lines just after a headline, return that
  headline.
(org-element-context): Return nil when point is within the blank at
the beginning of the buffer.
* testing/lisp/test-org-element.el: Add tests.
lisp/org-element.el
testing/lisp/test-org-element.el