From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alp Aker Newsgroups: gmane.emacs.devel Subject: Re: Alignment and images Date: Thu, 1 Sep 2016 14:10:46 -0400 Message-ID: References: <831t3hxowt.fsf@gnu.org> <83twgdw9n7.fsf@gnu.org> <83por1w6ng.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1148ebcc098137053b76226e X-Trace: blaine.gmane.org 1472753491 27730 195.159.176.226 (1 Sep 2016 18:11:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Sep 2016 18:11:31 +0000 (UTC) Cc: Eli Zaretskii , Emacs devel To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 01 20:11:23 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfWSH-0005SA-8Q for ged-emacs-devel@m.gmane.org; Thu, 01 Sep 2016 20:11:13 +0200 Original-Received: from localhost ([::1]:38433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfWSE-0000Qr-Qd for ged-emacs-devel@m.gmane.org; Thu, 01 Sep 2016 14:11:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfWS4-0000Qk-IQ for emacs-devel@gnu.org; Thu, 01 Sep 2016 14:11:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfWRz-0002Fy-EA for emacs-devel@gnu.org; Thu, 01 Sep 2016 14:11:00 -0400 Original-Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:36697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfWRr-0002Eb-Pc; Thu, 01 Sep 2016 14:10:47 -0400 Original-Received: by mail-wm0-x229.google.com with SMTP id c133so91117977wmd.1; Thu, 01 Sep 2016 11:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=J38VzxyNca7ImcV8wjigRYVUAqSNXhBIT6eA5IeI3Rw=; b=htw04xms2tvOc0igu/AHQdxy8a43oytdHYq7QBo+MDMawn8WggVFNJB12fBtAobxfP oVNpJ4pMsyPndnYH5SKe68eGecwumMD52G6hxCVEFpA97vBih2t08XZiLdMjQtjnu1cn 22rZkc3DZziZv09QqbggmTU0R977bTywXAP7VIn2WQs+xaIqAbd+4BDL3VUtgYaQa+DN ufP2KIQ+S40ZNaac+K5o2k4BFBR+xFvNS0wWXr3Aw2M2NfFp4iX3w5ddsz3ZowVtCPIN aBEP7Hpc5JNazVASSJ595mbBz/II4Zlp6ljivZSl7zQScbgPqu+lZLXV3qatwuXGGkzK mubQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=J38VzxyNca7ImcV8wjigRYVUAqSNXhBIT6eA5IeI3Rw=; b=a78z79JDB/10yfni8fRlubg1gh58d+UMupLESJNfGH2X6wrnDh9vejzahpIkfTD2uz nQ9qM38s3UtP3KeUiw+WpwrPJRfdvzTiEVRkocsqnhRznsCh2hhK7FMfsZj6bzmlcFxp rx93boJOz5h3ZNlx8kl8dsObXMfIDO9pn+V3mm+OqvDU2Nku3QGo15bmiv1lwYYALED0 S+mPyeOm85PIiLmJ+0jLkWuW0WwIml1fBqlTJ80xkYhdzmI0mr0QLU4webH2xzpv3h0S SwgtxPTHQhiDKXd61vTjluVAVCU73w4yPfh91ZTWLZD6H/wPQHKhwstbD4nHzzOfGq/a A9WA== X-Gm-Message-State: AE9vXwPni6DBjDWG/uYsXbzSA388dEC/z9KUR+namHJ29hX9U96+iULGmb8ITjilyrZg/btUG9WFLMPmwGiRXA== X-Received: by 10.28.95.67 with SMTP id t64mr29535521wmb.99.1472753446779; Thu, 01 Sep 2016 11:10:46 -0700 (PDT) Original-Received: by 10.80.167.195 with HTTP; Thu, 1 Sep 2016 11:10:46 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::229 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:207091 Archived-At: --001a1148ebcc098137053b76226e Content-Type: text/plain; charset=UTF-8 On Tue, Jun 28, 2016 at 1:51 PM, Lars Magne Ingebrigtsen wrote: > So... there is no easy way implement this in the current Emacs? Using > post-command-hook and keeping track of previous cursor positions seems > kinda ... non-optimal. If you put the spacing display property on an overlay's before- or after-string, it doesn't create a new cursor position. So would something like the below create the effect you're looking for? (progn (setq o (make-overlay 1 2) o2 (make-overlay 2 3)) (overlay-put o 'display (create-image "~/rms.jpg")) (overlay-put o2 'before-string (propertize " " 'display '(space :align-to (200)))) (overlay-put o2 'display (create-image "~/rms.jpg"))) --001a1148ebcc098137053b76226e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, Jun 28, 2016 at 1:51 PM, Lars Magne Ingebrigtsen <= span dir=3D"ltr"><la= rsi@gnus.org> wrote:
> So...=C2=A0 there is no easy way implement this in th= e current Emacs?=C2=A0 Using
> post-command-hook and keeping track of= previous cursor positions seems
> kinda ... non-optimal.

If = you put the spacing display property on an overlay's before- or after-s= tring, it doesn't create a new cursor position.=C2=A0=C2=A0 So would so= mething like the below create the effect you're looking for?

(pr= ogn
=C2=A0 (setq o (make-overlay 1 2)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 o2 (make-overlay 2 3))
=C2=A0 (overlay-put o 'display (= create-image "~/rms.jpg"))
=C2=A0 (overlay-put o2 'before-= string (propertize " " 'display '(space :align-to (200)))= )
=C2=A0 (overlay-put o2 'display (create-image "~/rms.jpg"= ;)))


--001a1148ebcc098137053b76226e--