Browse Source

List ending is now customizable.

* org-list.el (org-list-end-regexp): New customizable variable to
  define what string should end lists.
* org-list.el (org-list-end-re): Function is now aware of
  `org-list-end-regexp'.
Nicolas Goaziou 15 years ago
parent
commit
37733b77a4
1 changed files with 11 additions and 3 deletions
  1. 11 3
      lisp/org-list.el

+ 11 - 3
lisp/org-list.el

@@ -151,11 +151,19 @@ spaces instead of one after the bullet in each item of he list."
 
 (defcustom org-empty-line-terminates-plain-lists nil
   "Non-nil means an empty line ends all plain list levels.
-Otherwise it will take two blank lines to end them."
+Otherwise, look for `org-list-end-regexp'."
 
   :group 'org-plain-lists
   :type 'boolean)
 
+(defcustom org-list-end-regexp "^[ \t]*\n\\([ \t]*\n\\)+"
+  "Regexp matching the end of all plain list levels.
+It must start with \"^\" and end with \"\\n\". It defaults to 2
+or more blank lines. `org-empty-line-terminates-plain-lists' has
+precedence over it."
+  :group 'org-plain-lists
+  :type 'string)
+
 (defcustom org-auto-renumber-ordered-lists t
   "Non-nil means automatically renumber ordered plain lists.
 Renumbering happens when the sequence have been changed with
@@ -220,8 +228,8 @@ list, obtained by prompting the user."
   "Return the regex corresponding to the end of a list.
 It depends on `org-empty-line-terminates-plain-lists'."
   (if org-empty-line-terminates-plain-lists
-      "^\\([ \t]*\n\\)+"
-    "^[ \t]*\n\\([ \t]*\n\\)+"))
+      "^[ \t]*\n"
+    org-list-end-regexp))
 
 (defun org-item-re (&optional general)
   "Return the correct regular expression for plain lists.