Bug fix for plain lists starting in first line of a buffer.

This commit is contained in:
Carsten Dominik 2008-07-14 11:23:57 -07:00
parent 989b2b6865
commit 523f8986e7
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2008-07-14 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-renumber-ordered-list, org-beginning-of-item-list):
Cater for the case of a list starting in the first line of the
buffer.
2008-07-09 Carsten Dominik <dominik@science.uva.nl> 2008-07-09 Carsten Dominik <dominik@science.uva.nl>
* org-publish.el (org-publish-find-title): Bug fix. * org-publish.el (org-publish-find-title): Bug fix.

View File

@ -6034,9 +6034,10 @@ with something like \"1.\" or \"2)\"."
(buffer-substring (point-at-bol) (match-beginning 3)))) (buffer-substring (point-at-bol) (match-beginning 3))))
;; (term (substring (match-string 3) -1)) ;; (term (substring (match-string 3) -1))
ind1 (n (1- arg)) ind1 (n (1- arg))
fmt) fmt bob)
;; find where this list begins ;; find where this list begins
(org-beginning-of-item-list) (org-beginning-of-item-list)
(setq bobp (bobp))
(looking-at "[ \t]*[0-9]+\\([.)]\\)") (looking-at "[ \t]*[0-9]+\\([.)]\\)")
(setq fmt (concat "%d" (match-string 1))) (setq fmt (concat "%d" (match-string 1)))
(beginning-of-line 0) (beginning-of-line 0)
@ -6044,7 +6045,7 @@ with something like \"1.\" or \"2)\"."
(catch 'exit (catch 'exit
(while t (while t
(catch 'next (catch 'next
(beginning-of-line 2) (if bobp (setq bobp nil) (beginning-of-line 2))
(if (eobp) (throw 'exit nil)) (if (eobp) (throw 'exit nil))
(if (looking-at "[ \t]*$") (throw 'next nil)) (if (looking-at "[ \t]*$") (throw 'next nil))
(skip-chars-forward " \t") (setq ind1 (current-column)) (skip-chars-forward " \t") (setq ind1 (current-column))
@ -6110,7 +6111,8 @@ I.e. to the first item in this list."
(if (or (< ind1 ind) (if (or (< ind1 ind)
(and (= ind1 ind) (and (= ind1 ind)
(not (org-at-item-p))) (not (org-at-item-p)))
(bobp)) (and (= (point-at-bol) (point-min))
(setq pos (point-min))))
(throw 'exit t) (throw 'exit t)
(when (org-at-item-p) (setq pos (point-at-bol))))))) (when (org-at-item-p) (setq pos (point-at-bol)))))))
(goto-char pos))) (goto-char pos)))