From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.bugs Subject: bug#11856: 24.0.97; Improve imenu expression of sh-script mode to handle "function FOO" Date: Thu, 05 Jul 2012 02:47:46 +0900 (JST) Organization: Red Hat Japan, Inc. Message-ID: <20120705.024746.486687518756828993.yamato@redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1341424102 31962 80.91.229.3 (4 Jul 2012 17:48:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 Jul 2012 17:48:22 +0000 (UTC) To: 11856@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 04 19:48:22 2012 Return-path: Envelope-to: geb-bug-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 1SmTgb-00013X-9G for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 19:48:21 +0200 Original-Received: from localhost ([::1]:48234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmTga-0006WR-9k for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 13:48:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmTgX-0006W4-Do for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 13:48:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmTgU-0002jS-W3 for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 13:48:16 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmTgU-0002jA-SR for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 13:48:14 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SmTl8-0001o8-8F for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 13:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Masatake YAMATO Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Jul 2012 17:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11856 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13414243686924 (code B ref -1); Wed, 04 Jul 2012 17:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Jul 2012 17:52:48 +0000 Original-Received: from localhost ([127.0.0.1]:48330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmTku-0001nd-D6 for submit@debbugs.gnu.org; Wed, 04 Jul 2012 13:52:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44863) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmTkr-0001nW-T4 for submit@debbugs.gnu.org; Wed, 04 Jul 2012 13:52:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmTgC-0002ho-D3 for submit@debbugs.gnu.org; Wed, 04 Jul 2012 13:47:57 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:57740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmTgC-0002hk-AM for submit@debbugs.gnu.org; Wed, 04 Jul 2012 13:47:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmTgA-0006TR-KM for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 13:47:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmTg7-0002hD-Fm for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 13:47:54 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:21278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmTg7-0002gn-7A for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 13:47:51 -0400 Original-Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q64HlmC3015871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 4 Jul 2012 13:47:48 -0400 Original-Received: from localhost (vpn-235-4.phx2.redhat.com [10.3.235.4]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q64HllWS015135 for ; Wed, 4 Jul 2012 13:47:47 -0400 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61576 Archived-At: This is not a bug report. This is a request for reviwing and merging a patch. With this patch foo in following shell script can be captured as an imenu entry. function foo { ... (Even witohut this patch function foo() { ... and foo() { ... can be captured.) 2012-07-04 Masatake YAMATO * progmodes/sh-script.el (sh-imenu-generic-expression): Capture a function with `function' keyword and without parentheses like "function FOO". === modified file 'lisp/progmodes/sh-script.el' --- lisp/progmodes/sh-script.el 2012-05-11 14:24:50 +0000 +++ lisp/progmodes/sh-script.el 2012-07-04 03:57:10 +0000 @@ -327,8 +327,15 @@ (defcustom sh-imenu-generic-expression `((sh . ((nil - "^\\s-*\\(function\\s-+\\)?\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*()" - 2)))) + ;; function FOO + ;; function FOO() + "^\\s-*function\\s-+\\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*\\(?:()\\)?" + 1) + ;; FOO() + (nil + "^\\s-*\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*()" + 1) + ))) "Alist of regular expressions for recognizing shell function definitions. See `sh-feature' and `imenu-generic-expression'." :type '(alist :key-type (symbol :tag "Shell")