Quellcode durchsuchen

Export: Allow #+label, #+caption, and #_attr_... to be indented.

Carsten Dominik vor 16 Jahren
Ursprung
Commit
0c49456103
2 geänderte Dateien mit 9 neuen und 3 gelöschten Zeilen
  1. 3 3
      lisp/org-exp.el
  2. 6 0
      lisp/org.el

+ 3 - 3
lisp/org-exp.el

@@ -1708,11 +1708,11 @@ table line.  If it is a link, add it to the line containing the link."
   (remove-text-properties (point-min) (point-max)
 			  '(org-caption nil org-attributes nil))
   (let ((case-fold-search t)
-	(re (concat "^#\\+caption:[ \t]+\\(.*\\)"
+	(re (concat "^[ \t]*#\\+caption:[ \t]+\\(.*\\)"
 		    "\\|"
-		    "^#\\+attr_" (symbol-name backend) ":[ \t]+\\(.*\\)"
+		    "^[ \t]*#\\+attr_" (symbol-name backend) ":[ \t]+\\(.*\\)"
 		    "\\|"
-		    "^#\\+label:[ \t]+\\(.*\\)"
+		    "^[ \t]*#\\+label:[ \t]+\\(.*\\)"
 		    "\\|"
 		    "^[ \t]*|[^-]"
 		    "\\|"

+ 6 - 0
lisp/org.el

@@ -4245,6 +4245,12 @@ will be prompted for."
 	     beg (match-end 0)
 	     '(font-lock-fontified t face org-meta-line))
 	    t)
+	   ((or (member dc1 '("caption:" "label:"))
+		(and (match-end 4) (equal dc3 "attr")))
+	    (add-text-properties
+	     beg (match-end 0)
+	     '(font-lock-fontified t face org-meta-line))
+	    t)
 	   (t nil))))))
 
 (defun org-activate-angle-links (limit)