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: Emacs Lisp manual issues regarding overlays, display properties, margins, etc. Date: Tue, 02 Oct 2007 17:23:54 +0100 Message-ID: <86tzp9v61x.fsf@macs.hw.ac.uk> References: <86d4w2y1ej.fsf@macs.hw.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1191342259 6971 80.91.229.12 (2 Oct 2007 16:24:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 2 Oct 2007 16:24:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 02 18:24:11 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 1IckXa-0006Ua-JW for ged-emacs-devel@m.gmane.org; Tue, 02 Oct 2007 18:24:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IckXW-00029k-UI for ged-emacs-devel@m.gmane.org; Tue, 02 Oct 2007 12:24:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IckXT-00026s-Ds for emacs-devel@gnu.org; Tue, 02 Oct 2007 12:24:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IckXS-00025c-JM for emacs-devel@gnu.org; Tue, 02 Oct 2007 12:24:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IckXS-00025M-CZ for emacs-devel@gnu.org; Tue, 02 Oct 2007 12:24:02 -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 1IckXN-0006Di-Ey; Tue, 02 Oct 2007 12:23:57 -0400 Original-Received: from lxultra1.macs.hw.ac.uk ([137.195.27.173]:52144 helo=127.0.0.1) by izanami.macs.hw.ac.uk with smtp (Exim 4.51) id 1IckXK-0000NR-Ei; Tue, 02 Oct 2007 17:23:54 +0100 Original-Received: (nullmailer pid 23792 invoked by uid 1001); Tue, 02 Oct 2007 16:23:54 -0000 In-Reply-To: (Richard Stallman's message of "Tue\, 02 Oct 2007 11\:29\:03 -0400") 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: 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:80140 Archived-At: Richard Stallman writes: > There seems to be something totally fishy with the way margin display > properties work: > > (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)) > > this causes Z to appear in the margin and causes B not to appear > in the body of the text. > > That seems like a bug to me. It seems to me that a property that puts > something in the margin should not alter the appearance of the text > it is on. It seems to follow the definition though. The current definition seems to be that a display spec of the form ((margin MARGIN) SPEC) works when SPEC is a display spec that causes something to be displayed instead of the text that has the display property and the (margin MARGIN) part acts as a modifier that additionally moves the replacement material into the margin. The documentation of margin display spec modifiers is a bit confusing. > Does anyone think the current behavior is desirable? I find the current definition of the margin display spec modifier awkward. I think part of the reason for the way the current margin modifier definition is designed is that (image ...) display specs are not strings and thus can not have display properties of their own. Also, the only current way to display an image is to have it _replace_ characters (at least one) in a string or in the buffer. Maybe there should be a margin property (distinct from the current margin display spec) which specifies material to go in the margin (like the way the overlay before-string property works). -- Joe P.S. For people who want to try the sexp above, the test-overlays macro is this: (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)))