From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Select Text Inside Parentheses Date: Sun, 2 Sep 2012 06:29:41 -0700 Message-ID: <53827CEB253A432AA3754BC886D64329@us.oracle.com> References: <87zk5at028.fsf@quasar.esben-stien.name><87k3wdteq9.fsf@quasar.esben-stien.name><08790584098D4C23B4E53E3E3B50FF8E@us.oracle.com> <87d324tvgs.fsf@quasar.esben-stien.name> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1346592617 3405 80.91.229.3 (2 Sep 2012 13:30:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Sep 2012 13:30:17 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "'Esben Stien'" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 02 15:30:18 2012 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 1T8AFg-0004UF-Cx for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Sep 2012 15:30:12 +0200 Original-Received: from localhost ([::1]:52005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8AFc-0003tN-6B for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Sep 2012 09:30:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8AFU-0003rr-Mm for help-gnu-emacs@gnu.org; Sun, 02 Sep 2012 09:30:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8AFT-0000vO-Oo for help-gnu-emacs@gnu.org; Sun, 02 Sep 2012 09:30:00 -0400 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:41342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8AFT-0000vC-IE for help-gnu-emacs@gnu.org; Sun, 02 Sep 2012 09:29:59 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q82DTsxx027620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 2 Sep 2012 13:29:55 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q82DTqCk009222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Sep 2012 13:29:54 GMT Original-Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q82DTqcC020408; Sun, 2 Sep 2012 08:29:52 -0500 Original-Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 02 Sep 2012 06:29:51 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87d324tvgs.fsf@quasar.esben-stien.name> Thread-Index: Ac2JCDs5ZJwSL2OQSxugGImssNDs8wAApyUQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 141.146.126.227 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:86642 Archived-At: > I've tried this on two platforms now; on my own distro, where I run > emacs-22.3.2 and on an Ubuntu 12.04 with emacs-23.3.1 > I place my point on "b" in bar in this code: > ( > foo > bar > baz > ) Put the cursor before the (, not after it. Or redefine the command accordingly. I did not hear you say that you wanted it to start with point between the parens. As I described, the regexp I gave looks first for a (. Also, . matches any char except a newline. If you want to pick up newlines also, and not other whitespace, then change \\(.+\\) to \\(\\(\\S-\\|[\n]\\)+\\). But if you want to pick up whitespace too, as in (foo bar baz) or ( foo bar baz ) then use just \\([^)]\\), IOW, just pick up everything up to the first ). It depends what you want. Read the Elisp manual's section about regexps. . matches any char except a newline. [\n] matches only a newline. \\s- matches a whitespace char (but not a newline). \\S- matches a non-whitespace, non-newline char.