emacs-devel
[Top][All Lists]
Advanced

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

Add a function to test for invisible characters?


From: Lennart Borgman (gmail)
Subject: Add a function to test for invisible characters?
Date: Mon, 23 Jun 2008 17:33:51 +0200
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

I asked some time ago if a function to test if a character is invisible. I think nothing has been done to this, or am I mistaken?

I think some code in Emacs currently gets this wrong. Do for example reveal get this right?

Below is such a function that I use and that I think follow the specifications for this. Should not something like this be in Emacs?

(defun tabkey2-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))))))




reply via email to

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