# HG changeset patch # User Aidan Kehoe # Date 1428151770 -3600 # Node ID c8bbb32fe124a4e1c6f6b0f66a721c3395e0a539 # Parent 5a93f519accc9d69a7e852c25b37a5cbe86fb436 Always return a string, #'current-message. lisp/ChangeLog addition: 2015-04-04 Aidan Kehoe * 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. diff -r 5a93f519accc -r c8bbb32fe124 lisp/ChangeLog --- a/lisp/ChangeLog Fri Apr 03 00:27:59 2015 +0100 +++ b/lisp/ChangeLog Sat Apr 04 13:49:30 2015 +0100 @@ -1,3 +1,15 @@ +2015-04-04 Aidan Kehoe + + * 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. + 2015-04-03 Aidan Kehoe * gnuserv.el (gnuserv-edit-files): diff -r 5a93f519accc -r c8bbb32fe124 lisp/gutter-items.el --- a/lisp/gutter-items.el Fri Apr 03 00:27:59 2015 +0100 +++ b/lisp/gutter-items.el Sat Apr 04 13:49:30 2015 +0100 @@ -543,7 +543,7 @@ (defun append-progress-feedback (label message &optional value frame) (or frame (setq frame (selected-frame))) - ;; Add a new entry to the message-stack, or modify an existing one + ;; Add a new entry to the progress-stack, or modify an existing one (let* ((top (car progress-stack)) (tmsg (cdr top))) (if (eq label (car top)) @@ -568,7 +568,7 @@ progress-feedback-use-echo-area) (display-message label (concat message "aborted.") frame) (or frame (setq frame (selected-frame))) - ;; Add a new entry to the message-stack, or modify an existing one + ;; Add a new entry to the progress-stack, or modify an existing one (let* ((top (car progress-stack)) (inhibit-read-only t)) (if (eq label (car top)) diff -r 5a93f519accc -r c8bbb32fe124 lisp/simple.el --- a/lisp/simple.el Fri Apr 03 00:27:59 2015 +0100 +++ b/lisp/simple.el Sat Apr 04 13:49:30 2015 +0100 @@ -4190,8 +4190,12 @@ (defvar message-stack nil "An alist of label/string pairs representing active echo-area messages. The first element in the list is currently displayed in the echo area. -Do not modify this directly--use the `message' or -`display-message'/`clear-message' functions.") + +Each string is represented by a STRING START END triplet, reflecting the +MESSAGE, START, and END arguments to `append-message'. + +Do not modify this directly--use the `message', `display-message', or +`clear-message' functions.") (defvar remove-message-hook 'log-message "A function or list of functions to be called when a message is removed @@ -4566,7 +4570,8 @@ (defun current-message (&optional frame) "Return the current message in the echo area, or nil. The FRAME argument is currently unused." - (cdr (car message-stack))) + (subseq (cadar message-stack) (or (caddar message-stack) 0) + (fourth (car message-stack)))) ;;; may eventually be frame-dependent (defun current-message-label (&optional frame)