0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-20 08:26:29 +00:00
Regular expression needed an anchor.
This commit is contained in:
Carsten Dominik 2008-04-13 22:47:08 +02:00
parent 80a93d5d1b
commit c18f4c2124

View file

@ -1127,8 +1127,8 @@ on this string to produce the exported version."
(exp-drawers (plist-get parameters :drawers)) (exp-drawers (plist-get parameters :drawers))
(outline-regexp "\\*+ ") (outline-regexp "\\*+ ")
target-alist tmp target level target-alist tmp target level
a b xx a b xx rtn p)
rtn p)
(with-current-buffer (get-buffer-create " org-mode-tmp") (with-current-buffer (get-buffer-create " org-mode-tmp")
(erase-buffer) (erase-buffer)
(insert string) (insert string)
@ -1181,16 +1181,17 @@ on this string to produce the exported version."
;; Find all headings and compute the targets for them ;; Find all headings and compute the targets for them
(goto-char (point-min)) (goto-char (point-min))
(org-init-section-numbers) (org-init-section-numbers)
(while (re-search-forward org-outline-regexp nil t) (let ((re (concat "^" org-outline-regexp)))
(setq level (org-reduced-level (while (re-search-forward re nil t)
(save-excursion (goto-char (point-at-bol)) (setq level (org-reduced-level
(org-outline-level)))) (save-excursion (goto-char (point-at-bol))
(setq target (org-solidify-link-text (org-outline-level))))
(format "sec-%s" (org-section-number level)))) (setq target (org-solidify-link-text
(push (cons target target) target-alist) (format "sec-%s" (org-section-number level))))
(add-text-properties (push (cons target target) target-alist)
(point-at-bol) (point-at-eol) (add-text-properties
(list 'target target))) (point-at-bol) (point-at-eol)
(list 'target target))))
;; Find targets in comments and move them out of comments, ;; Find targets in comments and move them out of comments,
;; but mark them as targets that should be invisible ;; but mark them as targets that should be invisible