bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8724: 23.2; js-mode imenu should be more thorough


From: Daniel Colascione
Subject: bug#8724: 23.2; js-mode imenu should be more thorough
Date: Sun, 19 Jun 2011 13:40:36 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Dino,

Thanks for the feature suggestion and code.

On 5/24/11 5:51 AM, dino chiesa wrote:
> 
> Module /emacs/lisp/progmodes/js.el
>  
> In js-mode, editing a short javascript file, the imenu indexing works
> nicely but the actual menu is incomplete, truncated. The defun
> js--pitems-to-imenu seems to make an insufficient effort, when
> nested function definitions are used in the source. 
>  
> For example, supposing this js source: 
>  
>   jQuery(document).ready(function () {
>       var $th = jQuery('thead > tr > th');
>       $th.each(function(column, elt) {
>           jQuery(this).addClass('sortable').click(function() {
>              ...
>           });
>       });
>   });
>  
> (this is fairly typical with javascript)

Fair enough.

>  
> In this case js-mode will index all of the anonymous functions, but will 
> produce an imenu that contains only the outer anonymous function. This is 
> done in js--pitems-to-imenu. Also, in the same defun, the imenu entry uses
> "Unknown" as the name of the anonymous function.
>  
> I propose 2 things: 
>   - replace the name "unknown" with "Anonymous"
>   - recurse into js--pitems-to-imenu for functions that define 
>     child functions. 
> 
> The proposed new code for the defun is: 

I'll see what I can do about looking at your code. In the meantime, it
would be helpful if you could submit your changes as a patch against the
latest code in trunk.

Thanks,
Daniel Colascione

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)

iEYEARECAAYFAk3+XsIACgkQ17c2LVA10Vta4ACfab5AvYokQAfTTOn+hmwKIRwl
buIAoJC08O+cthOUL7UTHo+er6kZcFYT
=bT2r
-----END PGP SIGNATURE-----





reply via email to

[Prev in Thread] Current Thread [Next in Thread]