Browse Source

Added variable to configure where lists should be interpreted

* lisp/org-list.el (org-list-forbidden-blocks): variable renamed from
  org-list-blocks.
(org-list-export-context): new variable

* list/org-exp.el (org-export-mark-lists): use new variable.

* list/org-latex.el (org-export-latex-lists): use new variable
Nicolas Goaziou 14 years ago
parent
commit
b37761715e
3 changed files with 16 additions and 7 deletions
  1. 1 1
      lisp/org-exp.el
  2. 1 1
      lisp/org-latex.el
  3. 14 5
      lisp/org-list.el

+ 1 - 1
lisp/org-exp.el

@@ -1729,7 +1729,7 @@ These special properties will later be interpreted by the backend.
 	 (goto-char (point-min))
 	 (while (re-search-forward org-item-beginning-re nil t)
 	   (when (eq (nth 2 (org-list-context)) e) (funcall mark-list e))))
-       '(nil block)))))
+       (cons nil org-list-export-context)))))
 
 (defun org-export-attach-captions-and-attributes (backend target-alist)
   "Move #+CAPTION, #+ATTR_BACKEND, and #+LABEL text into text properties.

+ 1 - 1
lisp/org-latex.el

@@ -2499,7 +2499,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 	   (insert (org-add-props res nil 'original-indentation
 				  (org-find-text-property-in-string
 				   'original-indentation res)))))))
-   '(block nil)))
+   (append org-list-export-context '(nil))))
 
 (defconst org-latex-entities
  '("\\!"

+ 14 - 5
lisp/org-list.el

@@ -304,10 +304,18 @@ list, obtained by prompting the user."
 	  (list (symbol :tag "Major mode")
 		(string :tag "Format"))))
 
-;;; Internal functions
+(defvar org-list-forbidden-blocks '("example" "verse" "src")
+  "Names of blocks where lists are not allowed.
+Names must be in lower case.")
+
+(defvar org-list-export-context '(block inlinetask)
+  "Context types where lists will be interpreted during export.
 
-(defconst org-list-blocks '("EXAMPLE" "VERSE" "SRC")
-  "Names of blocks where lists are not allowed.")
+Valid types are `drawer', `inlinetask' and `block'. More
+specifically, type `block' is determined by the variable
+`org-list-forbidden-blocks'.")
+
+;;; Internal functions
 
 (defun org-list-end-re ()
   "Return the regex corresponding to the end of a list.
@@ -350,7 +358,7 @@ Context will be an alist like (MIN MAX CONTEXT) where MIN and MAX
 are boundaries and CONTEXT is a symbol among `drawer', `block',
 `invalid', `inlinetask' and nil.
 
-Contexts `block' and `invalid' refer to `org-list-blocks'."
+Contexts `block' and `invalid' refer to `org-list-forbidden-blocks'."
   (save-match-data
     (save-excursion
       (beginning-of-line)
@@ -409,7 +417,8 @@ Contexts `block' and `invalid' refer to `org-list-blocks'."
 		     (if (re-search-forward "^[ \t]*#\\+end_" next-head t)
 			 (1- (point-at-bol))
 		       next-head))
-		   (if (member (upcase (match-string 1)) org-list-blocks)
+		   (if (member (downcase (match-string 1))
+			       org-list-forbidden-blocks)
 		       'invalid
 		     'block)))))
 	     ;; Are we in an inlinetask?