;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/echo-message.el (defun get-last-message () (interactive) (let ((msg-buffer (get-buffer "*Messages*"))) (when msg-buffer (with-temp-buffer (insert-buffer-substring msg-buffer) (goto-char (point-max)) (forward-line -1) (let ((beg (line-beginning-position)) (end (line-beginning-position)) ) (buffer-substring-no-properties beg end) ))))) ;; (message "I was afraid you'd be trapped outside the city.") ;; (message "Hey, I wasn't worried for a microsecond!") ;; (message "Then you probably didn't understand the situation.") ;; ;; (get-last-message) (provide 'echo-message)