From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: how-many/count-matches for non-interactive use Date: Wed, 20 Oct 2004 22:08:13 -0500 (CDT) Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <200410210308.i9L38Dm10997@raven.dms.auburn.edu> References: <87pt3m5vqk.fsf@oak.pohoyda.family> <87zn2mh5jk.fsf-monnier+emacs@gnu.org> <87is99nznd.fsf-monnier+emacs@gnu.org> <200410172053.i9HKrdL01136@raven.dms.auburn.edu> <200410190158.i9J1wrH25523@raven.dms.auburn.edu> <200410200127.i9K1Rpp28384@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1098328244 10222 80.91.229.6 (21 Oct 2004 03:10:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Oct 2004 03:10:44 +0000 (UTC) Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, alexander.pohoyda@gmx.net, storm@cua.dk Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 21 05:10:33 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CKTLV-0003SD-00 for ; Thu, 21 Oct 2004 05:10:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CKTSv-00080B-5y for ged-emacs-devel@m.gmane.org; Wed, 20 Oct 2004 23:18:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CKTSo-000800-HF for emacs-devel@gnu.org; Wed, 20 Oct 2004 23:18:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CKTSn-0007zi-Ri for emacs-devel@gnu.org; Wed, 20 Oct 2004 23:18:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CKTSn-0007zY-P7 for emacs-devel@gnu.org; Wed, 20 Oct 2004 23:18:05 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CKTKz-0001N0-J5; Wed, 20 Oct 2004 23:10:01 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id i9L39ciU008171; Wed, 20 Oct 2004 22:09:38 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id i9L38Dm10997; Wed, 20 Oct 2004 22:08:13 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Wed, 20 Oct 2004 21:45:45 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28683 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28683 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.