Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Sure it does, <!-- ... -->. This is also what Emacs will automatically use if you add-file-local-variable in a Markdown file, so I don't know why you're using that weird format.

I was thinking of native comment syntax in Markdown, which is absent. But you are right, HTML comments, like anything else HTML work fine in Markdown. So you have a valid point.

> There's a stronger argument to made that org-mode doesn't really have comments. As far as I can tell syntax-ppss never gives me non-nil for them.

Hmm, I had never checked that. That's good to know. M-x comment-dwim works though. This might be good to report as Emacs bug.

> Sure, a line like "# foo" appears in a comment face,

That's a proper comment as per Org spec. Those lines are completely ignored by Org, for any parsing or for any exporting business.

> but so does a line like "#+ASDF:" or "#+BEGIN_SRC" (but not a line like "#+TITLE:").

Because those are not comments. It's not an official term but I think of those as pseudo-comments. The "#+.." lines while looking like comments have a special meaning to Org. The meaning of those can also be exporter backend dependent.

> So whether something is a "comment" depends on its contents, which means it's syntax, never really a comment.

Yes only for #+ comments.



`#+...` is called "affiliated keyword" in the spec[1]. Those are distinct from comments, which are required to have a whitespace character after the hash sign[2].

[1]: http://orgmode.org/worg/dev/org-syntax.html#Affiliated_keywo...

[2]: http://orgmode.org/worg/dev/org-syntax.html#Comments


> M-x comment-dwim works though.

This is because org overrides massive amounts of Emacs default functions - in this case, in org-setup-comments-handling. org-mode doesn't really use syntax tables normally. Similar problems occur with strings. They are known issues, and unlikely to be fixed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: