浏览代码

All indented lines starting with "#+" to be comments

Carsten Dominik 15 年之前
父节点
当前提交
6867751efe
共有 3 个文件被更改,包括 10 次插入2 次删除
  1. 2 1
      doc/org.texi
  2. 3 0
      lisp/ChangeLog
  3. 5 1
      lisp/org.el

+ 2 - 1
doc/org.texi

@@ -8471,7 +8471,8 @@ exported as a horizontal line (@samp{<hr/>} in HTML).
 @cindex #+BEGIN_COMMENT
 
 Lines starting with @samp{#} in column zero are treated as comments and will
-never be exported.  Also entire subtrees starting with the word
+never be exported. If you want an indented line to be treated as a comment,
+start it with @samp{#+ }.  Also entire subtrees starting with the word
 @samp{COMMENT} will never be exported.  Finally, regions surrounded by
 @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
 

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-09-24  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-fontify-meta-lines-and-blocks): Treat lines with a
+	space after #+ as comments.
+
 	* org-latex.el (org-export-latex-emph-format): Use better commands
 	to insert special characters in verbatim snippets.
 

+ 5 - 1
lisp/org.el

@@ -4334,7 +4334,7 @@ will be prompted for."
   "Fontify #+ lines and blocks, in the correct ways."
   (let ((case-fold-search t))
     (if (re-search-forward
-	 "^\\([ \t]*#\\+\\(\\([a-zA-Z]+:?\\)\\(_\\([a-zA-Z]+\\)\\)?\\)\\(.*\\)\\)"
+	 "^\\([ \t]*#\\+\\(\\([a-zA-Z]+:?\\| \\|$\\)\\(_\\([a-zA-Z]+\\)\\)?\\)\\(.*\\)\\)"
 	 limit t)
 	(let ((beg (match-beginning 0))
 	      (beg1 (line-beginning-position 2))
@@ -4384,6 +4384,10 @@ will be prompted for."
 	     beg (match-end 0)
 	     '(font-lock-fontified t face org-meta-line))
 	    t)
+	   ((member dc3 '(" " ""))
+	    (add-text-properties
+	     beg (match-end 0)
+	     '(font-lock-fontified t face font-lock-comment-face)))
 	   (t nil))))))
 
 (defun org-activate-angle-links (limit)