Function: shr-zoom-image

shr-zoom-image is an interactive and byte-compiled function defined in shr.el.gz.

Signature

(shr-zoom-image)

Documentation

Cycle the image size.

The size will cycle through the default size, the original size, and full-buffer size.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/net/shr.el.gz
(defun shr-zoom-image ()
  "Cycle the image size.
The size will cycle through the default size, the original size, and
full-buffer size."
  (interactive)
  (let ((url (get-text-property (point) 'image-url)))
    (if (not url)
	(message "No image under point")
      (let* ((end (or (next-single-property-change (point) 'image-url)
                      (point-max)))
             (start (or (previous-single-property-change end 'image-url)
                        (point-min)))
             (size (get-text-property (point) 'image-size))
             (next-size (cond ((or (eq size 'default)
                                   (null size))
                               'original)
                              ((eq size 'original)
                               'full)
                              ((eq size 'full)
                               'default)))
             (buffer-read-only nil))
        ;; Delete the old picture.
        (put-text-property start end 'display nil)
        (message "Inserting %s..." url)
        (url-retrieve url #'shr-image-fetched
                      `(,(current-buffer) ,start
                        ,(set-marker (make-marker) end)
                        ((size . ,next-size)))
                      t)))))