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: Mon, 18 Oct 2004 20:58:53 -0500 (CDT) Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <200410190158.i9J1wrH25523@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> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1098151259 29079 80.91.229.6 (19 Oct 2004 02:00:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Oct 2004 02:00:59 +0000 (UTC) Cc: storm@cua.dk, monnier@iro.umontreal.ca, alexander.pohoyda@gmx.net, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 19 04:00:43 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 1CJjIp-00086E-00 for ; Tue, 19 Oct 2004 04:00:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CJjQ9-0007H2-8o for ged-emacs-devel@m.gmane.org; Mon, 18 Oct 2004 22:08:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CJjQ2-0007Gu-M7 for emacs-devel@gnu.org; Mon, 18 Oct 2004 22:08:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CJjQ2-0007Gi-7Z for emacs-devel@gnu.org; Mon, 18 Oct 2004 22:08:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CJjQ2-0007Gf-5W for emacs-devel@gnu.org; Mon, 18 Oct 2004 22:08:10 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CJjIa-0005oP-03; Mon, 18 Oct 2004 22:00:28 -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 i9J20DiU027147; Mon, 18 Oct 2004 21:00:13 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id i9J1wrH25523; Mon, 18 Oct 2004 20:58:53 -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 Mon, 18 Oct 2004 09:59:20 -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:28584 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28584 Richard Stallman wrote: The immediate problem is that there are many uses of interactive-p, and many of them, perhaps all, are now incorrect. We need to either change those uses or change interactive-p. It would definitely seem to be a lot better to change existing "incorrect" (whatever that means, it seems to be completely subjective) uses than to change `interactive-p'. This way we will not break any currently correct code in the Emacs distribution, third party packages, user Elisp functions and, most importantly, user defined keyboard macros. The current behavior has been in place for a long time and users have defined (and saved) their keyboard macros to work with that behavior. The most convenient way to change any currently "wrong" uses would, in my opinion, be to go with Kim's suggestion: (interactive-p) => current behaviour (interactive-p t) => interactive or executing macro (interactive-p 1) => interactive or executing macro ONCE I am not _completely_ sure about the last line, however. The first step in fixing this is to take inventory. Which uses of interactive-p are correct with the current definition of interactive-p? Which would be correct with the modified definition of interactive-p that would not check for macros? I doubt that many uses are going to be obviously "correct" or "incorrect". It all depends on what the keyboard macro in which it is going to be used is designed to do. But users have designed (and saved) their keyboard macros to work with the current behavior. I believe we should be very conservative before changing the current behavior for any individual function. Certainly, we should not change the default behavior of `interactive-p'. Would someone like to check them? There are tons of them. We can have 100 message long discussions about nearly every single one of them, because all of them are likely to be subjective and depend on the type of keyboard macro. If we leave _everything_ as is we will not break one single currently correct keyboard macro. In as far as the current example is concerned, it would seem _wrong_ to _try_ to show the how-many/count-matches messages in an executing keyboard macro, like it is wrong to _try_ to show _any_ message in a keyboard macro. The reason for that is that it does not work anyway. Try the following. emacs -q C-M-x the following: (defun myfun () (interactive) (message "This is the message")) Note, no `interactive-p'. Move point to end of buffer. C-x ( a M-x myfun RET C-x ) We now have defined a keyboard macro. Question: How do we execute this macro in such a way that "This is the message" gets printed in the echo area? It does reliably get printed to *Messages*, but how many users routinely check *Messages*? Maybe the above could be considered a bug that should be fixed. But even if this "bug" would be fixed, then if the macro is executed with `C-x e', the "(Type e to repeat macro)" message will still overwrite any message that the macro would try to print. Sincerely, Luc.