Browse Source

org-list: fix insertion of item with indent-tabs-mode is non-nil

* lisp/org-list.el (org-list-insert-item): when computing size of item
  being inserted, function has to take into account that indentation
  may not only be made of spaces.
Nicolas Goaziou 14 years ago
parent
commit
7b211c86e7
1 changed files with 4 additions and 1 deletions
  1. 4 1
      lisp/org-list.el

+ 4 - 1
lisp/org-list.el

@@ -1172,7 +1172,10 @@ This function modifies STRUCT."
 	   ;;    BEFOREP and SPLIT-LINE-P. The difference of size
 	   ;;    BEFOREP and SPLIT-LINE-P. The difference of size
 	   ;;    between what was cut and what was inserted in buffer
 	   ;;    between what was cut and what was inserted in buffer
 	   ;;    is stored in SIZE-OFFSET.
 	   ;;    is stored in SIZE-OFFSET.
-	   (ind (org-list-get-ind item struct))
+	   (ind (let ((ind-ref (org-list-get-ind item struct)))
+		  (if (not indent-tabs-mode)
+		      ind-ref
+		    (+ (/ ind-ref tab-width) (mod ind-ref tab-width)))))
 	   (bullet (org-list-bullet-string (org-list-get-bullet item struct)))
 	   (bullet (org-list-bullet-string (org-list-get-bullet item struct)))
 	   (box (when checkbox "[ ]"))
 	   (box (when checkbox "[ ]"))
 	   (text-cut
 	   (text-cut