From 1b0a9f62c9ea2e577a72ecf1c180713471b965fb Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Wed, 25 Aug 2004 20:20:24 +0000 Subject: Add pg-internal-warning. Use display-warning for that and proof-debug, if available. --- generic/proof-utils.el | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'generic') diff --git a/generic/proof-utils.el b/generic/proof-utils.el index 67f5e462..a2d1c8e2 100644 --- a/generic/proof-utils.el +++ b/generic/proof-utils.el @@ -590,22 +590,25 @@ The warning is coloured with proof-warning-face." (pg-response-display-with-face (apply 'concat args) 'proof-warning-face) (proof-display-and-keep-buffer proof-response-buffer)) -(defun pg-internal-warning (message) - "Display internal warning MESSAGE." - (if (fboundp 'display-warning) - (display-warning 'proof-general message) - (message message))) +(defun pg-internal-warning (message &rest args) + "Display internal warning MESSAGE with ARGS as for format." + (let ((formatted (apply 'format message args))) + (if (fboundp 'display-warning) + (display-warning 'proof-general formatted) + (message formatted)))) ;; could be a macro for efficiency in compiled code (defun proof-debug (msg &rest args) "Issue the debugging message (format MSG ARGS) in the response buffer, display it. If proof-show-debug-messages is nil, do nothing." (if proof-show-debug-messages - (progn - (pg-response-display-with-face (concat "PG debug: " - (apply 'format msg args)) - 'proof-debug-message-face) - (proof-display-and-keep-buffer proof-response-buffer)))) + (let ((formatted (apply 'format msg args))) + (if (fboundp 'display-warning) ;; use builtin warning system in XEmacs + (display-warning 'proof-general formatted 'info) + ;; otherwise use response buffer with dedicated font, & display it + (progn + (pg-response-display-with-face 'proof-debug-message-face) + (proof-display-and-keep-buffer proof-response-buffer)))))) ;;; A handy utility function used in the "Buffers" menu, and throughout -- cgit v1.2.3