Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
2022-07-26 Mats Lidell <matsl@gnu.org>

* kotl/kproperty.el:
* kotl/klink.el:
* kotl/klabel.el:
* kotl/kfile.el:
Expand Down
12 changes: 7 additions & 5 deletions kotl/kproperty.el
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@
plist))

(defun kproperty:all-positions (property value)
"Return a list of all non-narrowed buffer positions of kcells with PROPERTY set to VALUE, else nil.
"Return a list of all non-narrowed positions of kcells with PROPERTY VALUE.
If no kcells with PROPERTY VALUE, return nil.
Use (kcell-view:start <position>) on each returned <position> to get
the start position of each cell's content."
(kproperty:map (lambda (start _end) start) property value))

(defalias 'kproperty:get 'get-text-property)

(defun kproperty:map (function property value)
"Apply FUNCTION to each character with PROPERTY `eq' to VALUE in the current buffer.
FUNCTION is called with the start and end points of the text span with the matching PROPERTY
and with point at the start."
"Apply FUNCTION to each character with PROPERTY VALUE in the current buffer.
FUNCTION is called with the start and end points of the text span,
with the matching PROPERTY and with point at the start."
(let ((result)
(start (point-min))
end)
Expand All @@ -63,7 +64,8 @@ and with point at the start."
(defalias 'kproperty:next-single-change 'next-single-property-change)

(defun kproperty:position (property value)
"Return the non-narrowed buffer position of the first kcell with PROPERTY set to VALUE, else nil.
"Return the non-narrowed buffer position of the first kcell with PROPERTY VALUE.
If no kcell with PROPERTY VALUE, return nil.
Use (kcell-view:start <position>) on the returned <position> to get
the start position of the cell's content."
(text-property-any (point-min) (point-max) property value))
Expand Down