[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Displaying scrollable images in a grid-layout
From: |
Andreas Politz |
Subject: |
Re: Displaying scrollable images in a grid-layout |
Date: |
Mon, 13 Apr 2015 21:35:40 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
> I cannot try your recipe [...]
Try this:
(defun show-data-dir-images (&optional ncolumns)
(interactive (list 4))
(let* ((files (directory-files
(expand-file-name "images" data-directory)
no-dot-files))
(column 0))
(with-current-buffer (get-buffer-create "*images*")
(erase-buffer)
(save-excursion
(dolist (f files)
(when (and (file-regular-p f)
(file-name-extension f)
(image-type-available-p
(intern (downcase (file-name-extension f)))))
(insert-image (create-image f))
(when (= (cl-incf column) ncolumns)
(insert ?\n)
(setq column 0)))))
(setq-local scroll-conservatively 0)
(setq-local scroll-step 0)
(setq-local scroll-up-aggressively nil)
(display-buffer (current-buffer)))))
> That being said, I think you are missing the PIXELWISE-P argument of
> both window-vscroll and set-window-vscroll. Aren't you?
No both versions do nothing with above scroll settings for any argument
I've tried (unless the window is smaller than the first displayed
image).
> If not, please elaborate on what kind of partial scrolling did you
> want to see.
>
doc-view let's you scroll the page, i.e. the image is only partially
visible. I want the same behaviour for more than one image in the
buffer. Possible display state with 2 images:
................
. . Image 1
. .
+.--------------.+
|. .|
|. .| Window
|. .|
|................|
|................|
|. .|
|. .|
+.--------------.+
. .
. . Image 2
. .
................
But:
(set-window-vscroll nil 10) => Nothing happens.
(set-window-vscroll nil 99) => Nothing happens.
(set-window-vscroll nil 100 t) => Nothing.
(setq-local scroll-step 1)
(set-window-vscroll nil 10) => Scrolls, but:
Redisplay performance (or something else) greatly suffers, i.e. opening
e.g. the M-x prompt after I have executed the above 2 commands takes
about one second. (I have tested this with emacs-git -Q .)
>> But it slows down redisplay considerably, to a point where it
>> becomes unusable.
>
> And there's one more thing that confuses me in this statement: partial
> pixel-wise scrolling will always be slow,
Not like that.
> so I'm not sure what exactly you expected to happen. Probably again
> it goes back to the fact that I'm not sure what you were trying to
> accomplish, or why.
See above.
Thanks for your answer.
-ap
- Displaying scrollable images in a grid-layout, Andreas Politz, 2015/04/13
- Re: Displaying scrollable images in a grid-layout, Eli Zaretskii, 2015/04/13
- Re: Displaying scrollable images in a grid-layout,
Andreas Politz <=
- Re: Displaying scrollable images in a grid-layout, Eli Zaretskii, 2015/04/13
- Re: Displaying scrollable images in a grid-layout, Tassilo Horn, 2015/04/14
- Re: Displaying scrollable images in a grid-layout, Stefan Monnier, 2015/04/14
- Re: Displaying scrollable images in a grid-layout, Tassilo Horn, 2015/04/14
- Re: Displaying scrollable images in a grid-layout, Stefan Monnier, 2015/04/14
- Re: Displaying scrollable images in a grid-layout, Rasmus, 2015/04/14
- Re: Displaying scrollable images in a grid-layout, Eli Zaretskii, 2015/04/14
- Re: Displaying scrollable images in a grid-layout, Tassilo Horn, 2015/04/14
- Re: Displaying scrollable images in a grid-layout, Eli Zaretskii, 2015/04/14
- Re: Displaying scrollable images in a grid-layout, Yuri Khan, 2015/04/15