From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Wells Newsgroups: gmane.emacs.devel Subject: Re: Fwd: overlay face property not used for after-string property Date: Mon, 05 Nov 2007 12:05:39 +0000 Message-ID: <86wsswhp7w.fsf@macs.hw.ac.uk> References: <86r6jfz3bb.fsf@macs.hw.ac.uk> <86bqaixmxk.fsf@macs.hw.ac.uk> <86bqabjozh.fsf@macs.hw.ac.uk> <86y7ddipg5.fsf_-_@macs.hw.ac.uk> <86zlxtdopx.fsf@lola.quinscape.zz> <86640gj4fx.fsf@macs.hw.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1194264373 9352 80.91.229.12 (5 Nov 2007 12:06:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2007 12:06:13 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, monnier@iro.umontreal.ca To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 05 13:06:16 2007 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 1Ip0iV-0002rI-Lw for ged-emacs-devel@m.gmane.org; Mon, 05 Nov 2007 13:06:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ip0iL-0001JT-3k for ged-emacs-devel@m.gmane.org; Mon, 05 Nov 2007 07:05:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ip0iG-0001GC-Nn for emacs-devel@gnu.org; Mon, 05 Nov 2007 07:05:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ip0iG-0001FL-29 for emacs-devel@gnu.org; Mon, 05 Nov 2007 07:05:52 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ip0iF-0001FC-LA for emacs-devel@gnu.org; Mon, 05 Nov 2007 07:05:51 -0500 Original-Received: from izanami.macs.hw.ac.uk ([137.195.13.6]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ip0i6-00041Y-Gq; Mon, 05 Nov 2007 07:05:43 -0500 Original-Received: from lxultra1.macs.hw.ac.uk ([137.195.27.173]:45638 helo=127.0.0.1) by izanami.macs.hw.ac.uk with smtp (Exim 4.51) id 1Ip0i4-0004Sd-E1; Mon, 05 Nov 2007 12:05:40 +0000 Original-Received: (nullmailer pid 18970 invoked by uid 1001); Mon, 05 Nov 2007 12:05:39 -0000 In-Reply-To: <86640gj4fx.fsf@macs.hw.ac.uk> (Joe Wells's message of "Mon\, 05 Nov 2007 11\:51\:30 +0000") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:82570 Archived-At: Joe Wells writes: > David Kastrup writes: > >> Richard Stallman writes: >> >>> I think this information may not be enough. I think the policy >>> would also need to know which of the overlay properties >>> before-string, display, or after-string the string comes from. >>> >>> In most cases you can determine this by looking at the overlay's >>> properties and seeing where the string appears. That will work except >>> when the overlay has two properties that contain strings that are eq. >>> >>> That is not good enough for the final implementation, but it is good >>> enough for experimenting to find the right criteria. If the right >>> criteria really depend on this information, we can add a mechanism to >>> provide the information efficiently and reliably. So I see no need to >>> do that until we know whether it is needed. >> >> I think that the before-string should, in effect, use >> (get-char-property (overlay-start ov) 'face) >> to determine the face to use if no fully specified face is in the >> before-string. > > The behavior you propose is currently used and causes problems. I > have complained about it (in separate messages) as a bug. I have seen > it causing problems for linum.el and tex-fold.el. > > When (eq (overlay-start o) (overlay-end o)), the character after > (overlay-start o) is not even inside the overlay. It makes no logical > sense for the face of a character not covered by the overlay to affect > the display of things specified by the overlay. An additional point. Suppose the overlay has both before-string and display properties. (Yes, you need to do this if you want to use an overlay to replace the text in the buffer and display multiple images or a mixture of text and images.) The display property replaces the display of the text in the buffer (and possibly specifies a different face for it). It makes no logical sense in this case for the display of the before-string to use the face of a character in the buffer that is being concealed. --=20 Joe > Requiring the face of a string displayed by an overlay to be fully > specified means that such a face can never adjust automatically to > changes in other faces. Yet this is needed. For example, if the > default face is changed (e.g., to change the overall size of the text > for easier viewing), it is desired that all faces will automatically > adjust. Similarly, if the region is activated, it would be nice if > all faces that do not need to specify a background would get the > background of face =E2=80=9Cregion=E2=80=9D. With your proposal (which i= s already > implemented), an overlay's before-string would have to specify a > background color (even if merely white) and could not automatically > pick up the background of the region face. > > I would like to strongly suggest that overlay before-string, display, > and after-string properties should *not* be affected by the > text-property face properties in the buffer. > >> Similarly for after-string. That's simple, clear and straightforward >> for the user to understand. It also has the "right thing" feeling to >> it, which ignoring surrounding faces doesn't. > > It definitely has the =E2=80=9Cwrong thing=E2=80=9D feeling to it for me. > > --=20 > Joe