From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-element-at-point and special blocks Date: Thu, 10 Dec 2015 07:34:55 +0100 Message-ID: <87zixiolps.fsf@nicolasgoaziou.fr> References: <87y4d3jy6t.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6umo-0004NH-MJ for emacs-orgmode@gnu.org; Thu, 10 Dec 2015 01:33:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6umn-0007jC-OL for emacs-orgmode@gnu.org; Thu, 10 Dec 2015 01:33:06 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:35136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6umn-0007iv-II for emacs-orgmode@gnu.org; Thu, 10 Dec 2015 01:33:05 -0500 In-Reply-To: <87y4d3jy6t.fsf@gmx.us> (rasmus@gmx.us's message of "Wed, 09 Dec 2015 19:04:26 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: emacs-orgmode@gnu.org Hello, Rasmus writes: > Is there a reason why org-element-at-point reports the type to be a > paragraph for special blocks? E.g. in the examples at the bottom of this > mail, where | is the cursor, the types are: export-block, src-block and > paragraph with a nested special block. This is a corner-case. `org-element-at-point' returns the closest element at point, but prefers to see an empty paragraph than a special block, for consistency. I.e., when point is within block boundaries, you never return `special-block'. > Is there a neat way to detect if point is inside a block? I=E2=80=99m tr= ying to > write a function for structures (e.g. #+begin_latex) that works like > org-babel-demarcate-block. (org-element-lineage (org-element-at-point) '(special-block) t) Regards, --=20 Nicolas Goaziou