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: Fri, 22 Oct 2004 20:53:51 -0500 (CDT) Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <200410230153.i9N1rpI16187@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> <200410210308.i9L38Dm10997@raven.dms.auburn.edu> <200410222222.i9MMMD515903@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1098496582 10683 80.91.229.6 (23 Oct 2004 01:56:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 23 Oct 2004 01:56:22 +0000 (UTC) Cc: rms@gnu.org, jpw@gnu.org, klm@zope.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, storm@cua.dk, alexander.pohoyda@gmx.net, John@ducserv3c.duc.auburn.edu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 23 03:56:10 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 1CLB8b-0003Jv-00 for ; Sat, 23 Oct 2004 03:56:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CLBG7-0005Pd-4w for ged-emacs-devel@m.gmane.org; Fri, 22 Oct 2004 22:03:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CLBG0-0005PW-Rw for emacs-devel@gnu.org; Fri, 22 Oct 2004 22:03:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CLBG0-0005PK-F1 for emacs-devel@gnu.org; Fri, 22 Oct 2004 22:03:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CLBG0-0005PH-BI for emacs-devel@gnu.org; Fri, 22 Oct 2004 22:03:48 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CLB88-0006XD-HV; Fri, 22 Oct 2004 21:55:40 -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 i9N1tKiU023007; Fri, 22 Oct 2004 20:55:20 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id i9N1rpI16187; Fri, 22 Oct 2004 20:53:51 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: teirllm@dms.auburn.edu 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:28764 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28764 >>From my previous message: 2. Three functions in `indent.el'. I could check these out further. If they give any problems, they are trivial to fix. 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. The `N' interactive code _gives_ the numeric prefix argument, hence the lines removed in the patch below are useless and confusing. In as far as `increase-right-margin' is concerned, I did not check its effect on keyboard macros, because again, the call to `interactive-p' is stylistically ugly. It is inconsistent with the way exactly the same thing gets achieved in `set-left-margin', `set-right-margin' and `decrease-right-margin' and with the usual way to handle this in other places in Emacs. I propose the following patch to indent.el. It eliminates all uses of `interactive-p' from indent.el. I can install if desired. That leaves _maybe_ problems in ibuf-ext.el and allout.el. I have the impression that here again the (maybe) offending calls to interactive-p should be eliminated and that the argument reading should instead be done in the interactive calls. I am not really familiar with these files however and I will leave this up to the maintainers of the respective files. Proposed patch to indent.el: ===File ~/indent.el-diff==================================== *** indent.el 29 Sep 2004 20:45:32 -0500 1.58 --- indent.el 22 Oct 2004 19:47:31 -0500 *************** *** 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,210 ---- *************** *** 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") --- 228,233 ---- *************** *** 289,300 **** 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)))) (if auto-fill-function (fill-region from to nil t t)))) --- 287,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 inc) standard-indent)) (save-excursion (alter-text-property from to 'right-margin ! (lambda (v) (+ inc (or v 0)))) (if auto-fill-function (fill-region from to nil t t)))) ============================================================