From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#53952: 27.1; insert-image sometimes unexpectedly truncates images Date: Sat, 12 Feb 2022 14:31:19 +0200 Message-ID: <838rugs1uw.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31782"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53952@debbugs.gnu.org To: Markus Triska Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 12 13:32:32 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIrZn-00087c-Jv for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Feb 2022 13:32:31 +0100 Original-Received: from localhost ([::1]:42972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIrZm-0005aH-Ez for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Feb 2022 07:32:30 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIrZK-0005Ya-Hx for bug-gnu-emacs@gnu.org; Sat, 12 Feb 2022 07:32:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39791) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIrZK-0001kL-6k for bug-gnu-emacs@gnu.org; Sat, 12 Feb 2022 07:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nIrZK-0004v1-3n for bug-gnu-emacs@gnu.org; Sat, 12 Feb 2022 07:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Feb 2022 12:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53952 X-GNU-PR-Package: emacs Original-Received: via spool by 53952-submit@debbugs.gnu.org id=B53952.164466910218046 (code B ref 53952); Sat, 12 Feb 2022 12:32:02 +0000 Original-Received: (at 53952) by debbugs.gnu.org; 12 Feb 2022 12:31:42 +0000 Original-Received: from localhost ([127.0.0.1]:33688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIrYq-0004ZL-9X for submit@debbugs.gnu.org; Sat, 12 Feb 2022 07:31:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIrYp-0004UF-7c for 53952@debbugs.gnu.org; Sat, 12 Feb 2022 07:31:31 -0500 Original-Received: from [2001:470:142:3::e] (port=38578 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIrYj-0001cr-Il; Sat, 12 Feb 2022 07:31:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=i3r4JnuzI4ltR7FZ/NObaXE38xw5ZyLipGcH0aTOy4Q=; b=gm59vgNCvBztTDLRXEkf 1ZVDw2q4/EM2/Tk+5vL4brDm5jJMTH8mQYIvn0DHuphigacVVyHaP+j/5cEilFZdl5/nTUkVttMzk O6gi6GxkV1kgULGrI4oh/dHRetkNKAHPuMLYiE/TZreViYgTm9QfuKQdMVBgAyaAemhCMuUS/kjch Cq0X0wrTBg0mf0WWwlyYMy8MkgyjBtw5RV5Pe79sqovddSsOyok4RqNKc7924oMorgg0Q5TCyldtS 8NscxK6RugzS/1w+MteUz99TNq4R8qQQLtdnwqqxs/dfo0C0l5BS8c0G50qEqo36zZog1g0vuDqrm qcYi8IKK2AErxw==; Original-Received: from [87.69.77.57] (port=4125 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIrYj-0005HQ-3I; Sat, 12 Feb 2022 07:31:25 -0500 In-Reply-To: (message from Markus Triska on Sat, 12 Feb 2022 11:12:37 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:226723 Archived-At: > From: Markus Triska > Date: Sat, 12 Feb 2022 11:12:37 +0100 > > (defun insert-bar (width) > (let* ((height 5) > (data (with-temp-buffer > (insert (format "P1\n%s %s\n" width height)) > (dotimes (_ height) > (insert (make-string width ?1) "\n")) > (buffer-string)))) > (insert-image `(image :type pbm :data ,data)) "t")) > > (progn > (insert "\n") > (dotimes (_ 3) > (insert-bar (/ (window-pixel-width) 3)) > (insert " "))) > > Then evaluate the forms with M-x eval-buffer RET. > > The code is meant to insert 3 bars of equal length, each 1/3 of the > window size in pixels. > > Unexpectedly, the rightmost bar is much shorter than the other two bars. Emacs doesn't support wrapping of images, it never did. The display engine chops images at the right edge of the window. > I say "unexpectedly", because the documentation of insert-image (which > is used to insert the image by the forms above) states: > > "If SLICE is ‘nil’ or omitted the whole image is inserted." I added a note there about the forced truncation of images. > If possible, I would like to insert the entire image no matter where it > appears in the buffer, even if scrolling is necessary to reveal > remaining parts. Is there a way to do this? No, not with how we display images at this time.