From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Use org-element to figure out if I am in a drawer. Date: Tue, 26 Nov 2013 17:32:47 +0100 Message-ID: <87ob5786og.fsf@gmail.com> References: <8A4B2A62-55B2-4326-A6CB-C7C62528AA19@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlLZ1-0007ji-Op for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 11:32:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlLYr-0005mO-Qf for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 11:32:39 -0500 Received: from mail-ea0-x236.google.com ([2a00:1450:4013:c01::236]:47674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlLYr-0005mA-Jf for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 11:32:29 -0500 Received: by mail-ea0-f182.google.com with SMTP id o10so5144250eaj.41 for ; Tue, 26 Nov 2013 08:32:28 -0800 (PST) In-Reply-To: <8A4B2A62-55B2-4326-A6CB-C7C62528AA19@gmail.com> (Carsten Dominik's message of "Tue, 26 Nov 2013 16:24:34 +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: Carsten Dominik Cc: "emacs-orgmode@gnu.org List" Hello, Carsten Dominik writes: > Hmmm, > > what is the magic incantation to use org-element to figure out if > point is currently inside a drawer? Something like: (let ((element (org-element-at-point))) (while (and element (not (memq (org-element-type element) '(drawer property-drawer)))) (setq element (org-element-property :parent element))) element) which should return containing drawer or nil. Regards, -- Nicolas Goaziou