[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ilist 1b16d5789d 14/24: ilist: fix some errors caused b
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ilist 1b16d5789d 14/24: ilist: fix some errors caused by invisibility again. |
Date: |
Tue, 28 Dec 2021 16:58:14 -0500 (EST) |
branch: externals/ilist
commit 1b16d5789d5f09ef722f7cd1f04645379bd3572d
Author: JSDurand <mmemmew@gmail.com>
Commit: JSDurand <mmemmew@gmail.com>
ilist: fix some errors caused by invisibility again.
* ilist.el (ilist-map-lines): New option to control whether to skip
invisible lines.
(ilist-hidden-line-p): A potentially useful function to determine
whether the line at point is hidden.
---
ilist.el | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/ilist.el b/ilist.el
index ff2371242c..36230bd7c5 100644
--- a/ilist.el
+++ b/ilist.el
@@ -569,7 +569,8 @@ trailing spaces."
;;; map over lines
-(defun ilist-map-lines (fun &optional predicate start end)
+(defun ilist-map-lines (fun &optional predicate start end
+ no-skip-invisible)
"Execute FUN over lines.
If PREDICATE is non-nil, it should be a function to determine
whether to execute FUN on the line.
@@ -579,7 +580,10 @@ execution lines. It can be an integer or a marker. If it
is a
marker, the buffer of the marker should be the current buffer.
The return value is the list of execution results on the lines
-over which the function is executed."
+over which the function is executed.
+
+If NO-SKIP-INVISIBLE is non-nil, then we don't skip invisible
+lines."
;; normalizations
(cond
((not (functionp predicate))
@@ -611,8 +615,7 @@ over which the function is executed."
(cons
(funcall fun)
res))))
- ;; don't skip invisible lines here
- (ilist-forward-line 1 nil nil t))
+ (ilist-forward-line 1 nil nil no-skip-invisible))
(nreverse res))))
;;; Get index at point
@@ -631,6 +634,14 @@ If point is not at a group header return nil."
(declare (side-effect-free t))
(get-text-property (point) 'ilist-group-header))
+;;; Whether the line is hidden
+
+(defun ilist-hidden-line-p ()
+ "Return t if the line at point is hidden."
+ (declare (side-effect-free t))
+ (memq (get-text-property (point) 'invisible)
+ buffer-invisibility-spec))
+
;;; marks related
;; It is possible that some user-package does not need the
- [elpa] externals/ilist 282f60c93a 21/24: I forgot to byte-compile again. Silly me!, (continued)
- [elpa] externals/ilist 282f60c93a 21/24: I forgot to byte-compile again. Silly me!, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist c3f0e61360 13/24: fix missing parameter, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist b2bf67c5d8 24/24: Add changelog, and update documentation, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist ed18678569 05/24: new: get group and marks, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist 5362c106a8 04/24: more functionalities, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist 347effebbe 07/24: fix the calculation of lengths of strings, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist ebb207c520 08/24: Fix an ilist error, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist 76f29b61bb 10/24: Minor format change, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist 8c4efd3d7c 11/24: add invisible text property., ELPA Syncer, 2021/12/28
- [elpa] externals/ilist c4a48491ee 15/24: fix previous bugs caused by invisibility, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist 1b16d5789d 14/24: ilist: fix some errors caused by invisibility again.,
ELPA Syncer <=
- [elpa] externals/ilist c9b456103c 16/24: Fix errors and byte-compile, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist df91da4d46 17/24: ilist: try to fix a bug, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist 0892dd8ffc 18/24: ilist: update the byte-compiled version, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist 2279028fd5 23/24: ilist: Adding automatic filter groups, ELPA Syncer, 2021/12/28
- [elpa] externals/ilist 66bc6e0101 19/24: ilist: fix a bug about moving between items, ELPA Syncer, 2021/12/28