Browse Source

Move org-get-string-indentation out of org-list.el

* lisp/org.el (org-get-string-indentation): moved in generally useful
  functions section, as it wasn't specific to plain lists and that no
  code was using it in org-list.el.
Nicolas Goaziou 14 years ago
parent
commit
6c81e8cc05
2 changed files with 11 additions and 11 deletions
  1. 0 11
      lisp/org-list.el
  2. 11 0
      lisp/org.el

+ 0 - 11
lisp/org-list.el

@@ -1817,17 +1817,6 @@ Initial position of cursor is restored after the changes."
 
 ;;; Indentation
 
-(defun org-get-string-indentation (s)
-  "What indentation has S due to SPACE and TAB at the beginning of the string?"
-  (let ((n -1) (i 0) (w tab-width) c)
-    (catch 'exit
-      (while (< (setq n (1+ n)) (length s))
-	(setq c (aref s n))
-	(cond ((= c ?\ ) (setq i (1+ i)))
-	      ((= c ?\t) (setq i (* (/ (+ w i) w) w)))
-	      (t (throw 'exit t)))))
-    i))
-
 (defun org-outdent-item ()
   "Outdent a local list item, but not its children.
 If a region is active, all items inside will be moved."

+ 11 - 0
lisp/org.el

@@ -18191,6 +18191,17 @@ When LINE is given, assume it represents a line and compute its indentation."
       (skip-chars-forward " \t")
       (current-column))))
 
+(defun org-get-string-indentation (s)
+  "What indentation has S due to SPACE and TAB at the beginning of the string?"
+  (let ((n -1) (i 0) (w tab-width) c)
+    (catch 'exit
+      (while (< (setq n (1+ n)) (length s))
+	(setq c (aref s n))
+	(cond ((= c ?\ ) (setq i (1+ i)))
+	      ((= c ?\t) (setq i (* (/ (+ w i) w) w)))
+	      (t (throw 'exit t)))))
+    i))
+
 (defun org-remove-tabs (s &optional width)
   "Replace tabulators in S with spaces.
 Assumes that s is a single line, starting in column 0."