diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index febd82ec7..21d823b96 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -1398,7 +1398,7 @@ the alist of previous items." ;; At an item: insert appropriate tags in export buffer. ((assq pos struct) (string-match (concat "[ \t]*\\(\\S-+[ \t]*\\)" - "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[a-zA-Z]\\)\\]\\)?" + "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[a-zA-Z]\\)\\][ \t]*\\)?" "\\(?:\\(\\[[ X-]\\]\\)[ \t]+\\)?" "\\(?:\\(.*\\)[ \t]+::\\(?:[ \t]+\\|$\\)\\)?" "\\(.*\\)") diff --git a/lisp/org-html.el b/lisp/org-html.el index 424e658e6..6e3bc1939 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -2531,7 +2531,7 @@ the alist of previous items." ((assq pos struct) (string-match (concat "[ \t]*\\(\\S-+[ \t]*\\)" - "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\]\\)?" + "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ \t]*\\)?" "\\(?:\\(\\[[ X-]\\]\\)[ \t]+\\)?" "\\(?:\\(.*\\)[ \t]+::\\(?:[ \t]+\\|$\\)\\)?" "\\(.*\\)") line) diff --git a/lisp/org-list.el b/lisp/org-list.el index 3f65db6a3..f4c091912 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -370,8 +370,8 @@ specifically, type `block' is determined by the variable It depends on `org-empty-line-terminates-plain-lists'.") (defconst org-list-full-item-re - (concat "^[ \t]*\\(\\(?:[-+*]\\|\\(?:[0-9]+\\|[A-Za-z]\\)[.)]\\)[ \t]*\\)" - "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\]\\)?" + (concat "^[ \t]*\\(\\(?:[-+*]\\|\\(?:[0-9]+\\|[A-Za-z]\\)[.)]\\)[ \t]+\\)" + "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ \t]*\\)?" "\\(?:\\(\\[[ X-]\\]\\)[ \t]+\\)?" "\\(?:\\(.*\\)[ \t]+::\\(?:[ \t]+\\|$\\)\\)?") "Matches a list item and puts everything into groups: @@ -1647,11 +1647,13 @@ Initial position of cursor is restored after the changes." ((and (match-string 3) new-box) (replace-match new-box nil nil nil 3)) ((match-string 3) - (goto-char (or (match-end 2) (match-end 1))) - (looking-at "\\[[ X-]\\][ \t]+") - (replace-match "")) - (t (goto-char (or (match-end 2) (match-end 1))) - (insert (concat new-box " ")))) + ;; (goto-char (or (match-end 2) (match-end 1))) + ;; (skip-chars-backward " \t") + (looking-at ".*?\\([ \t]*\\[[ X-]\\]\\)") + (replace-match "" nil nil nil 1)) + (t (let ((counterp (match-end 2))) + (goto-char (if counterp (1+ counterp) (match-end 1))) + (insert (concat new-box (unless counterp " ")))))) ;; c. Indent item to appropriate column. (unless (= new-ind old-ind) (delete-region (goto-char (point-at-bol))