emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] scratch/hyperbole 2803a985a0 7/7: (kview:char-visible-p): Delete


From: Stefan Monnier
Subject: [elpa] scratch/hyperbole 2803a985a0 7/7: (kview:char-visible-p): Delete function
Date: Mon, 1 May 2023 18:18:14 -0400 (EDT)

branch: scratch/hyperbole
commit 2803a985a04cfeab84d1767bebd2d172ebda02e4
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    (kview:char-visible-p): Delete function
    
    * kotl/kview.el (kview:first-invisible-point): Use `kview:char-invisible-p`.
    (kview:char-visible-p): Delete function.
---
 kotl/kview.el | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/kotl/kview.el b/kotl/kview.el
index b510192257..fd039d4cb6 100644
--- a/kotl/kview.el
+++ b/kotl/kview.el
@@ -630,21 +630,13 @@ level."
 ;;;###autoload
 (defun kview:char-invisible-p (&optional pos)
   "Return t if the character after point is invisible/hidden, else nil."
+  ;; FIXME: A.k.a (invisible-p (or pos (point)))
   (or pos (setq pos (point)))
   (when (or (kproperty:get pos 'invisible)
            (delq nil (mapcar (lambda (o) (overlay-get o 'invisible))
                              (overlays-at (or pos (point))))))
     t))
 
-;;;###autoload
-(defun kview:char-visible-p (&optional pos)
-  "Return t if the character after point is visible, else nil."
-  (unless pos
-    (setq pos (point)))
-  (and (not (kproperty:get pos 'invisible))
-       (not (delq nil (mapcar (lambda (o) (overlay-get o 'invisible))
-                             (overlays-at (or pos (point))))))))
-
 (defun kview:create (buffer-name
                         &optional id-counter top-cell-attributes
                         label-type level-indent label-separator
@@ -708,6 +700,8 @@ are used.
 
 (defun kview:end-of-actual-line ()
   "Go to the end of the current line whether collapsed or not."
+  ;; FIXME: This "[\n\r]" is a leftover from when kotl was using
+  ;; `selective-display'.  We should use `end-of-line' nowadays.
   (when (re-search-forward "[\n\r]" nil 'move)
     (backward-char 1)))
 
@@ -744,7 +738,7 @@ Value may be the character immediately after point."
   (unless pos
     (setq pos (point)))
   (let ((end (kcell-view:end-contents pos)))
-    (while (and pos (< pos end) (kview:char-visible-p pos))
+    (while (and pos (< pos end) (not (kview:char-invisible-p pos)))
       (if (kproperty:get pos 'invisible)
          (setq pos (kproperty:next-single-change pos 'invisible nil end))
        (let ((overlay (car (delq nil (mapcar (lambda (o) (when (overlay-get o 
'invisible) o))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]