changeset 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 5a93f519accc
children c96000075e49
files lisp/ChangeLog lisp/gutter-items.el lisp/simple.el
diffstat 3 files changed, 22 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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  <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.
+
 2015-04-03  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* gnuserv.el (gnuserv-edit-files):
--- 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))
--- 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)