From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Strangely recognized non-lists and non-headers. Date: Sun, 02 Feb 2020 15:13:45 +0100 Message-ID: <87pnex9iw6.fsf@nicolasgoaziou.fr> References: <874kw9ci8u.fsf@nicolasgoaziou.fr> <35f99875-01df-22a7-4dee-6fe44b296858@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58447) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyG0c-0005jL-7I for emacs-orgmode@gnu.org; Sun, 02 Feb 2020 09:13:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyG0b-0000Gh-9c for emacs-orgmode@gnu.org; Sun, 02 Feb 2020 09:13:58 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:52077) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iyG0b-0000Fm-3v for emacs-orgmode@gnu.org; Sun, 02 Feb 2020 09:13:57 -0500 In-Reply-To: <35f99875-01df-22a7-4dee-6fe44b296858@posteo.net> (D.'s message of "Sun, 2 Feb 2020 14:33:47 +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-mx.org@gnu.org Sender: "Emacs-orgmode" To: D Cc: emacs-orgmode@gnu.org D writes: > On 02.02.20 12:59, Nicolas Goaziou wrote: >> Long story short. Don't use this function, it is not correctly >> implemented at the moment. The correct way to check if you're in a list >> is something like: >> >> (org-element-lineage (org-element-at-point) '(plain-list) t) > > I tried that out, but it still seems to recognize source code as > headlines, replacing the predicate does not change the behavior. Of course. You cannot have headlines within a source block. You need to escape them with commas. I'm just pointing out that the code above is the right way to check if you're in a list.