From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "T. V. Raman" Newsgroups: gmane.emacs.devel Subject: Add a function to test for invisible characters? Date: Tue, 24 Jun 2008 06:39:37 -0700 Message-ID: <18528.63769.312834.741365@gargle.gargle.HOWL> References: <485FC25F.4090407@gmail.com> Reply-To: raman@users.sf.net NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1214315480 24474 80.91.229.12 (24 Jun 2008 13:51:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Jun 2008 13:51:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: lennart.borgman@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 24 15:52:05 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KB8wA-0004IY-H7 for ged-emacs-devel@m.gmane.org; Tue, 24 Jun 2008 15:51:58 +0200 Original-Received: from localhost ([127.0.0.1]:55715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KB8vL-0004B4-1E for ged-emacs-devel@m.gmane.org; Tue, 24 Jun 2008 09:51:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KB8vD-000473-EW for emacs-devel@gnu.org; Tue, 24 Jun 2008 09:50:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KB8vC-00046B-As for emacs-devel@gnu.org; Tue, 24 Jun 2008 09:50:58 -0400 Original-Received: from [199.232.76.173] (port=46114 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KB8vB-00045s-VC for emacs-devel@gnu.org; Tue, 24 Jun 2008 09:50:58 -0400 Original-Received: from qmta09.westchester.pa.mail.comcast.net ([76.96.62.96]:45298) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KB8kF-00081o-Ka for emacs-devel@gnu.org; Tue, 24 Jun 2008 09:39:39 -0400 Original-Received: from OMTA04.westchester.pa.mail.comcast.net ([76.96.62.35]) by QMTA09.westchester.pa.mail.comcast.net with comcast id hmQY1Z0030ldTLk590GZ00; Tue, 24 Jun 2008 13:39:39 +0000 Original-Received: from localhost ([71.202.191.236]) by OMTA04.westchester.pa.mail.comcast.net with comcast id hpfd1Z00B56Ur8v3Qpfduq; Tue, 24 Jun 2008 13:39:38 +0000 X-Authority-Analysis: v=1.0 c=1 a=IOS6Eb1hejcA:10 a=O1V2y-cE8pkA:10 a=2z1OXlWFAAAA:8 a=AhPdwol1ttAs6QLsspsA:9 a=AaL5e9sUlxYs5tgVUv3hcxzbsmMA:4 a=5o1NfpFvE1MA:10 a=MSl-tDqOz04A:10 a=CWfAmLVWKswA:10 Original-Received: by localhost (Postfix, from userid 1000) id 550A212A41A8; Tue, 24 Jun 2008 06:39:37 -0700 (PDT) In-Reply-To: <485FC25F.4090407@gmail.com> X-Mailer: VM 8.1.0-devo-509 under Emacs 23.0.60.1 (i686-pc-linux-gnu) x-attribution: tvr X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:99849 Archived-At: 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) 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: raman@users.sf.net WWW: http://emacspeak.sf.net/raman/ AIM: emacspeak GTalk: tv.raman.tv@gmail.com PGP: http://emacspeak.sf.net/raman/raman-almaden.asc Google: tv+raman IRC: irc://irc.freenode.net/#emacs