From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Iustin Pop Newsgroups: gmane.emacs.devel Subject: [PATCH] etags: Add a small list of interpretors for Python Date: Thu, 19 Aug 2010 17:36:06 +0200 Message-ID: <20100819153606.GO4157@google.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1282235601 2705 80.91.229.12 (19 Aug 2010 16:33:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 19 Aug 2010 16:33:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 19 18:33:20 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Om83L-0008TO-CL for ged-emacs-devel@m.gmane.org; Thu, 19 Aug 2010 18:33:19 +0200 Original-Received: from localhost ([127.0.0.1]:43609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Om7sa-0008Og-DU for ged-emacs-devel@m.gmane.org; Thu, 19 Aug 2010 12:22:12 -0400 Original-Received: from [140.186.70.92] (port=37380 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Om7A8-0001RR-J0 for emacs-devel@gnu.org; Thu, 19 Aug 2010 11:36:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Om7A6-0000BM-Ns for emacs-devel@gnu.org; Thu, 19 Aug 2010 11:36:16 -0400 Original-Received: from smtp-out.google.com ([74.125.121.35]:44645) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Om7A6-0000Aq-Gc for emacs-devel@gnu.org; Thu, 19 Aug 2010 11:36:14 -0400 Original-Received: from kpbe13.cbf.corp.google.com (kpbe13.cbf.corp.google.com [172.25.105.77]) by smtp-out.google.com with ESMTP id o7JFaA7o010333 for ; Thu, 19 Aug 2010 08:36:11 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1282232171; bh=SiohuTZKm2IF7hZQ7cpktbFpBA8=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=Xnbmxydga4JFgEOZqmYm6d+ivCbPGKLAQzgMZe78YiZIp4kHRs749Z/h64FxtdaPA hOHTC120MjqKEcZyXuaog== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=date:from:to:subject:message-id:mime-version:content-type: content-disposition:user-agent:x-system-of-record; b=dTIpHZoTadCMZzoOHcmWrV5vL8MVsv8OH+UjSq06f+WGeAX0a/tCX6P6G7yV/WOmC uPBZ5862xaFqO+xW5mf+g== Original-Received: from fxm15 (fxm15.prod.google.com [10.184.13.15]) by kpbe13.cbf.corp.google.com with ESMTP id o7JFa8Vl029065 for ; Thu, 19 Aug 2010 08:36:09 -0700 Original-Received: by fxm15 with SMTP id 15so1221330fxm.12 for ; Thu, 19 Aug 2010 08:36:08 -0700 (PDT) Original-Received: by 10.216.59.148 with SMTP id s20mr839197wec.41.1282232168416; Thu, 19 Aug 2010 08:36:08 -0700 (PDT) Original-Received: from google.com (rrr.zrh.corp.google.com [172.16.74.21]) by mx.google.com with ESMTPS id k7sm1096194wej.26.2010.08.19.08.36.07 (version=SSLv3 cipher=RC4-MD5); Thu, 19 Aug 2010 08:36:07 -0700 (PDT) Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-System-Of-Record: true X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Thu, 19 Aug 2010 12:22:00 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:128874 Archived-At: Currently, etags has no interpretors defined for Python, which prevents it from recognising Python scripts that have no extension. This patch adds a small list of interpretors for this language, which while not perfect (e.g. it will fail on specific versions like python2.4), it is better than the current situation where all scripts without an extension will default to Fortran. Note: I debated adding a more detailed list, but it would get outdated quickly, so I left just these three versions. A regular expression for the interpreter name would be much better here, would implementing that make sense? [please keep me CC-ed, I'm not subscribed to the list] === modified file 'lib-src/etags.c' *** lib-src/etags.c 2010-08-11 08:20:34 +0000 --- lib-src/etags.c 2010-08-19 13:27:43 +0000 *************** line."; *** 755,760 **** --- 755,762 ---- static const char *Python_suffixes [] = { "py", NULL }; + static const char *Python_interpreters [] = + { "python", "python2", "python3", NULL }; static const char Python_help [] = "In Python code, `def' or `class' at the beginning of a line\n\ generate a tag."; *************** static language lang_names [] = *** 836,842 **** { "postscript",PS_help, PS_functions, PS_suffixes }, { "proc", no_lang_help, plain_C_entries, plain_C_suffixes }, { "prolog", Prolog_help, Prolog_functions, Prolog_suffixes }, ! { "python", Python_help, Python_functions, Python_suffixes }, { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes }, { "tex", TeX_help, TeX_commands, TeX_suffixes }, { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes }, --- 838,844 ---- { "postscript",PS_help, PS_functions, PS_suffixes }, { "proc", no_lang_help, plain_C_entries, plain_C_suffixes }, { "prolog", Prolog_help, Prolog_functions, Prolog_suffixes }, ! { "python",Python_help,Python_functions,Python_suffixes,NULL,Python_interpreters}, { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes }, { "tex", TeX_help, TeX_commands, TeX_suffixes }, { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes },