From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Alignment and images Date: Tue, 28 Jun 2016 15:32:26 +0200 Organization: Programmerer Ingebrigtsen Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467121285 12281 80.91.229.3 (28 Jun 2016 13:41:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jun 2016 13:41:25 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 28 15:41:13 2016 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 1bHtGA-0006q6-Tk for ged-emacs-devel@m.gmane.org; Tue, 28 Jun 2016 15:41:03 +0200 Original-Received: from localhost ([::1]:36813 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHtGA-0003pM-3d for ged-emacs-devel@m.gmane.org; Tue, 28 Jun 2016 09:41:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHt8H-0004L5-Ax for emacs-devel@gnu.org; Tue, 28 Jun 2016 09:32:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHt8D-0001G3-AN for emacs-devel@gnu.org; Tue, 28 Jun 2016 09:32:53 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHt8D-0001Ev-3z for emacs-devel@gnu.org; Tue, 28 Jun 2016 09:32:49 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bHt86-0001AR-Er for emacs-devel@gnu.org; Tue, 28 Jun 2016 15:32:42 +0200 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Jun 2016 15:32:42 +0200 Original-Received: from larsi by cm-84.215.1.64.getinternet.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Jun 2016 15:32:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 47 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cm-84.215.1.64.getinternet.no Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEWDgX3y7ua4tKza1coR ERH8/PfMx73n4tcwdbDVAAACaUlEQVQ4jW1SwW7bMAwVNKN3Ich09ehA5zYEpKvR6QcyoPeAGuRr XaHR7+/RSTc0nZDANh/J9x4p8/L5nJzrvl2qmDvAOe87c6nmS4HvieOXir3zrjeu/wGcAlLDfSsl Z+ZKdwAKWkJcyOw/dTppIwZ5Nae7RhDbECeD4v2/gpPzrDYkmNQc8ra/c6sHwMdAZE2sqax+t+5B jN+FQyglFjHda+BqGsfv2rGSVujXi7L8smb8AVGxVLQi0zVtvbGAwkfmIDQajtyeNuS7scavXY3o EAlkva991SEpB8SytgJQWaFNbneNUzsKiQkSeGkdPO9K0nu/XMmJJkmp+3eHXXSlSNgfhki1ckx9 VX5dUkog79hHkFpjU9G9a7ypKNFWsUbuuAHaxzWfLtCqzqVMzNpKfeoFaYuSm40jtbXvutupH12G qHMRXhIiK3p5pODulDcCEGotABjM7sm3hS9cYwkYiUhF47dFx+KT3xZejqTAxLEbhlS9OK2wxtU5 1VLjXMoFHRcuMKHs4BCJsc6tLZgHn6eCK0LYAB4BWXNMrSf/mvNs4XC0JmCT5WjmxgDakHO2IcC4 sRJElkNm6IysgLGTbNaDTOecH5bEdfmtgAlkRjPaWugRQEyRC17y8CzqHHIjjTkn6D2apzOaPaso MxKxhCFPcJZGoyT5m67WEkgOUBkAvObtTGhicKxF3qwphy0+Z6thsuPw92u4lmzpQmH7/MmEmV6B WQGyNAybFhIarq2uJSNds+hhvBXkeQQFZni+5i2P+YagGj7kIy2mjwoL54OtNylzqofbm7WjOczT h5RY6aNitH8AUZkYAL/UAc8AAAAASUVORK5CYII= Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:p5ux/vWSHCIo7AvSlzuv5XsE0lA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:204857 Archived-At: I wanted to implement a file browser for image files, and I wanted to display them in a grid. But images have different widths, so I need some magic to line them up like this: [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] I want the user to be able to use normal navigation commands to traverse the grid, so no special commands. My first attempt was a loop like this: (unless (bolp) (insert (propertize " " 'display `(space :align-to (,(* (mod i width) pixels))) 'intangible t))) (insert-image (create-image file 'imagemagick nil :max-width pixels :max-height pixels) " ") This gives me a nice grid visually, but when moving around in the grid, every other lands me on the align-to space thing, which doesn't feel very nice. I thought that the 'intangible should make that effect disappear, but it didn't. Is that a bug? Or am I doing something wrong? The second attempt was to add both the image and the align-to to the same display property. Kinda like this: (insert (propertize " " 'display `(,(create-image file 'imagemagick nil :max-width pixels :max-height pixels) :align-to (,(* (mod i width) pixels))))) That didn't work at all, but I didn't really expect it to. :-) Does anybody have any thoughts on this? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no