Ver Fonte

Lists: No automatic empty lines if empty lines terminate the list

When inserting new list entries, sometime empty lines will be
inserted automatically.  This, however, makes only sense if empty
lines do not terminate the list, as configured by
`org-empty-line-terminates-plain-lists'.

This commit makes sure that, if
`org-empty-line-terminates-plain-lists' is set, automatic empty lines
will never be inserted.
Carsten Dominik há 16 anos atrás
pai
commit
06c40a9ad7
3 ficheiros alterados com 12 adições e 2 exclusões
  1. 6 0
      lisp/ChangeLog
  2. 3 1
      lisp/org-list.el
  3. 3 1
      lisp/org.el

+ 6 - 0
lisp/ChangeLog

@@ -1,5 +1,11 @@
 2009-02-26  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-list.el (org-insert-item): Only consider insert empty lines
+	is `org-empty-line-terminates-plain-lists' is not nil.
+
+	* org.el (org-blank-before-new-entry): Mention the dependence on
+	`org-empty-line-terminates-plain-lists' in the docstring.
+
 	* org-publish.el (org-publish-get-project-from-filename): New
 	optional argument UP.  Only find the top project if UP is set.
 	(org-publish-current-project): Find the top encloding project.

+ 3 - 1
lisp/org-list.el

@@ -209,7 +209,9 @@ Return t when things worked, nil when we are not in an item."
 					descp))))
 	   (eow (save-excursion (beginning-of-line 1) (looking-at "[ \t]*")
 				(match-end 0)))
-	   (blank-a (cdr (assq 'plain-list-item org-blank-before-new-entry)))
+	   (blank-a (if org-empty-line-terminates-plain-lists
+			nil
+		      (cdr (assq 'plain-list-item org-blank-before-new-entry))))
 	   (blank (if (eq blank-a 'auto) empty-line-p blank-a))
 	   pos)
       (if descp (setq checkbox nil))

+ 3 - 1
lisp/org.el

@@ -752,7 +752,9 @@ for the duration of the command."
 					(plain-list-item . auto))
   "Should `org-insert-heading' leave a blank line before new heading/item?
 The value is an alist, with `heading' and `plain-list-item' as car,
-and a boolean flag as cdr."
+and a boolean flag as cdr.  For plain lists, if the variable
+`org-empty-line-terminates-plain-lists' is set, the setting here
+is ignored and no empty line is inserted, to keep the list in tact."
   :group 'org-edit-structure
   :type '(list
 	  (cons (const heading)