From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Doug Lewan Newsgroups: gmane.emacs.help Subject: RE: shortcut for align-regexp Date: Wed, 17 Apr 2013 13:20:02 +0000 Message-ID: <155DEC68569B714B86C2C7075F5EDA9828F0BBBC@DAKIYA1.pegasus.local> References: <516E9710.7040209@yahoo.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1366204690 27431 80.91.229.3 (17 Apr 2013 13:18:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Apr 2013 13:18:10 +0000 (UTC) To: Jannis , "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 17 15:18:14 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1USSFa-0006Wz-HX for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Apr 2013 15:18:14 +0200 Original-Received: from localhost ([::1]:56415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USSFa-0006fp-1S for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Apr 2013 09:18:14 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USSF9-0006J0-6P for help-gnu-emacs@gnu.org; Wed, 17 Apr 2013 09:17:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USSF3-000426-7G for help-gnu-emacs@gnu.org; Wed, 17 Apr 2013 09:17:47 -0400 Original-Received: from webmail.shubertorg.com ([207.246.209.200]:47878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USSF3-00041e-3K for help-gnu-emacs@gnu.org; Wed, 17 Apr 2013 09:17:41 -0400 Original-Received: from dakiya1.pegasus.local ([172.16.208.201]) by DAKIYA1.pegasus.local ([172.16.208.201]) with mapi id 14.01.0339.001; Wed, 17 Apr 2013 09:20:03 -0400 Thread-Topic: shortcut for align-regexp Thread-Index: AQHOO2h1sGe+vfiXLkibX/Vx3SHzBZjaY6Xw In-Reply-To: <516E9710.7040209@yahoo.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.21.202] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 207.246.209.200 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90203 Archived-At: The command align-regexp is written to prompt you for a regular expression = if you use it interactively. The following code does what you describe you want. (defun my-common-align (begin end) "Align text in the region on '=3D' and '<-'." (interactive "r") (let ((common-align-regexp "\\(?:=3D\\|<-\\)")) (align-regexp begin end common-align-regexp))) (global-set-key "\C-a" 'my-common-align) The choice of key is yours, but `C-a' is move-beginning-of-line almost ever= ywhere. I might recommend `C-c a' instead. ,Douglas Douglas Lewan Shubert Ticketing (201) 489-8600 ext 224 If the majority of cooking accidents happen in the kitchen, then why don't = we just cook in other rooms? -----Original Message----- From: help-gnu-emacs-bounces+dougl=3Dshubertticketing.com@gnu.org [mailto:h= elp-gnu-emacs-bounces+dougl=3Dshubertticketing.com@gnu.org] On Behalf Of Ja= nnis Sent: Wednesday, 2013 April 17 08:35 To: help-gnu-emacs@gnu.org Subject: shortcut for align-regexp Hi emacs users, this most probably is a beginners question ... googeling however yielded=20 now exlanation suitable for my emacs experience. I would love to bind single key combination (like C-a) to the=20 align-regexp command and use =3D and <- as alignment regexpressions. How=20 would I do this? Without this I always have to type: M-align-regexp RET <- RET Thanks a lot Jannis