From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kai.grossjohann@uni-duisburg.de (Kai =?iso-8859-1?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.devel Subject: align-current suggestion Date: Wed, 18 Dec 2002 14:54:18 +0100 Organization: University of Dortmund, Germany Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <84y96nwhyt.fsf@lucy.cs.uni-dortmund.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1040228352 625 80.91.224.249 (18 Dec 2002 16:19:12 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 18 Dec 2002 16:19:12 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Ogud-00009v-00 for ; Wed, 18 Dec 2002 17:19:11 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18OgvL-0004Al-00 for ; Wed, 18 Dec 2002 17:19:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18OgrM-0004LX-08 for emacs-devel@quimby.gnus.org; Wed, 18 Dec 2002 11:15:48 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18Ogr2-0004Hk-00 for emacs-devel@gnu.org; Wed, 18 Dec 2002 11:15:28 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18OgIy-0005GS-00 for emacs-devel@gnu.org; Wed, 18 Dec 2002 10:40:22 -0500 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18OgGz-0004vT-00 for emacs-devel@gnu.org; Wed, 18 Dec 2002 10:38:14 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18OgGN-0005X1-00 for ; Wed, 18 Dec 2002 16:37:35 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18OgGL-0005Wl-00 for ; Wed, 18 Dec 2002 16:37:33 +0100 Original-Path: not-for-mail Original-Lines: 21 Original-X-Complaints-To: usenet@main.gmane.org User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2.93 (i686-pc-linux-gnu) Cancel-Lock: sha1:nQlRa6LjdfhAntLQkZUPz49fuZY= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10263 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10263 I like to bind align to a key. But there are two align commands that I often use -- align-current and align. One of them is used when I don't specify a region, the other is used when I do specify the region. I use transient-mark-mode. How about a command align-dwim that behaves like align if there is a region, and like align-current if there isn't? (defun align-dwim (&optional rules exclude-rules) "Align current alignment section or region. This is useful in `transient-mark-mode'. If there is a region, do like `align' on that region, else do like `align-current'." (interactive) (if mark-active (align (region-beginning) (region-end) nil rules exclude-rules) (align-current nil nil nil rules exclude-rules))) -- ~/.signature is: umop ap!sdn (Frank Nobis)