From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: how-many/count-matches for non-interactive use Date: Sat, 23 Oct 2004 14:49:03 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: 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> <200410210308.i9L38Dm10997@raven.dms.auburn.edu> <200410222222.i9MMMD515903@raven.dms.auburn.edu> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1098557420 28131 80.91.229.6 (23 Oct 2004 18:50:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 23 Oct 2004 18:50:20 +0000 (UTC) Cc: jpw@gnu.org, klm@zope.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, storm@cua.dk, alexander.pohoyda@gmx.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 23 20:50:14 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 1CLQxy-0005Up-00 for ; Sat, 23 Oct 2004 20:50:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CLR5W-0004d9-Sd for ged-emacs-devel@m.gmane.org; Sat, 23 Oct 2004 14:58:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CLR4d-000431-RE for emacs-devel@gnu.org; Sat, 23 Oct 2004 14:57:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CLR4c-00041s-FS for emacs-devel@gnu.org; Sat, 23 Oct 2004 14:57:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CLR4c-00041N-9A for emacs-devel@gnu.org; Sat, 23 Oct 2004 14:57:06 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CLQx2-000685-Hv for emacs-devel@gnu.org; Sat, 23 Oct 2004 14:49:16 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1CLQwp-0003vk-0p; Sat, 23 Oct 2004 14:49:03 -0400 Original-To: Luc Teirlinck In-reply-to: <200410222222.i9MMMD515903@raven.dms.auburn.edu> (message from Luc Teirlinck on Fri, 22 Oct 2004 17:22:13 -0500 (CDT)) 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:28796 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28796 For most others, the current behavior prevents nuisance messaging, as intended. Could you tell me some of the functions where you reached this conclusion? I checked it now. The functions `set-left-margin' and `set-right-margin' do not give any problems with keyboard macros. However, their call to `interactive-p' is a useless and ugly no-op. It is not a no-op, but it is not correct either. These commands as currently written would behave incorrectly in some cases in a keyboard macro. They are certainly instances of the problem I was worried about: expecting interactive-p not to be affected by keyboard macros. They need to be fixed. Your approach to the third one is to replace interactive-p with t (in effect). I think that is the right approach for all three. Your approach to the first two is to delete the call to prefix-numeric-value. As far as I can see, that would extend the bug to the non-macro case. So I think this is the right fix for those. *** indent.el 12 Oct 2004 04:45:09 -0400 1.58 --- indent.el 23 Oct 2004 13:29:00 -0400 *************** *** 205,211 **** Interactively, WIDTH is the prefix argument, if specified. Without prefix argument, the command prompts for WIDTH." (interactive "r\nNSet left margin to column: ") ! (if (interactive-p) (setq width (prefix-numeric-value width))) (save-excursion ;; If inside indentation, start from BOL. (goto-char from) --- 205,211 ---- Interactively, WIDTH is the prefix argument, if specified. Without prefix argument, the command prompts for WIDTH." (interactive "r\nNSet left margin to column: ") ! (setq width (prefix-numeric-value width)) (save-excursion ;; If inside indentation, start from BOL. (goto-char from) *************** *** 229,235 **** Interactively, WIDTH is the prefix argument, if specified. Without prefix argument, the command prompts for WIDTH." (interactive "r\nNSet right margin to width: ") ! (if (interactive-p) (setq width (prefix-numeric-value width))) (save-excursion (goto-char from) (skip-chars-backward " \t") --- 229,235 ---- Interactively, WIDTH is the prefix argument, if specified. Without prefix argument, the command prompts for WIDTH." (interactive "r\nNSet right margin to width: ") ! (setq width (prefix-numeric-value width)) (save-excursion (goto-char from) (skip-chars-backward " \t") *************** *** 289,297 **** the right margin width. If `auto-fill-mode' is active, re-fill the region to fit the new margin." (interactive "r\nP") ! (if (interactive-p) ! (setq inc (if inc (prefix-numeric-value current-prefix-arg) ! standard-indent))) (save-excursion (alter-text-property from to 'right-margin (lambda (v) (+ inc (or v 0)))) --- 289,296 ---- the right margin width. If `auto-fill-mode' is active, re-fill the region to fit the new margin." (interactive "r\nP") ! (setq inc (if inc (prefix-numeric-value current-prefix-arg) ! standard-indent)) (save-excursion (alter-text-property from to 'right-margin (lambda (v) (+ inc (or v 0))))