From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: There should be an option to set the display size of an image to zero Date: Tue, 17 Sep 2013 09:26:14 +0300 Message-ID: <83li2wotfd.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1379399193 934 80.91.229.3 (17 Sep 2013 06:26:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Sep 2013 06:26:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Marc Feeley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 17 08:26:33 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VLok5-0000Id-1l for ged-emacs-devel@m.gmane.org; Tue, 17 Sep 2013 08:26:33 +0200 Original-Received: from localhost ([::1]:38360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLok4-0007Jy-HX for ged-emacs-devel@m.gmane.org; Tue, 17 Sep 2013 02:26:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLojw-0007Jt-Sl for emacs-devel@gnu.org; Tue, 17 Sep 2013 02:26:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLojr-0003NO-1C for emacs-devel@gnu.org; Tue, 17 Sep 2013 02:26:24 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:64572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLojq-0003NI-PJ for emacs-devel@gnu.org; Tue, 17 Sep 2013 02:26:18 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MT900K00B6LSF00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Tue, 17 Sep 2013 09:26:17 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MT900KUXB7SKH80@a-mtaout21.012.net.il>; Tue, 17 Sep 2013 09:26:17 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163378 Archived-At: > From: Marc Feeley > Date: Mon, 16 Sep 2013 22:37:34 -0400 > > Images added to a buffer with put-image always occupy an area in the buffer that is equal to their size. You mean, occupy an area _on_display_, not in the buffer, right? Because images don't occupy any area in the buffer at all, they are displayed instead of some buffer text which can be as short as 1 character, or even _before_ some text (in which case it doesn't replace any characters). See this note in the ELisp manual: Internally, [`put-image'] creates an overlay, and gives it a `before-string' property containing text that has a `display' property whose value is the image. This arrangement of the overlay has the effect that the image is displayed before the text at certain buffer position, without taking any place in the buffer itself. > It would be nice to allow the image to be overlaid over or under the text which would allow annotating the text with arrows, bubbles, etc. This could be as simple as indicating a zero width and height for the image (for determining the placing of text around it), but using the actual image size for displaying it on the screen. The actual problem is not with the size of the image on screen, the actual problem is with layout. Emacs still lays out text and images by horizontal "rows", top to bottom. When it needs to display an image, it enlarges the height of the row to accommodate the image, displays the image, then goes on with displaying text. If I understand correctly what you are asking for, it would need a radical change in the display layout algorithms. Patches are welcome. P.S. If I misunderstood your suggestion, apologies, and please elaborate.