From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Wells Newsgroups: gmane.emacs.bugs Subject: Emacs Lisp manual issues regarding overlays, display properties, margins, etc. Date: Fri, 28 Sep 2007 21:34:44 +0100 Message-ID: <86d4w2y1ej.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: sea.gmane.org 1191011710 29741 80.91.229.12 (28 Sep 2007 20:35:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Sep 2007 20:35:10 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 28 22:35:06 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IbMY5-00082v-Qm for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Sep 2007 22:34:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IbMY2-0007VA-8U for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Sep 2007 16:34:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IbMXz-0007Uf-UW for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2007 16:34:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IbMXw-0007SC-9H for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2007 16:34:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IbMXw-0007S9-3v for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2007 16:34:48 -0400 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 1IbMXv-0003Qc-AV for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2007 16:34:47 -0400 Original-Received: from selene.macs.hw.ac.uk ([137.195.27.40]:50054 helo=127.0.0.1) by izanami.macs.hw.ac.uk with smtp (Exim 4.51) id 1IbMXs-0008IY-5S for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2007 21:34:44 +0100 Original-Received: (nullmailer pid 22538 invoked by uid 1001); Fri, 28 Sep 2007 20:34:44 -0000 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16653 Archived-At: I have some issues with the Emacs Lisp manual's coverage of overlays, display properties, margins, etc. In the issues I raise below, I'll assume this macro: (defmacro test-overlays (&rest body) `(let ((buf (get-buffer-create "xyzzy"))) (with-current-buffer buf (display-buffer buf) (erase-buffer) (dolist (o (overlays-in (point-min) (point-max))) (delete-overlay o)) ,@body))) Issue 1:=C2=A0=C2=A0The =E2=80=9Cheight=E2=80=9D display specification seem= s not to work at all. For example, in the following the B is not larger: (test-overlays (insert "ABC") (let ((o (make-overlay 2 3))) (overlay-put o 'display '(height 2)))) This seems to be a bug. But perhaps merely the documentation is wrong. Can someone please check? Issue 2:=C2=A0=C2=A0RMS recently clarified the text in the =E2=80=9CDisplay Property=E2=80=9D manual node (in the Emacs 22 CVS branch) to read like this: The value of the @code{display} property should be a display specification, or a list or vector containing several display specifications. Display specifications generally apply in parallel to the text they cover. Some kinds of @code{display} specifications specify something to display instead of the text that has the property. If a list of display specifications includes more than one of this kind, the first is effective and the rest are ignored. When it says that =E2=80=9Cdisplay specifications generally apply in parallel to the text they cover=E2=80=9D, is that supposed to include display properties of multiple overlays covering the same text? For example, this works: (test-overlays (insert "A B C\nD E F") (let ((o1 (make-overlay 2 5))) (overlay-put o1 'display '((space-width 3) (raise 0.5))))) In contrast, in the following, the display property of overlay o1 is completely ignored: (test-overlays (insert "A B C\nD E F") (let ((o1 (make-overlay 2 5)) (o2 (make-overlay 2 5))) (overlay-put o2 'priority 1) (overlay-put o1 'display '(space-width 3)) (overlay-put o2 'display '(raise 0.5)))) So =E2=80=9Cdisplay specifications generally apply in parallel to the text they cover=E2=80=9D probably deserves a clarification to point out that only the display specifications in one display property can cover a piece of text. Issue 3:=C2=A0=C2=A0Does =E2=80=9Cdisplay specifications generally apply in parallel to the text they cover=E2=80=9D mean that if one display spec specifies a replacement, then the other display specs in parallel with it cover it? It seems not, because the Z in this is not raised: (test-overlays (insert "ABC") (let ((o1 (make-overlay 2 3))) (overlay-put o1 'display '((raise 0.5) "Z")))) Similarly, the space in "Y Z" in this is not wider: (test-overlays (insert "ABC") (let ((o1 (make-overlay 2 3))) (overlay-put o1 'display '((space-width 8) "Y Z")))) So it would be helpful to clarify that a display spec never covers replacement text in another display spec parallel to it. Issue 4:=C2=A0=C2=A0What does =E2=80=9Cdisplay specifications generally app= ly in parallel to the text they cover=E2=80=9D mean in the presence of two =E2=80=9Cslice=E2=80=9D display specs? I'm guessing there should be a clarification here to specify that the leftmost one wins. Am I right? Issue 5:=C2=A0=C2=A0The =E2=80=9CDisplay Margins=E2=80=9D manual node says: To put text in the left or right display margin of the window, use a display specification of the form `(margin right-margin)' or `(margin left-margin)' on it. However, this doesn't put anything in the margin: (test-overlays (insert "ABC") (let ((o1 (make-overlay 2 3))) (overlay-put o1 'display '(margin left-margin))) (set-window-margins (get-buffer-window (current-buffer)) 8)) As far as I can tell, (margin MARGIN) is not actually a valid display spec, but only part of a display spec when in the form ((margin MARGIN) SPEC) where SPEC must be a display spec that replaces the covered text. For example, this works: (test-overlays (insert "ABC") (let ((o1 (make-overlay 2 3))) (overlay-put o1 'display '((margin left-margin) "Z"))) (set-window-margins (get-buffer-window (current-buffer)) 8)) But this doesn't put anything in the margin: (test-overlays (insert "ABC") (let ((o1 (make-overlay 2 3))) (overlay-put o1 'display '("Z" (margin left-margin)))) (set-window-margins (get-buffer-window (current-buffer)) 8)) Can someone please check what the C code actually does and clarify/correct this part of the manual accordingly? Issue 6:=C2=A0=C2=A0The =E2=80=9COverlay Properties=E2=80=9D manual node sa= ys this on overlay priorities: `priority' This property's value (which should be a nonnegative integer number) determines the priority of the overlay. The priority matters when two or more overlays cover the same character and both specify the same property; the one whose `priority' value is larger takes priority over the other. For the `face' property, ... So what is the relative priority of an overlay which has a nonnegative integer value of its priority property, and one which has no priority property at all? It seems that nil is below 0: (test-overlays (insert "ABC") (let ((o1 (make-overlay 2 3)) (o2 (make-overlay 2 3))) (overlay-put o1 'display "123") (overlay-put o2 'priority 0) (overlay-put o2 'display "abc"))) This could beneficially be detailed in the manual. I hope the points I made above can help in clarifying the manual (and maybe fixing a bug in the =E2=80=9Cheight=E2=80=9D display specs). Joe =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D In GNU Emacs 22.1.1 (i686-pc-linux-gnu, GTK+ Version 2.8.20) of 2007-06-27 on artemis Windowing system distributor `The X.Org Foundation', version 11.0.70000000 configured using `configure '--prefix=3D/home/jbw/local2' '--enable-debug'= '--disable-nls' '--with-x-toolkit=3Dgtk' 'CFLAGS=3D-O0 -g3 -ggdb'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: en_US.UTF-8 value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: jbw value of $LANG: nil locale-coding-system: utf-8 default-enable-multibyte-characters: t Minor modes in effect: mml-mode: t flyspell-mode: t TeX-source-specials-mode: t desktop-save-mode: t url-handler-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t temp-buffer-resize-mode: t size-indication-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t