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: T. V. Raman
Subject: Add a function to test for invisible characters?
Date: Tue, 24 Jun 2008 06:39:37 -0700

I'd definitely find this useful in the emacspeak layer. I've
defined it myself in the emacspeak codebase in the past, and have
gotten it wrong  at times as well

>>>>> "Lennart" == Lennart Borgman (gmail) <address@hidden> writes:
    Lennart> I asked some time ago if a function to test if a
    Lennart> character is invisible.  I think nothing has been
    Lennart> done to this, or am I mistaken?
    Lennart> 
    Lennart> I think some code in Emacs currently gets this
    Lennart> wrong. Do for example reveal get this right?
    Lennart> 
    Lennart> Below is such a function that I use and that I think
    Lennart> follow the specifications for this. Should not
    Lennart> something like this be in Emacs?
    Lennart> 
    Lennart> (defun tabkey2-invisible-p (pos) "Return non-nil if
    Lennart> the character after POS is currently invisible."
    Lennart> (let ((prop (get-char-property pos 'invisible))) (if
    Lennart> (eq buffer-invisibility-spec t) prop (if (listp
    Lennart> prop) (catch 'invis (dolist (p prop) (when (or (memq
    Lennart> p buffer-invisibility-spec) (assq p
    Lennart> buffer-invisibility-spec)) (throw 'invis t)))) (or
    Lennart> (memq prop buffer-invisibility-spec) (assq prop
    Lennart> buffer-invisibility-spec))))))
    Lennart> 

-- 
Best Regards,
--raman

      
Email:  address@hidden
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: address@hidden
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs




reply via email to

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