Browse Source

Implement list starter cookies also in Org-mode, and for ASCII export

Carsten Dominik 15 years ago
parent
commit
3fb4f28860
3 changed files with 16 additions and 1 deletions
  1. 6 0
      lisp/ChangeLog
  2. 6 1
      lisp/org-ascii.el
  3. 4 0
      lisp/org-list.el

+ 6 - 0
lisp/ChangeLog

@@ -1,5 +1,11 @@
 2010-04-26  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-ascii.el (org-export-ascii-preprocess): Remove list
+	startcounter cookies.
+
+	* org-list.el (org-renumber-ordered-list): Respect counter
+	start values.
+
 	* org-latex.el (org-export-latex-lists): Accept ordered list
 	item offset cookie.
 

+ 6 - 1
lisp/org-ascii.el

@@ -565,7 +565,12 @@ publishing directory."
   (goto-char (point-min))
   (while (re-search-forward  "<<<?\\([^<>]*\\)>>>?\\([ \t]*\\)" nil t)
     (org-if-unprotected-at (match-beginning 1)
-      (replace-match "\\1\\2"))))
+      (replace-match "\\1\\2")))
+  ;; Remove list start counters
+  (goto-char (point-min))
+  (while (re-search-forward  "\\[@start:[0-9]+\\] ?" nil t)
+    (org-if-unprotected
+     (replace-match ""))))
 
 (defun org-html-expand-for-ascii (line)
   "Handle quoted HTML for ASCII export."

+ 4 - 0
lisp/org-list.el

@@ -841,6 +841,10 @@ with something like \"1.\" or \"2)\"."
     (setq bobp (bobp))
     (looking-at "[ \t]*[0-9]+\\([.)]\\)")
     (setq fmt (concat "%d" (or (match-string 1) ".")))
+    (save-excursion
+      (goto-char (match-end 0))
+      (if (looking-at "[ \t]*\\[@start:\\([0-9]+\\)")
+	  (setq n (1- (string-to-number (match-string 1))))))
     (beginning-of-line 0)
     ;; walk forward and replace these numbers
     (catch 'exit