diff options
author | Erik Naggum <erik@naggum.no> | 1996-08-14 02:09:54 +0000 |
---|---|---|
committer | Erik Naggum <erik@naggum.no> | 1996-08-14 02:09:54 +0000 |
commit | 11a2798ebc57309057ed7b90d8354885a9e6fa9b (patch) | |
tree | 73e8d3a01e82401c887c23ab8a7ee81100efa6bf /lisp/message.el | |
parent | d3faa68fc65c5f4dbf1b7ef3ebda3ba68870dcba (diff) | |
download | emacs-11a2798ebc57309057ed7b90d8354885a9e6fa9b.tar.gz |
(message-y-or-n-p, message-talkative-question, message-flatten-list,
message-flatten-list-1): Move utility functions up so macro is defined
before first invocation.
Diffstat (limited to 'lisp/message.el')
-rw-r--r-- | lisp/message.el | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/lisp/message.el b/lisp/message.el index 1986454bb7e..33920059a82 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -679,6 +679,32 @@ Return the number of headers removed." (1+ max))))) (message-sort-headers-1)))) +(defmacro message-y-or-n-p (question show &rest text) + "Ask QUESTION, displaying the rest of the arguments in a temporary buffer." + `(message-talkative-question 'y-or-n-p ,question ,show ,@text)) + +(defun message-talkative-question (ask question show &rest text) + "Call FUNCTION with argument QUESTION, displaying the rest of the arguments in a temporary buffer if SHOW. +The following arguments may contain lists of values." + (if (and show + (setq text (message-flatten-list text))) + (save-window-excursion + (save-excursion + (with-output-to-temp-buffer " *MESSAGE information message*" + (set-buffer " *MESSAGE information message*") + (mapcar 'princ text) + (goto-char (point-min)))) + (funcall ask question)) + (funcall ask question))) + +(defun message-flatten-list (&rest list) + (message-flatten-list-1 list)) + +(defun message-flatten-list-1 (list) + (cond ((consp list) + (apply 'nconc (mapcar 'message-flatten-list-1 list))) + (list + (list list)))) ;;; @@ -2964,35 +2990,6 @@ Do a `tab-to-tab-stop' if not in those headers." (goto-char (point-min)) (pop-to-buffer cur))))))) -;;; Help stuff. - -(defmacro message-y-or-n-p (question show &rest text) - "Ask QUESTION, displaying the rest of the arguments in a temporary buffer." - `(message-talkative-question 'y-or-n-p ,question ,show ,@text)) - -(defun message-talkative-question (ask question show &rest text) - "Call FUNCTION with argument QUESTION, displaying the rest of the arguments in a temporary buffer if SHOW. -The following arguments may contain lists of values." - (if (and show - (setq text (message-flatten-list text))) - (save-window-excursion - (save-excursion - (with-output-to-temp-buffer " *MESSAGE information message*" - (set-buffer " *MESSAGE information message*") - (mapcar 'princ text) - (goto-char (point-min)))) - (funcall ask question)) - (funcall ask question))) - -(defun message-flatten-list (&rest list) - (message-flatten-list-1 list)) - -(defun message-flatten-list-1 (list) - (cond ((consp list) - (apply 'append (mapcar 'message-flatten-list-1 list))) - (list - (list list)))) - (run-hooks 'message-load-hook) (provide 'message) |