* How can I get the last message outputted?
@ 2020-10-28 5:03 Emanuel Berg via Users list for the GNU Emacs text editor
0 siblings, 0 replies; only message in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-10-28 5:03 UTC (permalink / raw)
To: help-gnu-emacs
T2C - The Emacs Challenge Competition - round 4
How do I get the last message that was outputted?
How can I get the last message?
(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 (point-at-bol))
(end (point-at-eol)) )
(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)
PS. Yes, tha were tArcee and Hot Rod. 1986 TF:TM <3
--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-28 5:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-28 5:03 How can I get the last message outputted? Emanuel Berg via Users list for the GNU Emacs text editor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).