branch: externals/ilist commit ed186785695b85d00de40f144cb73ccf94861f38 Author: JSDurand <mmem...@gmail.com> Commit: JSDurand <mmem...@gmail.com>
new: get group and marks * ilist.el (ilist-get-group): Return the underlying group, if any. (ilist-get-marks): Return the underlying marks, if any. --- ilist.el | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/ilist.el b/ilist.el index 466bcfd17f..4c347c39fa 100644 --- a/ilist.el +++ b/ilist.el @@ -553,6 +553,14 @@ If point is not at an element, return nil." (declare (side-effect-free t)) (get-text-property (point) 'ilist-index)) +;;; Get group header + +(defun ilist-get-group () + "Return the group header at point. +If point is not at a group header return nil." + (declare (side-effect-free t)) + (get-text-property (point) 'ilist-group-header)) + ;;; marks related ;; It is possible that some user-package does not need the @@ -608,6 +616,27 @@ If END is non-nil, it specifies the end of the search." res))) res)))) +;;;; find marks + +(defun ilist-get-marks () + "Return the list of marks on the line. +The marks are in descending order, i.e. the mark that occurs +later on the line come earlier in the result list. + +It is considered a mark only if the value is not t or nil. +Non-mark values are simply ignored." + (delq + nil + (mapcar + (lambda (cons-cell) + (let ((value (get-text-property + (car cons-cell) 'ilist-mark-column))) + (cond + ((and value + (not (eq value t))) + value)))) + (ilist-mark-columns (point))))) + ;;;; mark (defun ilist-mark-with-char (char)