emacs-devel
[Top][All Lists]
Advanced

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

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


From: Luc Teirlinck
Subject: Re: how-many/count-matches for non-interactive use
Date: Wed, 20 Oct 2004 22:08:13 -0500 (CDT)

What I do not understand at all is:

If it is so important for a message to be printed to *Messages*,
during execution of a keyboard macro, then why would it no longer be
important if the user wants to increase efficiency by converting the
macro to an Elisp function?

This thread started with the following (quoted from Alexander
Pohoyda):

   The `how-many' function is not especially friendly for non-interactive
   use, because is issues a message.

Unless I missed it, no example of a Lisp function calling `how-many'
where this caused problems was given.  But assuming there is such a
function, then assuming that a non-Elisp programmer wants to achieve a
similar functionality using a keyboard macro instead of a function,
why would it no longer be a nuisance?  Because it is not printed in
the echo area?  The person getting the functionality from a keyboard
macro apparently needs to have the message printed to *Messages*.  Why
does the person getting the functionality from a Lisp function not
need that?

In other words, instead of changing the behavior of `interactive-p',
it would seem to make relatively more sense to do (in the `how-many' code
and any similar places):

(if (interactive-p)
    (message "%d occurrences" count)
  (with-current-buffer "*Messages*"
    (insert (format "%d occurrences" count))))

or something similar.

Sincerely,

Luc.




reply via email to

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