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 12:46:36 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200305221746.h4MHka410509@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 1053628070 28912 80.91.224.249 (22 May 2003 18:27:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 22 May 2003 18:27:50 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu May 22 20:27:45 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 19Iun3-0007Vk-00 for ; Thu, 22 May 2003 20:27:45 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19IuyQ-0007pb-00 for ; Thu, 22 May 2003 20:39:30 +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 19IuVt-0006Uq-M6 for emacs-devel@quimby.gnus.org; Thu, 22 May 2003 14:10:01 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19IuVa-0006SR-8a for emacs-devel@gnu.org; Thu, 22 May 2003 14:09:42 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19IuCJ-0000xm-KG for emacs-devel@gnu.org; Thu, 22 May 2003 13:50:18 -0400 Original-Received: from manatee.dms.auburn.edu ([131.204.53.104]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Iu9D-00005D-Pw for emacs-devel@gnu.org; Thu, 22 May 2003 13:46:35 -0400 Original-Received: from eel.dms.auburn.edu (eel.dms.auburn.edu [131.204.53.108]) h4MHkXoc011232; Thu, 22 May 2003 12:46:34 -0500 (CDT) Original-Received: (from teirllm@localhost) by eel.dms.auburn.edu (8.11.6+Sun/8.11.6) id h4MHka410509; Thu, 22 May 2003 12:46:36 -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:14099 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:14099 Stefan Monnier wrote: BTW, how about a `invisible-p' function that does above ? Might be useful. A correct version of the above, of course. I personally also see something wrong with it, but not the same thing you seem to see. Especially since the above is wrong (the assq might match a cons cell like (foo . nil) which says that it's *not* invisible). I do not believe that is what is wrong with it. Documentation string of buffer-invisibility-spec: buffer-invisibility-spec's value is ((silly) nonsense) Local in buffer killerstuff; global value is t Automatically becomes buffer-local when set in any fashion. Invisibility spec of this buffer. The default is t, which means that text is invisible if it has a non-nil `invisible' property. If the value is a list, a text character is invisible if its `invisible' property is an element in that list. If an element is a cons cell of the form (PROP . ELLIPSIS), then characters with property value PROP are invisible, and they have an ellipsis as well if ELLIPSIS is non-nil. Note that the documentation string says that (foo . nil) means that the character will get no ellipsis but will still be invisible. I tried it out, it is true. (silly) above is equivalent with (silly . nil) and silly newlines were invisible. The documentation string above is wrong about something else, however. Newlines with invisibility property '(aha ihi oho silly mia) are invisible too, even though according to the documentation string they should not be. The documentation string should be corrected. The (in as far as I know) correct description of buffer-invisibility-spec can be found in C-h i g (elisp)Invisible Text. forward-visible-line fails to recognize newlines with invisible property '(aha ihi oho silly mia) as invisible, even though they are. That is what I believe is wrong with the above code. A lot of code uses t as an invisible value that is assumed to always be invisible and nil for the opposite. A recent change makes buffer-invisibility-spec always contain t so that t should indeed always be invisible, What exactly do you mean? After I reset buffer-invisibility-spec without any problems to the above value, newlines with invisibility property t became visible. As long as that is the actual behavior, forward-visible-line should treat them as such. where the change is that nil and t are special values that do not depend on buffer-invisibility-spec. In as far as t is concerned, only if the actual behavior would change, not with the present behavior. Sincerely, Luc.