unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Alignment and images
@ 2016-06-28 13:32 Lars Magne Ingebrigtsen
  2016-06-28 16:24 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-06-28 13:32 UTC (permalink / raw)
  To: emacs-devel

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 <right> 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





^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 13:32 Alignment and images Lars Magne Ingebrigtsen
@ 2016-06-28 16:24 ` Eli Zaretskii
  2016-06-28 16:28   ` Lars Magne Ingebrigtsen
  2016-06-28 17:44 ` Eli Zaretskii
  2016-06-28 21:17 ` Glenn Morris
  2 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2016-06-28 16:24 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> Date: Tue, 28 Jun 2016 15:32:26 +0200
> 
> 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 <right> lands me on the align-to space thing, which doesn't
> feel very nice.

It's not clear what you want to happen instead.  Can you spell that
out for me?  Like, describe what should happen as you press <right>
time after time.

> I thought that the 'intangible should make that effect disappear,
> but it didn't.  Is that a bug?  Or am I doing something wrong?

Not sure.  Problem is, I don't build with Imagemagick, so I cannot try
your code and see what's going on there.  Can you show something
similar, but using more traditional images?

> 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.  :-)

Right.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 16:24 ` Eli Zaretskii
@ 2016-06-28 16:28   ` Lars Magne Ingebrigtsen
  2016-06-28 16:39     ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-06-28 16:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> It's not clear what you want to happen instead.  Can you spell that
> out for me?  Like, describe what should happen as you press <right>
> time after time.

It should go from one image to the image of the right of that image.

> Not sure.  Problem is, I don't build with Imagemagick, so I cannot try
> your code and see what's going on there.  Can you show something
> similar, but using more traditional images?

It doesn't really matter what image type you use as long as the image is
narrower than the width you're :align-to-ing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 16:28   ` Lars Magne Ingebrigtsen
@ 2016-06-28 16:39     ` Eli Zaretskii
  2016-06-28 16:50       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2016-06-28 16:39 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> Cc: emacs-devel@gnu.org
> Date: Tue, 28 Jun 2016 18:28:53 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > It's not clear what you want to happen instead.  Can you spell that
> > out for me?  Like, describe what should happen as you press <right>
> > time after time.
> 
> It should go from one image to the image of the right of that image.

OK.

> > Not sure.  Problem is, I don't build with Imagemagick, so I cannot try
> > your code and see what's going on there.  Can you show something
> > similar, but using more traditional images?
> 
> It doesn't really matter what image type you use as long as the image is
> narrower than the width you're :align-to-ing.

Humor me?  Please?



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 16:39     ` Eli Zaretskii
@ 2016-06-28 16:50       ` Lars Magne Ingebrigtsen
  2016-06-28 17:43         ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-06-28 16:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> It doesn't really matter what image type you use as long as the image is
>> narrower than the width you're :align-to-ing.
>
> Humor me?  Please?

(progn
  (insert-image (create-image "~/rms.jpg") " ")
  (insert (propertize " " 'display
                          `(space :align-to (200))
                          'intangible t))
  (insert-image (create-image "~/rms.jpg") " "))


[-- Attachment #2: rms.jpg --]
[-- Type: image/jpeg, Size: 889 bytes --]

[-- Attachment #3: Type: text/plain, Size: 104 bytes --]


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 16:50       ` Lars Magne Ingebrigtsen
@ 2016-06-28 17:43         ` Eli Zaretskii
  2016-06-28 17:51           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2016-06-28 17:43 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> Cc: emacs-devel@gnu.org
> Date: Tue, 28 Jun 2016 18:50:06 +0200
> 
> (progn
>   (insert-image (create-image "~/rms.jpg") " ")
>   (insert (propertize " " 'display
>                           `(space :align-to (200))
>                           'intangible t))
>   (insert-image (create-image "~/rms.jpg") " "))

Thanks.

Intangible doesn't work because we deprecated it, and set
inhibit-point-motion-hooks to t; set it to nil, and it will work (but
you really should use the newer replacements).  However, this won't
solve your problem, since the cursor position before the stretch will
always be visited, as intangible doesn't affect it.

We have on the C level a flag to avoid positioning cursor on a stretch
glyph (we use it for line-prefix and wrap-prefix), but we don't expose
it to Lisp.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 13:32 Alignment and images Lars Magne Ingebrigtsen
  2016-06-28 16:24 ` Eli Zaretskii
@ 2016-06-28 17:44 ` Eli Zaretskii
  2016-06-28 17:53   ` Lars Magne Ingebrigtsen
  2016-06-28 21:17 ` Glenn Morris
  2 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2016-06-28 17:44 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> Date: Tue, 28 Jun 2016 15:32:26 +0200
> 
> Does anybody have any thoughts on this?

How about redefining <right> when point is on the image?  E.g., with
the keymap text property?



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 17:43         ` Eli Zaretskii
@ 2016-06-28 17:51           ` Lars Magne Ingebrigtsen
  2016-06-28 18:12             ` Eli Zaretskii
                               ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-06-28 17:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> Intangible doesn't work because we deprecated it, and set
> inhibit-point-motion-hooks to t; set it to nil, and it will work (but
> you really should use the newer replacements).

That's `cursor-intangible'?

> However, this won't solve your problem, since the cursor position
> before the stretch will always be visited, as intangible doesn't
> affect it.
>
> We have on the C level a flag to avoid positioning cursor on a stretch
> glyph (we use it for line-prefix and wrap-prefix), but we don't expose
> it to Lisp.

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.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 17:44 ` Eli Zaretskii
@ 2016-06-28 17:53   ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 20+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-06-28 17:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> How about redefining <right> when point is on the image?  E.g., with
> the keymap text property?

That's possibly, but I want all normal Emacs movement commands to work
as you'd expect without any surprises.  Once you start going down the
"redefine movement commands" route, it often leads to inconsistencies. 

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 17:51           ` Lars Magne Ingebrigtsen
@ 2016-06-28 18:12             ` Eli Zaretskii
  2016-06-28 18:17               ` Lars Magne Ingebrigtsen
  2016-06-30 15:14             ` Ted Zlatanov
  2016-09-01 18:10             ` Alp Aker
  2 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2016-06-28 18:12 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> Cc: emacs-devel@gnu.org
> Date: Tue, 28 Jun 2016 19:51:57 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Intangible doesn't work because we deprecated it, and set
> > inhibit-point-motion-hooks to t; set it to nil, and it will work (but
> > you really should use the newer replacements).
> 
> That's `cursor-intangible'?

Yes.

> > However, this won't solve your problem, since the cursor position
> > before the stretch will always be visited, as intangible doesn't
> > affect it.
> >
> > We have on the C level a flag to avoid positioning cursor on a stretch
> > glyph (we use it for line-prefix and wrap-prefix), but we don't expose
> > it to Lisp.
> 
> So...  there is no easy way implement this in the current Emacs?

I don't think so, but maybe someone else will come up with some
rabbit-out-of-the-hat.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 18:12             ` Eli Zaretskii
@ 2016-06-28 18:17               ` Lars Magne Ingebrigtsen
  2016-06-28 18:23                 ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-06-28 18:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> So...  there is no easy way implement this in the current Emacs?
>
> I don't think so, but maybe someone else will come up with some
> rabbit-out-of-the-hat.

Using the :align-to specs judiciously (i.e., only inserting them where
they are needed), as well as a post-command-hook looking like

(defun meme--fix-point ()
  (let ((column (current-column)))
    (when (get-text-property (point) 'meme-intangible)
      (if (> column meme-column)
	  (forward-char 1)
	(backward-char 1))
      (setq column (current-column)))
    (setq meme-column column)))

seems to make all movement commands work as expected.  It's unfortunate
that this is needed, though...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 18:17               ` Lars Magne Ingebrigtsen
@ 2016-06-28 18:23                 ` Eli Zaretskii
  0 siblings, 0 replies; 20+ messages in thread
From: Eli Zaretskii @ 2016-06-28 18:23 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> Cc: emacs-devel@gnu.org
> Date: Tue, 28 Jun 2016 20:17:00 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> So...  there is no easy way implement this in the current Emacs?
> >
> > I don't think so, but maybe someone else will come up with some
> > rabbit-out-of-the-hat.
> 
> Using the :align-to specs judiciously (i.e., only inserting them where
> they are needed), as well as a post-command-hook looking like
> 
> (defun meme--fix-point ()
>   (let ((column (current-column)))
>     (when (get-text-property (point) 'meme-intangible)
>       (if (> column meme-column)
> 	  (forward-char 1)
> 	(backward-char 1))
>       (setq column (current-column)))
>     (setq meme-column column)))
> 
> seems to make all movement commands work as expected.  It's unfortunate
> that this is needed, though...

It shouldn't be hard to add the no-cursor condition, once its Lisp
form is defined.  It's just a flag in the glyph structure that needs
to be set, all the rest already works.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 13:32 Alignment and images Lars Magne Ingebrigtsen
  2016-06-28 16:24 ` Eli Zaretskii
  2016-06-28 17:44 ` Eli Zaretskii
@ 2016-06-28 21:17 ` Glenn Morris
  2016-06-28 22:00   ` Lars Magne Ingebrigtsen
  2 siblings, 1 reply; 20+ messages in thread
From: Glenn Morris @ 2016-06-28 21:17 UTC (permalink / raw)
  To: emacs-devel

Lars Magne Ingebrigtsen wrote:

> I wanted to implement a file browser for image files

Do you know about image-dired?
I imagine you'll dislike how it makes the thumbnails; bug#10758.




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 21:17 ` Glenn Morris
@ 2016-06-28 22:00   ` Lars Magne Ingebrigtsen
  2016-08-30 13:01     ` Mathias Dahl
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-06-28 22:00 UTC (permalink / raw)
  To: emacs-devel

Glenn Morris <rgm+news@gnu.org> writes:

> Lars Magne Ingebrigtsen wrote:
>
>> I wanted to implement a file browser for image files
>
> Do you know about image-dired?
> I imagine you'll dislike how it makes the thumbnails; bug#10758.

I think it's pretty ... bad.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 17:51           ` Lars Magne Ingebrigtsen
  2016-06-28 18:12             ` Eli Zaretskii
@ 2016-06-30 15:14             ` Ted Zlatanov
  2016-06-30 15:40               ` Lars Magne Ingebrigtsen
  2016-09-01 18:10             ` Alp Aker
  2 siblings, 1 reply; 20+ messages in thread
From: Ted Zlatanov @ 2016-06-30 15:14 UTC (permalink / raw)
  To: emacs-devel

On Tue, 28 Jun 2016 19:51:57 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> So...  there is no easy way implement this in the current Emacs?  Using
LMI> post-command-hook and keeping track of previous cursor positions seems
LMI> kinda ... non-optimal.

Maybe you can render with SVG, which lets you position and scale images
in arbitrary ways on a canvas? Then at the Emacs level, all the images
will be uniform.

Ted




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-30 15:14             ` Ted Zlatanov
@ 2016-06-30 15:40               ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 20+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-06-30 15:40 UTC (permalink / raw)
  To: emacs-devel

Ted Zlatanov <tzz@lifelogs.com> writes:

> Maybe you can render with SVG, which lets you position and scale images
> in arbitrary ways on a canvas? Then at the Emacs level, all the images
> will be uniform.

Hm...  that's true...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 22:00   ` Lars Magne Ingebrigtsen
@ 2016-08-30 13:01     ` Mathias Dahl
  2016-09-01 15:43       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 20+ messages in thread
From: Mathias Dahl @ 2016-08-30 13:01 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1864 bytes --]

>
> >> I wanted to implement a file browser for image files
> >
> > Do you know about image-dired?
> > I imagine you'll dislike how it makes the thumbnails; bug#10758.
>
> I think it's pretty ... bad.  :-)
>

Hi Lars Magne, heja Norge!

Since I initially wrote that little hack for my own needs, I know it was
useful for me back then, which means I will not take any offense :) Also,
since Richard approached me about including it in Emacs I thought it might
be of at least half-decent quality...

Out of curiosity, is there something in particular that is bad about it, or
do you dislike the whole thing? :-P I don't have much need for it anymore
but I did try it last year, just to see if it still worked, and I thought
it was quite simple to use, several years after I stopped using it myself.
As a local/personal hack, it's no problem but I never liked that it relies
on all those external tools, but there were no other options back then.
Perhaps the ImageMagick tools are not that bad in that they are quite
common, but then there is jpegtrans (for rotation, IIRC) and some Exif tool
as well...

Whatever you think of it, the approach of using thumbnails quite easily
avoids the issue you seem to want to solve. Perhaps you should give it a
try again, if you haven't already?

By the way, does anyone on the list know how much of the image handling
(create thumbnails and other resized versions of an image, non-lossy
rotatation of JPEG and Exif manipulation) that can be done if Emacs is
built with ImageMagick libs?

/Mathias

PS. There are some parts of image-dired.el that are really half-cooked. For
example there was some code to create HTML image galleries and some sort of
slideshow stuff that I'm not that proud of (but once server some need).
It's hard to know if we could rip such stuff out without risking annoying
users who might be using it...

[-- Attachment #2: Type: text/html, Size: 2352 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-08-30 13:01     ` Mathias Dahl
@ 2016-09-01 15:43       ` Lars Ingebrigtsen
  2016-09-01 16:18         ` Drew Adams
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Ingebrigtsen @ 2016-09-01 15:43 UTC (permalink / raw)
  To: Mathias Dahl; +Cc: emacs-devel

Mathias Dahl <mathias.dahl@gmail.com> writes:

> Out of curiosity, is there something in particular that is bad about
> it, or do you dislike the whole thing? :-P

Using external tools, creating temporary files, the way you have to tell
it to do things and then wait.  :-)

Images in dired should just work without you having to do anything.

There should be an easily reachable command in dired that would just
display a tooltip with the image displayed, and there should be a minor
mode that does that for all image files without having to do anything
except putting point on a line with an image file displayed.
Implementing this should be rather trivial, since Emacs has rather good
built-in image support now (on all normal systems; i.e., with
imagemagick support).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: Alignment and images
  2016-09-01 15:43       ` Lars Ingebrigtsen
@ 2016-09-01 16:18         ` Drew Adams
  0 siblings, 0 replies; 20+ messages in thread
From: Drew Adams @ 2016-09-01 16:18 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Mathias Dahl; +Cc: emacs-devel

> Images in dired should just work without you having to do anything.
> 
> There should be an easily reachable command in dired that would just
> display a tooltip with the image displayed,

This is available with `dired+.el'.  It would be easy to add it to
Emacs.  It is controlled by option `diredp-image-preview-in-tooltip':

  diredp-image-preview-in-tooltip is a variable defined in `dired+.el'.
  Its value is 100

  Documentation:
  Whether and what kind of image preview to show in a tooltip.
  The possible values are:

   `nil'       : do not show a tooltip preview
   integer N>0 : show a thumbnail preview of that size
   `full'      : show a full-size preview of the image

  To enable tooltip image preview you must turn on `tooltip-mode' and
  load library `image-dired.el'.  See also option
  `diredp-auto-focus-frame-for-thumbnail-tooltip-flag'.

You can use it to show a thumbnail (of any size) or the full-size image,
in a tooltip. 

There is also option `diredp-auto-focus-frame-for-thumbnail-tooltip-flag':

  diredp-auto-focus-frame-for-thumbnail-tooltip-flag is a variable defined in `dired+.el'.
  Its value is nil

  Documentation:
  Non-nil means automatically focus the frame for a thumbnail tooltip.
  If nil then you will not see a thumbnail image tooltip when you
  mouseover an image-file name in Dired, unless you first give the frame
  the input focus (e.g., by clicking its title bar).

There are also several image-related commands, including one that
shows a thumbnail of the image file of the current line using
`image-dired' (i.e., in a separate buffer), one that shows the
full image in a separate window or frame, and one that does the
latter for all marked image files

> and there should be a minor
> mode that does that for all image files without having to do anything
> except putting point on a line with an image file displayed.

See above.

> Implementing this should be rather trivial, since Emacs has rather good
> built-in image support now (on all normal systems; i.e., with
> imagemagick support).

https://www.emacswiki.org/emacs/download/dired%2b.el




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Alignment and images
  2016-06-28 17:51           ` Lars Magne Ingebrigtsen
  2016-06-28 18:12             ` Eli Zaretskii
  2016-06-30 15:14             ` Ted Zlatanov
@ 2016-09-01 18:10             ` Alp Aker
  2 siblings, 0 replies; 20+ messages in thread
From: Alp Aker @ 2016-09-01 18:10 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: Eli Zaretskii, Emacs devel

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]

On Tue, Jun 28, 2016 at 1:51 PM, Lars Magne Ingebrigtsen <larsi@gnus.org>
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")))

[-- Attachment #2: Type: text/html, Size: 1013 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-09-01 18:10 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-28 13:32 Alignment and images Lars Magne Ingebrigtsen
2016-06-28 16:24 ` Eli Zaretskii
2016-06-28 16:28   ` Lars Magne Ingebrigtsen
2016-06-28 16:39     ` Eli Zaretskii
2016-06-28 16:50       ` Lars Magne Ingebrigtsen
2016-06-28 17:43         ` Eli Zaretskii
2016-06-28 17:51           ` Lars Magne Ingebrigtsen
2016-06-28 18:12             ` Eli Zaretskii
2016-06-28 18:17               ` Lars Magne Ingebrigtsen
2016-06-28 18:23                 ` Eli Zaretskii
2016-06-30 15:14             ` Ted Zlatanov
2016-06-30 15:40               ` Lars Magne Ingebrigtsen
2016-09-01 18:10             ` Alp Aker
2016-06-28 17:44 ` Eli Zaretskii
2016-06-28 17:53   ` Lars Magne Ingebrigtsen
2016-06-28 21:17 ` Glenn Morris
2016-06-28 22:00   ` Lars Magne Ingebrigtsen
2016-08-30 13:01     ` Mathias Dahl
2016-09-01 15:43       ` Lars Ingebrigtsen
2016-09-01 16:18         ` Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).