Path: utzoo!attcan!uunet!husc6!bbn!gateway!PEBBLES.BBN.COM!jr From: jr@PEBBLES.BBN.COM (John Robinson) Newsgroups: comp.emacs Subject: Re: Playing with the minibuffer Message-ID: <367.582840018@pebbles> Date: 20 Jun 88 20:00:18 GMT References: <8806201232.AA03336@marvin.cme.nbs.gov> Sender: news@bbn.COM Reply-To: jr@bbn.com Organization: BBN news/mail gateway Lines: 50 Stephe Leake had a good idea: > In DEC's LSE, _all_ messages (system broadcast, editor error messages, > etc) get _appended_ to a $MESSAGE buffer, which the user can edit as a normal > buffer. I find this _very_ useful for keeping track of what I'm doing, > since I usually seem to be doing several things at once (waiting for > something to compile or link, answering a mail message that just came > in, etc). It appears that this approach would satisfy the recent > requests for minibuffer string access. How 'bout it? Is there anyway > to automatically capture any string written to the minibuffer, and > stuff it in $MESSAGE? Perhaps we could just rewrite (message), or > something. I tried to do this with only some success. My code follows at the end of this message. It uses code Mark Weissman posted for adding before- and after-hooks to functions. This does not work perfectly. The problem is that the functions (message) and (error) are built-in. While the hooks are applied any time the functions are called from ELisp, the old definitions remain in force for calls from C (which are linked). I am going to give up on this for now, hoping that someone with a stronger stomach might take on the C mods. It may turn out that the minibuffer needs to be rethought, so be warned. I like Stephe's approach, though. I apologize if this isn't the best of ELisp. /jr jr@bbn.com or bbn!jr ------- (load-library "hooks") ; Mark Weissman's hooks library (defun save-to-message-buffer (string &rest args) "Before-hook for (message) and (error). Appends a copy of each minibuffer message to the buffer *messages*." (interactive) (save-window-excursion (set-buffer (get-buffer-create "*messages*")) (goto-char (point-max)) (insert-string (format string args)) (insert-char ?\n 1))) (mdw:add-hooks message) (setq mdw:message-before-hooks '(save-to-message-buffer)) (mdw:add-hooks error) (setq mdw:error-before-hooks '(save-to-message-buffer)) -------