comparison lisp/simple.el @ 5885:c8bbb32fe124

Always return a string, #'current-message. lisp/ChangeLog addition: 2015-04-04 Aidan Kehoe <kehoea@parhasard.net> * gutter-items.el (append-progress-feedback): * gutter-items.el (abort-progress-feedback): Correct comments in both these functions, it's the progress stack being adjusted, not the message stack. * simple.el (message-stack): Describe my recent change in the structure of this. * simple.el (current-message): Adjust the implementation of this to always return the string displayed.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 04 Apr 2015 13:49:30 +0100
parents f9e59cd39a9a
children bd4d2c8ef9cc
comparison
equal deleted inserted replaced
5884:5a93f519accc 5885:c8bbb32fe124
4188 (send-string-to-terminal "\n")) 4188 (send-string-to-terminal "\n"))
4189 4189
4190 (defvar message-stack nil 4190 (defvar message-stack nil
4191 "An alist of label/string pairs representing active echo-area messages. 4191 "An alist of label/string pairs representing active echo-area messages.
4192 The first element in the list is currently displayed in the echo area. 4192 The first element in the list is currently displayed in the echo area.
4193 Do not modify this directly--use the `message' or 4193
4194 `display-message'/`clear-message' functions.") 4194 Each string is represented by a STRING START END triplet, reflecting the
4195 MESSAGE, START, and END arguments to `append-message'.
4196
4197 Do not modify this directly--use the `message', `display-message', or
4198 `clear-message' functions.")
4195 4199
4196 (defvar remove-message-hook 'log-message 4200 (defvar remove-message-hook 'log-message
4197 "A function or list of functions to be called when a message is removed 4201 "A function or list of functions to be called when a message is removed
4198 from the echo area at the bottom of the frame. The label of the removed 4202 from the echo area at the bottom of the frame. The label of the removed
4199 message is passed as the first argument, the text of the message as the second 4203 message is passed as the first argument, the text of the message as the second
4564 (append-message label message frame stdout-p)) 4568 (append-message label message frame stdout-p))
4565 4569
4566 (defun current-message (&optional frame) 4570 (defun current-message (&optional frame)
4567 "Return the current message in the echo area, or nil. 4571 "Return the current message in the echo area, or nil.
4568 The FRAME argument is currently unused." 4572 The FRAME argument is currently unused."
4569 (cdr (car message-stack))) 4573 (subseq (cadar message-stack) (or (caddar message-stack) 0)
4574 (fourth (car message-stack))))
4570 4575
4571 ;;; may eventually be frame-dependent 4576 ;;; may eventually be frame-dependent
4572 (defun current-message-label (&optional frame) 4577 (defun current-message-label (&optional frame)
4573 (car (car message-stack))) 4578 (car (car message-stack)))
4574 4579