浏览代码

org-list: added new accessors

* lisp/org-list.el (org-list-get-first-item): new alias for
  org-list-get-list-begin
(org-list-get-last-item): new function
(org-list-get-list-end): use org-list-get-last-item
Nicolas Goaziou 14 年之前
父节点
当前提交
bf1776b494
共有 1 个文件被更改,包括 11 次插入3 次删除
  1. 11 3
      lisp/org-list.el

+ 11 - 3
lisp/org-list.el

@@ -1403,14 +1403,22 @@ previous items. See `org-list-struct-prev-alist'."
       (setq first-item prev-item))
     first-item))
 
-(defun org-list-get-list-end (item struct prevs)
-  "Return point at end of sub-list ITEM belongs.
+(defalias 'org-list-get-first-item 'org-list-get-list-begin)
+
+(defun org-list-get-last-item (item struct prevs)
+  "Return point at last item of sub-list ITEM belongs.
 STRUCT is the structure of the list. PREVS is the alist of
 previous items. See `org-list-struct-prev-alist'."
   (let ((last-item item) next-item)
     (while (setq next-item (org-list-get-next-item last-item struct prevs))
       (setq last-item next-item))
-    (org-list-get-item-end last-item struct)))
+    last-item))
+
+(defun org-list-get-list-end (item struct prevs)
+  "Return point at end of sub-list ITEM belongs.
+STRUCT is the structure of the list. PREVS is the alist of
+previous items. See `org-list-struct-prev-alist'."
+  (org-list-get-item-end (org-list-get-list-last item struct prevs) struct))
 
 (defun org-list-get-nth (n key struct)
   "Return the Nth value of KEY in STRUCT."