From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: align-regexp problem when called from lisp code Date: Fri, 09 Aug 2013 10:13:29 +0200 Message-ID: <87wqnvl1sm.fsf@thinkpad.tsdh.org> References: <87wqnws9in.fsf@thinkpad.tsdh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376036036 22889 80.91.229.3 (9 Aug 2013 08:13:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 9 Aug 2013 08:13:56 +0000 (UTC) Cc: help-gnu-emacs To: Luca Ferrari Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 09 10:13:59 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 1V7hpe-0006Uq-QH for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Aug 2013 10:13:58 +0200 Original-Received: from localhost ([::1]:45220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7hpd-00076x-Ui for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Aug 2013 04:13:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7hpJ-0006y3-HO for help-gnu-emacs@gnu.org; Fri, 09 Aug 2013 04:13:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7hpE-0005iC-1l for help-gnu-emacs@gnu.org; Fri, 09 Aug 2013 04:13:37 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:49635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7hpD-0005i5-QY for help-gnu-emacs@gnu.org; Fri, 09 Aug 2013 04:13:31 -0400 Original-Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 9ECB021040; Fri, 9 Aug 2013 04:13:30 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Fri, 09 Aug 2013 04:13:30 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:cc:subject:references:date :in-reply-to:message-id:mime-version:content-type; s=smtpout; bh=8BK6Qkn1Pj8SfawsMcAypp/15uA=; b=TSmBYvjIypU+aV0v1tRmcvqF5jZo r+sMbMU9mrz3YgHBDqAJNi2X+nP/FeTxuG5P8Xnl0cUzEOqVhGZF2L9v5bG7wImq 96rJkg8TCiwl3MiwTmX+V+5BHbbWg/WDR+BABBrRpgYM4CJWB7UcGjhUU4KF++eH TdFq9IftjzLrEyM= X-Sasl-enc: MK9IKK65MKpHOYH0uXUWlWIFnZtlEst7zQL/v3dRCjXo 1376036010 Original-Received: from thinkpad.tsdh.org (unknown [91.67.164.26]) by mail.messagingengine.com (Postfix) with ESMTPA id 0926AC00E80; Fri, 9 Aug 2013 04:13:29 -0400 (EDT) In-Reply-To: (Luca Ferrari's message of "Fri, 9 Aug 2013 08:08:32 +0200") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.111.4.26 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:92787 Archived-At: Luca Ferrari writes: >>> --8<---------------cut here---------------start------------->8--- >>> (defun fluca1978/align-assignments (beg end) >>> (interactive "r") >>> (align-regexp beg end "\\(\\s-*\\)=")) >>> --8<---------------cut here---------------end--------------->8--- > > Uhm...just for curiosity, what kind of regexp should I use if I want > also to align all comment starting (/*) in every row? You mean C-style multi-line comments? This --8<---------------cut here---------------start------------->8--- (defun fluca1978/align-comment (beg end) (interactive "r") (align-regexp beg end "\\(\\s-*\\)\\*" 1 0)) --8<---------------cut here---------------end--------------->8--- aligns that /** * Here starts a comment * and here it goes again * and again */ to /** * Here starts a comment * and here it goes again * and again */ Is that what you mean? Bye, Tassilo