|
From: | Lennart Borgman (gmail) |
Subject: | Re: How to test :invisible property? |
Date: | Thu, 27 Dec 2007 15:36:21 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 |
Lennart Borgman (gmail) wrote:
Lennart Borgman (gmail) wrote:Lennart Borgman (gmail) wrote:Is there an elisp function that tests the :invisible property against buffer-invisibility-spec?I mean the 'invisible propertyThere is actually a function in simple.el: (defun line-move-invisible-p (pos) "Return non-nil if the character after POS is currently invisible." Maybe this should be mentioned in (info "(elisp) Invisible Text")
But that function seems not correct. The "(or is list with members in common)" in the docs string of buffer-invisibility-spec does not seem to be implemented.
BTW that doc string is not quite correct. Here is a new version of the function above which I believe is correct: (defun line-move-invisible-p (pos) "Return non-nil if the character after POS is currently invisible." (let ((prop (get-char-property pos 'invisible))) (if (eq buffer-invisibility-spec t) prop (if (listp prop) (catch 'invis (dolist (p prop) (when (or (memq p buffer-invisibility-spec) (assq p buffer-invisibility-spec)) (throw 'invis t)))) (or (memq prop buffer-invisibility-spec) (assq prop buffer-invisibility-spec))))))
[Prev in Thread] | Current Thread | [Next in Thread] |