Browse Source

[@num] is valid to enforce a numbering (same as [@start:num])

Nicolas Goaziou 10 years ago
parent
commit
6b2468477e
6 changed files with 11 additions and 10 deletions
  1. 2 1
      lisp/org-ascii.el
  2. 1 1
      lisp/org-docbook.el
  3. 1 1
      lisp/org-html.el
  4. 1 1
      lisp/org-latex.el
  5. 5 5
      lisp/org-list.el
  6. 1 1
      lisp/org.el

+ 2 - 1
lisp/org-ascii.el

@@ -571,7 +571,8 @@ publishing directory."
       (replace-match "\\1\\2")))
   ;; Remove list start counters
   (goto-char (point-min))
-  (while (org-search-forward-unenclosed  "\\[@start:[0-9]+\\][ \t]*" nil t)
+  (while (org-search-forward-unenclosed
+	  "\\[@\\(?:start:\\)?[0-9]+\\][ \t]*" nil t)
     (replace-match ""))
   (remove-text-properties
    (point-min) (point-max)

+ 1 - 1
lisp/org-docbook.el

@@ -1024,7 +1024,7 @@ publishing directory."
 		    line (substring line (match-beginning 5))
 		    item-tag nil
 		    item-number nil)
-	      (if (string-match "\\`\\[@start:\\([0-9]+\\)\\][ \t]?" line)
+	      (if (string-match "\\[@\\(?:start:\\)?\\([0-9]+\\)\\][ \t]?" line)
 		  (setq item-number (match-string 1 line)
 			line (replace-match "" t t line)))
 	      (if (and starter (string-match "\\(.*?\\) ::[ \t]*" line))

+ 1 - 1
lisp/org-html.el

@@ -1548,7 +1548,7 @@ lang=\"%s\" xml:lang=\"%s\">
 		    line (substring line (match-beginning 5))
 		    item-number nil
 		    item-tag nil)
-	      (if (string-match "\\`\\[@start:\\([0-9]+\\)\\][ \t]?" line)
+	      (if (string-match "\\[@\\(?:start:\\)?\\([0-9]+\\)\\][ \t]?" line)
 		  (setq item-number (match-string 1 line)
 			line (replace-match "" t t line)))
 	      (if (and starter (string-match "\\(.*?\\) ::[ \t]*" line))

+ 1 - 1
lisp/org-latex.el

@@ -2242,7 +2242,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
       (beginning-of-line)
       (setq res (org-list-to-latex (org-list-parse-list t)
 				   org-export-latex-list-parameters))
-      (while (string-match "^\\(\\\\item[ \t]+\\)\\[@start:\\([0-9]+\\)\\]"
+      (while (string-match "^\\(\\\\item[ \t]+\\)\\[@\\(?:start:\\)?\\([0-9]+\\)\\]"
 			   res)
 	(setq res (replace-match
 		   (concat (format "\\setcounter{enumi}{%d}"

+ 5 - 5
lisp/org-list.el

@@ -486,7 +486,7 @@ List ending is determined by the indentation of text. See
        (save-excursion
 	 (goto-char (match-end 0))
          ;; Ignore counter if any
-         (when (looking-at "\\(?:\\[@start:[0-9]+\\][ \t]*\\)?")
+         (when (looking-at "\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?")
            (goto-char (match-end 0)))
 	 (looking-at regexp))))
 
@@ -686,7 +686,7 @@ A checkbox is blocked if all of the following conditions are fulfilled:
 	    (error (throw 'exit nil)))
 	  (unless (org-entry-get nil "ORDERED") (throw 'exit nil))
 	  (when (org-search-forward-unenclosed
-                 "^[ \t]*[-+*0-9.)]+[ \t]+\\(\\[@start:[0-9]+\\][ \t]*\\)?\\[[- ]\\]" end t)
+                 "^[ \t]*[-+*0-9.)]+[ \t]+\\(\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[[- ]\\]" end t)
 	    (org-current-line)))))))
 
 ;;; Navigate
@@ -912,7 +912,7 @@ bullet string and bullet counter, if any."
             (match-string 1))
           (progn
             (goto-char (match-end 0))
-            (and (looking-at "\\[@start:\\([0-9]+\\)\\]")
+            (and (looking-at "\\[@\\(?:start:\\)?\\([0-9]+\\)\\]")
                  (match-string 1))))))
 
 (defun org-list-struct (begin end &optional outdent)
@@ -1506,7 +1506,7 @@ in subtree."
                        (org-at-item-p))
                   (goto-char (match-end 0))
                   ;; Ignore counter, if any
-                  (when (looking-at "\\(?:\\[@start:[0-9]+\\][ \t]*\\)?")
+                  (when (looking-at "\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?")
                     (goto-char (match-end 0)))
                   (let ((desc-p (and (org-at-item-description-p)
                                      (cdr (assq 'checkbox org-list-automatic-rules)))))
@@ -1820,7 +1820,7 @@ sublevels as a list of strings."
 					       (org-end-of-item-or-at-child))))
 	     (nextindent (if (= (point) end) 0 (org-get-indentation)))
 	     (item (if (string-match
-			"^\\(?:\\[@start:[0-9]+\\][ \t]*\\)?\\[\\([xX ]\\)\\]"
+			"^\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\([xX ]\\)\\]"
 			item)
 		       (replace-match (if (equal (match-string 1 item) " ")
 					  "CBOFF"

+ 1 - 1
lisp/org.el

@@ -5457,7 +5457,7 @@ needs to be inserted at a specific position in the font-lock sequence.")
                    '(org-do-emphasis-faces (0 nil append))
                  '(org-do-emphasis-faces)))
 	   ;; Checkboxes
-	   '("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@start:[0-9]+\\][ \t]*\\)?\\(\\[[- X]\\]\\)"
+	   '("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- X]\\]\\)"
 	     1 'org-checkbox prepend)
 	   (if (cdr (assq 'checkbox org-list-automatic-rules))
 	       '("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"