Fitting images to Emacs screen width
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
VM |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Blueman (vm.info, 2010-01-04)
On the rare occassions that I use a graphical emacs terminal, I have
noted that images don't seem to "fit to screen". Even worse, while you
can scroll vertically, there doesn't seem to be any horizontal
scrollbar.
Of course you can use the vm-menu-
by 2X but that is pretty course adjustment.
So, I long ago wrote a very simple routine that fits the image to screen
and I also added the routine to the images menu.
However, I'm not sure where is the best place to add this routine so
that any oversized images automatically are resized to fit at least
within the screen width (and perhaps also within the height too).
Anyway, in case anyone else is interested, here is the manual routine I
use:
;; Stretch/Shrink mime image to fit exactly in frame width.
;; The shrink functionality is particularly helpful since images displayed
;; by emacs look wacked when they extend past a line width
(defun vm-mime-
"Stretch/Shrink mime image to fit exactly in frame width (JJK)."
(let* ((layout (vm-extent-property extent 'vm-mime-layout))
;; Emacs 19 uses a different layout cache than XEmacs or Emacs 21+.
;; The cache blob is a list in that case.
(if (consp blob) (setq blob (car blob)))
(setq dims (vm-get-
(setq factor (/ (float (* (1- (frame-width)) (frame-
(vm-
;; Functionality to add above function to: vm-menu-
;; Also add functions to: vm-menu-
(add-hook 'vm-menu-setup-hook
Changed in vm: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |