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 11:51:30 +0000 Message-ID: <86640gj4fx.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> 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 1194263524 6769 80.91.229.12 (5 Nov 2007 11:52:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2007 11:52:04 +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 12:52:07 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 1Ip0Ut-0007R3-5E for ged-emacs-devel@m.gmane.org; Mon, 05 Nov 2007 12:52:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ip0Ui-0002pz-J0 for ged-emacs-devel@m.gmane.org; Mon, 05 Nov 2007 06:51:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ip0Ue-0002o9-BO for emacs-devel@gnu.org; Mon, 05 Nov 2007 06:51:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ip0Ub-0002kT-EW for emacs-devel@gnu.org; Mon, 05 Nov 2007 06:51:48 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ip0Ub-0002kQ-A7 for emacs-devel@gnu.org; Mon, 05 Nov 2007 06:51:45 -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 1Ip0UT-0001Du-Ho; Mon, 05 Nov 2007 06:51:38 -0500 Original-Received: from lxultra1.macs.hw.ac.uk ([137.195.27.173]:35151 helo=127.0.0.1) by izanami.macs.hw.ac.uk with smtp (Exim 4.51) id 1Ip0UN-0003hP-7X; Mon, 05 Nov 2007 11:51:31 +0000 Original-Received: (nullmailer pid 17995 invoked by uid 1001); Mon, 05 Nov 2007 11:51:30 -0000 In-Reply-To: <86zlxtdopx.fsf@lola.quinscape.zz> (David Kastrup's message of "Mon\, 05 Nov 2007 10\:30\:02 +0100") 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:82566 Archived-At: 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. 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 is = 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