From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Michael Slass Newsgroups: gmane.emacs.help Subject: Re: C-x TAB indent-rigidly default set to 4 columns, not to 1 Date: Tue, 18 May 2004 22:14:07 GMT Organization: Comcast Online Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <2gpt2tF5glsvU1@uni-berlin.de> <2gve38F6qv4iU1@uni-berlin.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084918948 25564 80.91.224.253 (18 May 2004 22:22:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 May 2004 22:22:28 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 19 00:22:24 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BQCye-0007h6-00 for ; Wed, 19 May 2004 00:22:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BQCvV-0003jj-66 for geh-help-gnu-emacs@m.gmane.org; Tue, 18 May 2004 18:19:09 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed1.news.rcn.net!rcn!wns13feed!worldnet.att.net!attbi_s01.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:Y6Vw0BM4/QiHRjOWH0JXp3wSYaQ= Original-Lines: 30 Original-NNTP-Posting-Host: 24.18.253.35 Original-X-Complaints-To: abuse@comcast.net Original-X-Trace: attbi_s01 1084918447 24.18.253.35 (Tue, 18 May 2004 22:14:07 GMT) Original-NNTP-Posting-Date: Tue, 18 May 2004 22:14:07 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:123281 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:18574 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:18574 nospam55 writes: >thanks Mike; your solution has still some problem with C-u C-u M-x irFrequent , >but leads to > > ;; we refer to "Prefix Command Arguments" , > ;; fsf emacs lisp reference manual > (defun irFrequent (arg beg end) > "`indent-rigidly' region with 4 spaces, or prefix-arg spaces if provided" > (interactive "P\nr") > (indent-rigidly beg end (prefix-numeric-value (or arg 4)) ) ; alternative 1/2 > ;; (indent-rigidly beg end (if arg (prefix-numeric-value arg) 4) ) ; alternative 2/2 > ) > > >which looks great and seems to work ! > I think you might still want the number of spaces argument to be optional: (defun irFrequent (beg end &optional spaces) "`indent-rigidly' 4 spaces. With prefix-arg, or optional arg SPACES, `indent-rigidly' by that amount instead." (interactive "r\nP") (indent-rigidly beg end (prefix-numeric-value (or spaces 4)))) -- Mike Slass