From mboxrd@z Thu Jan 1 00:00:00 1970 From: D Subject: Strangely recognized non-lists and non-headers. Date: Sun, 2 Feb 2020 11:11:02 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:43104) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyCDc-0000wn-Jy for emacs-orgmode@gnu.org; Sun, 02 Feb 2020 05:11:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyCDb-0005RB-Ap for emacs-orgmode@gnu.org; Sun, 02 Feb 2020 05:11:08 -0500 Received: from mout02.posteo.de ([185.67.36.66]:34799) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iyCDa-0005O8-Ry for emacs-orgmode@gnu.org; Sun, 02 Feb 2020 05:11:07 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 30ED22400FB for ; Sun, 2 Feb 2020 11:11:04 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 489RYg5MFwz9rxb for ; Sun, 2 Feb 2020 11:11:03 +0100 (CET) Content-Language: en-US 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: emacs-orgmode@gnu.org Hi all, while debugging org-superstar-mode I noticed something very strange, and I am not sure if it's a bug in org or a bug in my understanding of org. First off, an MWE for Org mode version 9.1.9 (release_9.1.9-65-g5e4542): #+BEGIN_SRC C /* * This is a header? + this + is * a list? */ #+END_SRC This works. I can promote, demote, fold, etc. org-superstar also has no issue with accepting these. I should add, this is the default config (emacs -Q on Emacs 26.3). So no spooky stuff I believe on that end. So I began digging. I use org-list-in-valid-context-p as a quick hack to check if what I am looking at is actually a list. Said predicate is a simple wrapper around the function org-in-block-p being called with org-list-forbidden-blocks. It is the the list of environments where lists are not allowed. Value: ("example" "verse" "src" "export") There is also a very similar variable: org-protecting-blocks. This one marks environments as quoted, disallowing org syntax. Value: ("src" "example" "export") Currently these two variables don't know of one another. Maybe the latter should be a strict subset of the former? Anyway, from what I have found org-in-block-p seems to not recognize src blocks reliably. I wrote a small function to test this: (defun nag () (interactive) (when (org-list-in-valid-context-p) (warn "You can make a list here! :("))) And it seems, yes, you can make a list in a src block. That's all very peculiar, what do you guys think?