Browse Source

Fix list end with non-empty blank lines. Fix sorting.

* org-list.el (org-list-bottom-point-with-indent): do not check
  indentation of a non-empty blank line.
* org-list.el (org-sort-list): sort a list with point anywhere inside
  it.
Nicolas Goaziou 8 years ago
parent
commit
0778fb8748
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/org-list.el

+ 2 - 1
lisp/org-list.el

@@ -500,8 +500,8 @@ List ending is determined by the indentation of text. See
       (org-list-maybe-skip-block #'re-search-forward limit)
       (beginning-of-line)
       (catch 'exit
-	(skip-chars-forward " \t")
 	(while t
+	  (skip-chars-forward " \t")
 	  (let ((ind (org-get-indentation)))
 	    (cond
 	     ((or (>= (point) limit)
@@ -1965,6 +1965,7 @@ compare entries."
     (message "Sorting items...")
     (save-restriction
       (narrow-to-region start end)
+      (goto-char (point-min))
       (let* ((dcst (downcase sorting-type))
 	     (case-fold-search nil)
 	     (now (current-time))