Function: message-insert-screenshot
message-insert-screenshot is an interactive and byte-compiled function
defined in message.el.gz.
Signature
(message-insert-screenshot DELAY)
Documentation
Take a screenshot and insert in the current buffer.
DELAY (the numeric prefix) says how many seconds to wait before starting the screenshotting process.
The message-screenshot-command variable says what command is
used to take the screenshot.
Probably introduced at or before Emacs version 28.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/message.el.gz
(defun message-insert-screenshot (delay)
"Take a screenshot and insert in the current buffer.
DELAY (the numeric prefix) says how many seconds to wait before
starting the screenshotting process.
The `message-screenshot-command' variable says what command is
used to take the screenshot."
(interactive "p" message-mode)
(unless (executable-find (car message-screenshot-command))
(error "Can't find %s to take the screenshot"
(car message-screenshot-command)))
(cl-decf delay)
(unless (zerop delay)
(dotimes (i delay)
(message "Sleeping %d second%s..."
(- delay i)
(if (= (- delay i) 1)
""
"s"))
(sleep-for 1)))
(message "Take screenshot")
(let ((image
(with-temp-buffer
(set-buffer-multibyte nil)
(apply #'call-process
(car message-screenshot-command) nil (current-buffer) nil
(cdr message-screenshot-command))
(buffer-string))))
(message--yank-media-image-handler 'image/png image)
(message "")))