소스 검색

Little bug fix.

* org-list.el (org-list-struct-apply-struct): check if ancestor exists.
Nicolas Goaziou 15 년 전
부모
커밋
e8967901fa
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      lisp/org-list.el

+ 2 - 1
lisp/org-list.el

@@ -1006,13 +1006,14 @@ BEGIN is included and END excluded."
   "Apply modifications to list so it mirrors STRUCT.
   "Apply modifications to list so it mirrors STRUCT.
 Initial position is restored after the changes."
 Initial position is restored after the changes."
   (let* ((pos (copy-marker (point)))
   (let* ((pos (copy-marker (point)))
+	 (ancestor (caar struct))
          (modify
          (modify
           (lambda (item)
           (lambda (item)
             (goto-char (car item))
             (goto-char (car item))
 	    (org-list-indent-item (nth 1 item))
 	    (org-list-indent-item (nth 1 item))
 	    (org-list-replace-bullet (org-list-bullet-string (nth 2 item)))))
 	    (org-list-replace-bullet (org-list-bullet-string (nth 2 item)))))
 	 ;; Remove ancestor if it is left.
 	 ;; Remove ancestor if it is left.
-	 (struct-to-apply (if (= 0 (caar struct)) (cdr struct) struct)))
+	 (struct-to-apply (if (or (not ancestor) (= 0 ancestor)) (cdr struct) struct)))
     ;; Apply changes from bottom to top
     ;; Apply changes from bottom to top
     (mapc modify (nreverse struct-to-apply))
     (mapc modify (nreverse struct-to-apply))
     (goto-char pos)))
     (goto-char pos)))