From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: bug in forward-visible-line: Patch Date: Thu, 22 May 2003 16:40:09 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200305222140.h4MLe9r10843@eel.dms.auburn.edu> References: <200305220443.h4M4h4w10124@eel.dms.auburn.edu> <200305221256.h4MCuhjv003998@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1053641878 21310 80.91.224.249 (22 May 2003 22:17:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 22 May 2003 22:17:58 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri May 23 00:17:53 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19IyNR-0005W7-00 for ; Fri, 23 May 2003 00:17:33 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19IyYu-0001hQ-00 for ; Fri, 23 May 2003 00:29:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Ixzo-0002CO-QF for emacs-devel@quimby.gnus.org; Thu, 22 May 2003 17:53:08 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19IxxB-0001aT-Ne for emacs-devel@gnu.org; Thu, 22 May 2003 17:50:25 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19Ixvj-0000sn-3G for emacs-devel@gnu.org; Thu, 22 May 2003 17:49:27 -0400 Original-Received: from manatee.dms.auburn.edu ([131.204.53.104]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19IxnD-00076Y-Bv for emacs-devel@gnu.org; Thu, 22 May 2003 17:40:07 -0400 Original-Received: from eel.dms.auburn.edu (eel.dms.auburn.edu [131.204.53.108]) h4MLe6oc012449; Thu, 22 May 2003 16:40:06 -0500 (CDT) Original-Received: (from teirllm@localhost) by eel.dms.auburn.edu (8.11.6+Sun/8.11.6) id h4MLe9r10843; Thu, 22 May 2003 16:40:09 -0500 (CDT) X-Authentication-Warning: eel.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: monnier+gnu/emacs@rum.cs.yale.edu In-reply-to: <200305221256.h4MCuhjv003998@rum.cs.yale.edu> (monnier+gnu/emacs@rum.cs.yale.edu) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:14104 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:14104 Stefan Monnier wrote: BTW, how about a `invisible-p' function that does above ? I believe visiblep would be slightly more useful (does not make any real difference though). I believe the usual convention is to only use -p if the function name is already multi-word, although this convention is not universally followed. What about the following function? I should still double-check it more carefully, but on first testing in a reasonably complex situation, it seems to work OK. I believe that I could use the function not only to make forward-visible-line behave correctly (even after my patch, a problem remains, as I pointed out earlier), but probably in other situations as well. ===File ~/invp.el=========================================== (defun visiblep (&optional pos) "Return t if character at POS is currently visible. POS defaults to point." (unless pos (setq pos (point))) (let ((prop (get-text-property pos 'invisible))) (cond ((null prop)) ((eq buffer-invisibility-spec t) nil) ((memq prop buffer-invisibility-spec) nil) ((assq prop buffer-invisibility-spec) nil) ((listp prop) (catch 'found (dolist (var prop) (if (or (memq var buffer-invisibility-spec) (assq var buffer-invisibility-spec)) (throw 'found nil))))) (t)))) ============================================================