GNU bug report logs - #11856
24.0.97; Improve imenu expression of sh-script mode to handle "function FOO"

Previous Next

Package: emacs;

Reported by: Masatake YAMATO <yamato <at> redhat.com>

Date: Wed, 4 Jul 2012 17:53:02 UTC

Severity: minor

Tags: patch

Found in version 24.0.97

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11856 in the body.
You can then email your comments to 11856 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11856; Package emacs. (Wed, 04 Jul 2012 17:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Masatake YAMATO <yamato <at> redhat.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 04 Jul 2012 17:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Masatake YAMATO <yamato <at> redhat.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.97; Improve imenu expression of sh-script mode to handle
	"function FOO"
Date: Thu, 05 Jul 2012 02:47:46 +0900 (JST)
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  <yamato <at> redhat.com>

	* 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")





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11856; Package emacs. (Sun, 08 Jul 2012 23:31:02 GMT) Full text and rfc822 format available.

Message #8 received at 11856 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Masatake YAMATO <yamato <at> redhat.com>
Cc: 11856 <at> debbugs.gnu.org
Subject: Re: bug#11856: 24.0.97;
	Improve imenu expression of sh-script mode to handle "function FOO"
Date: Sun, 08 Jul 2012 19:24:43 -0400
> This is not a bug report. This is a request for reviwing and merging a
> patch.

Looks good, please install,


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11856; Package emacs. (Wed, 11 Jul 2012 05:52:02 GMT) Full text and rfc822 format available.

Message #11 received at 11856 <at> debbugs.gnu.org (full text, mbox):

From: Masatake YAMATO <yamato <at> redhat.com>
To: monnier <at> iro.umontreal.ca
Cc: 11856 <at> debbugs.gnu.org
Subject: Re: bug#11856: 24.0.97; Improve imenu expression of sh-script mode
	to handle "function FOO"
Date: Wed, 11 Jul 2012 14:45:36 +0900 (JST)
>> This is not a bug report. This is a request for reviwing and merging a
>> patch.
> 
> Looks good, please install,
> 
> 
>         Stefan

I'm sorry but could you install the patch?

I deleted my self from 'emacs commiters' when my hard disk was
broken and my domain (gyve.org) was lost simultaneously.

Masatake YAMATO




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11856; Package emacs. (Wed, 18 Jul 2012 13:49:02 GMT) Full text and rfc822 format available.

Message #14 received at 11856 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Masatake YAMATO <yamato <at> redhat.com>
Cc: 11856 <at> debbugs.gnu.org
Subject: Re: bug#11856: 24.0.97;
	Improve imenu expression of sh-script mode to handle "function FOO"
Date: Wed, 18 Jul 2012 09:42:10 -0400
>>> This is not a bug report. This is a request for reviwing and merging a
>>> patch.
>> Looks good, please install,
> I'm sorry but could you install the patch?

Of course, done.

> I deleted my self from 'emacs commiters' when my hard disk was
> broken and my domain (gyve.org) was lost simultaneously.

Feel free to re-request memership from your savannah account, so I can
re-add you there.


        Stefan




bug closed, send any further explanations to 11856 <at> debbugs.gnu.org and Masatake YAMATO <yamato <at> redhat.com> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 18 Jul 2012 14:14:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 16 Aug 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 308 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.