diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2010-12-29 18:42:23 +0100 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-02-18 12:45:08 +0100 |
commit | 2adbcfffe1b61aa36bd3ba20b9eb269513c32995 (patch) | |
tree | 52b08c15a6ae6c4c3136de112656fd2429eacb4f | |
parent | 148deffd4e9573a4f6539ba04e0945f770739611 (diff) | |
download | org-mode-2adbcfffe1b61aa36bd3ba20b9eb269513c32995.tar.gz |
Remove uses of deprecated top-point and bottom-point functions
* lisp/org.el (org-skip-over-state-notes,org-store-log-note): use new
accessors.
* list/ob.el (org-babel-result-end): use new accessors.
* list/org-exp.el (org-export-mark-list-ending): use new accessors.
-rw-r--r-- | lisp/ob.el | 7 | ||||
-rw-r--r-- | lisp/org-exp.el | 3 | ||||
-rw-r--r-- | lisp/org.el | 36 |
3 files changed, 27 insertions, 19 deletions
@@ -76,7 +76,8 @@ (declare-function org-in-item-p "org-list" ()) (declare-function org-list-parse-list "org-list" (&optional delete)) (declare-function org-list-to-generic "org-list" (LIST PARAMS)) -(declare-function org-list-bottom-point "org-list" ()) +(declare-function org-list-struct "org-list" ()) +(declare-function org-list-get-bottom-point "org-list" (struct)) (defgroup org-babel nil "Code block evaluation and management in `org-mode' documents." @@ -1582,7 +1583,9 @@ code ---- the results are extracted in the syntax of the source (save-excursion (cond ((org-at-table-p) (progn (goto-char (org-table-end)) (point))) - ((org-at-item-p) (- (org-list-bottom-point) 1)) + ((org-at-item-p) (save-excursion + (org-beginning-of-item) + (1- (org-list-get-bottom-point (org-list-struct))))) (t (let ((case-fold-search t) (blocks-re (regexp-opt diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 0e525e1..6cc27d4 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1678,7 +1678,8 @@ These special cookies will later be interpreted by the backend. (lambda (end-list-marker) (goto-char (point-min)) (while (org-search-forward-unenclosed org-item-beginning-re nil t) - (goto-char (org-list-bottom-point)) + (beginning-of-line) + (goto-char (org-list-get-bottom-point (org-list-struct))) (when (and (not (eq org-list-ending-method 'indent)) (looking-at (org-list-end-re))) (replace-match "\n")) diff --git a/lisp/org.el b/lisp/org.el index 39eb60e..d11721d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11819,11 +11819,13 @@ EXTRA is additional text that will be inserted into the notes buffer." (defun org-skip-over-state-notes () "Skip past the list of State notes in an entry." (if (looking-at "\n[ \t]*- State") (forward-char 1)) - (when (org-in-item-p) - (let ((limit (org-list-bottom-point))) - (while (looking-at "[ \t]*- State") - (goto-char (or (org-get-next-item (point) limit) - (org-get-end-of-item limit))))))) + (let ((itemp (org-in-item-p))) + (when itemp + (let* ((struct (progn (goto-char itemp) (org-list-struct))) + (prevs (org-list-struct-prev-alist struct))) + (while (looking-at "[ \t]*- State") + (goto-char (or (org-list-get-next-item (point) struct prevs) + (org-list-get-item-end (point) struct)))))))) (defun org-add-log-note (&optional purpose) "Pop up a window for taking a note, and add this note later at point." @@ -11909,17 +11911,19 @@ EXTRA is additional text that will be inserted into the notes buffer." (end-of-line 1) (if (not (bolp)) (let ((inhibit-read-only t)) (insert "\n"))) (setq ind (save-excursion - (if (org-in-item-p) - (progn - (goto-char (org-list-top-point)) - (org-get-indentation)) - (skip-chars-backward " \r\t\n") - (cond - ((and (org-at-heading-p) - org-adapt-indentation) - (1+ (org-current-level))) - ((org-at-heading-p) 0) - (t (org-get-indentation)))))) + (let ((itemp (org-in-item-p))) + (if itemp + (progn + (goto-char itemp) + (org-list-get-ind + (org-list-get-top-point (org-list-struct)))) + (skip-chars-backward " \r\t\n") + (cond + ((and (org-at-heading-p) + org-adapt-indentation) + (1+ (org-current-level))) + ((org-at-heading-p) 0) + (t (org-get-indentation))))))) (setq bul (org-list-bullet-string "-")) (org-indent-line-to ind) (insert bul (pop lines)) |