From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: use Elisp to improve your Elisp - some code issues Date: Sun, 02 Aug 2015 16:36:21 +0100 Message-ID: <87pp353doq.fsf@robertthorpeconsulting.com> References: <871tfmwk8v.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1438529815 30009 80.91.229.3 (2 Aug 2015 15:36:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Aug 2015 15:36:55 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 02 17:36:41 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 1ZLvJW-0002yb-Ub for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Aug 2015 17:36:39 +0200 Original-Received: from localhost ([::1]:56225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLvJW-00058Q-65 for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Aug 2015 11:36:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLvJM-00058L-BU for help-gnu-emacs@gnu.org; Sun, 02 Aug 2015 11:36:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLvJJ-0003qC-4k for help-gnu-emacs@gnu.org; Sun, 02 Aug 2015 11:36:28 -0400 Original-Received: from outbound-smtp03.blacknight.com ([81.17.249.16]:54792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLvJI-0003q0-VK for help-gnu-emacs@gnu.org; Sun, 02 Aug 2015 11:36:25 -0400 Original-Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp03.blacknight.com (Postfix) with ESMTPS id 1274E98875 for ; Sun, 2 Aug 2015 15:36:23 +0000 (UTC) Original-Received: (qmail 31857 invoked from network); 2 Aug 2015 15:36:22 -0000 Original-Received: from unknown (HELO RTLaptop) (rt@robertthorpeconsulting.com@[109.77.154.208]) by 81.17.254.9 with ESMTPSA (DHE-RSA-AES128-SHA encrypted, authenticated); 2 Aug 2015 15:36:22 -0000 In-Reply-To: <871tfmwk8v.fsf@nl106-137-147.student.uu.se> (message from Emanuel Berg on Sun, 02 Aug 2015 03:29:36 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 81.17.249.16 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:106209 Archived-At: Emanuel Berg writes: > "Pascal J. Bourguignon" > writes: > >> No. >> >> I said that if you went beyond those simple case, >> your regexp solution would break lamentably. > > This is an interface to regexps so it sure doesn't go > anywhere beyond what can be expressed by regexps. I agree with Pascal & Marcin. Why not use the "read" function to read in the code of the file. Then you have everything as a tree. You can use car and cdr to walk the tree and find the relevant function calls. Then you're in the right place in the Chomsky heirachy. > (if a a b) Suppose "a" and "b" are expressions rather than variables. Suppose that the two instances of "a" have different whitespace and comments between them. In that case they can't be differentiated by regex. Regex can't count parenthesis either. Another possibility is editing the byte-compiler source to provide more warnings. BR, Robert Thorpe