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: Search within function for text Date: Tue, 24 Mar 2015 16:44:29 +0100 Message-ID: <87zj72763m.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427211907 24593 80.91.229.3 (24 Mar 2015 15:45:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Mar 2015 15:45:07 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Glen Stark Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 24 16:44:54 2015 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 1YaR0c-0003zt-9F for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Mar 2015 16:44:50 +0100 Original-Received: from localhost ([::1]:33100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaR0b-0002BM-QW for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Mar 2015 11:44:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaR0P-0002BG-CF for help-gnu-emacs@gnu.org; Tue, 24 Mar 2015 11:44:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaR0I-0004XF-V0 for help-gnu-emacs@gnu.org; Tue, 24 Mar 2015 11:44:37 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:51547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaR0I-0004Wv-Oe for help-gnu-emacs@gnu.org; Tue, 24 Mar 2015 11:44:30 -0400 Original-Received: from thinkpad-t440p (dhcp25.uni-koblenz.de [141.26.71.25]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 4FD721A86BE; Tue, 24 Mar 2015 16:44:29 +0100 (CET) Mail-Followup-To: Glen Stark , help-gnu-emacs@gnu.org In-Reply-To: (Glen Stark's message of "Tue, 24 Mar 2015 13:28:16 GMT") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 141.26.64.15 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:103291 Archived-At: Glen Stark writes: Hi Glen, > I would like to find all occurences of a bit of text that fall within > a certain function name. I'm programming in C++, and several classes > have their own implementations of foo(), and I'd like to find all > occurrences of the string "bar" within functions named "foo()". At least you can't do that with regular expressions but you need to something which actually understands C++ syntax. > Does anyone know of a way I can do this? Have a look at CEDET. Assuming foo is not just a string but a variable or function, `semantic-symref' might do exactly what you want: http://cedet.sourceforge.net/symref.shtml Bye, Tassilo