[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how-many/count-matches for non-interactive use

From: David Kastrup
Subject: Re: how-many/count-matches for non-interactive use
Date: Wed, 20 Oct 2004 03:35:27 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Luc Teirlinck <address@hidden> writes:

> Actually, one has to be a lot _more_ careful with messages during
> macro execution than during Lisp function execution.  The absolute
> _worst_ time to print messages is during long loops.  It slows things
> down tremendously and hopelessly clobbers *Messages*.  I use most
> keyboard macros with very large or zero numeric arguments, that is, in
> long loops.  I suspect most people do.

(defun execute-keyboard-macro
  (let (saved-message)
     (flet (message (&rest args) (setq saved-message args))
        [execute the keyboard macro as often as wanted])
     (when saved-message
        (message "In macro: %s" (apply #'format saved-message)))))

Something like that.  Note that only the last message will actually
get formatted.     

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

[Prev in Thread] Current Thread [Next in Thread]