[comp.emacs] info needed on "message" function

jackr@dblues.wpd.sgi.com (John "Jack" Repenning) (04/19/91)

In article <71902@eerie.acsu.Buffalo.EDU> triantos@acsu.buffalo.edu (Nick B Triantos) writes:

   My problem: I can't find where the defun or
   defmacro for message is.  Any suggestions?

It's in editfns.c - it's not in LISP, but rather in C.  Despite
popular speach (and even some comments in the code), message doesn't
print in the minibuffer, but into the "echo area."  Here's a note from
the "GNU Emacs Lisp Reference Manual," Section 34.4, [Emacs Display]:

	The "echo area" is used for displaying messages made with the
	"message" primitive, and for echoing keystrokes.  It is not
	the same as the minibuffer, despite the fact that the
	minibuffer appears (when active) in the same place on the
	screen as the echo area. ...

	You can write output in the echo area by using the Lisp
	printing functions with "t" as the stream (see Section 16.4.1
	[Output Functions], page 210), or as follows:

"As follows" is the message function.

The other section, 16.4.1, includes the functions print, prin1, princ,
terpri, and write-char, among others.  Try a few of them.  Or, just
use message in your code.



Jack Repenning			9U-530	     jackr@wpd.sgi.com
Silicon Graphics, Inc.		            Off:(415) 335-7477
Systems Software Technology Center	    Fax:(415) 969-2314

triantos@acsu.buffalo.edu (Nick B Triantos) (04/20/91)

Hello.  I am trying to make a new function to replace "message", which will put
the message on the bottom line, but also append it to a *message* buffer if a
variable is set.  Maybe there's already someone else who's done that, but I'd
like to try to do it myself.  My problem: I can't find where the defun or
defmacro for message is.  Any suggestions?
      Thanks.
            -Nick Triantos

acevedo@athena.mit.edu (Gabriel) (05/01/91)

  Hello.  I am trying to make a new function to replace "message", which will put
  the message on the bottom line, but also append it to a *message* buffer if a
  variable is set.  Maybe there's already someone else who's done that, but I'd
  like to try to do it myself.  My problem: I can't find where the defun or
  defmacro for message is.  Any suggestions?

`message' is written in C, not elisp.  You have to bind a variable to
the (symbol-function 'message), then re-defun message to do what you
want with the *message* buffer, and then `funcall' the variable which
has the original (symbol-function 'message).

I have code that does something similar; instead of putting it in a
buffer, it puts in a list.  If you want a copy of it, send me mail. 

--
Raul Acevedo
acevedo@athena.mit.edu

"Remember, Information is not knowledge; Knowledge is not Wisdom;
Wisdom is not truth; Truth is not beauty; Beauty is not love;
Love is not music; Music is the best."
	 - Frank Zappa

darrylo@hpnmdla.hp.com (Darryl Okahata) (05/07/91)

In comp.emacs, triantos@acsu.buffalo.edu (Nick B Triantos) writes:

> Hello.  I am trying to make a new function to replace "message",
> which will put the message on the bottom line, but also append it to
> a *message* buffer if a variable is set.  Maybe there's already
> someone else who's done that, but I'd like to try to do it myself.

     Well, just for your information, it's already been done.

-------------------------------------------------------------------------------
;;; log-messages.el - facility to log the output of the "message" function.
;;; 
;;; Have you ever been frustrated by not being able to read an emacs message
;;; because it gets overwritten by another message?  Then this package is for
;;; you.  By setting the user variable "log-messages" to non-nil, you can have
;;; the messages logged for you in the buffer "*Message Log*".
;;; 
;;; The variable "non-logged-message-regexps" lets you filter out messages you
;;; know you don't want logged.  I'm not sure how useful this really is, but
;;; it's there if you want it.
;;; 
;;; Unfortunately, some messages you see in the minibuffer are not produced
;;; using the "message" function, so they will not be logged.
-------------------------------------------------------------------------------

It was posted to gnu.emacs.sources on October 18, 1990.

     -- Darryl Okahata
	UUCP: {hplabs!, hpcea!, hpfcla!} hpnmd!darrylo
	Internet: darrylo%sr@relay.hp.com

DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion or policy of Hewlett-Packard or of the
little green men that have been following him all day.