unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dan.colascione@gmail.com>
To: dino chiesa <dpchiesa@hotmail.com>
Cc: 8724@debbugs.gnu.org
Subject: bug#8724: 23.2; js-mode imenu should be more thorough
Date: Sun, 19 Jun 2011 13:40:36 -0700	[thread overview]
Message-ID: <4DFE5EC4.3070103@gmail.com> (raw)
In-Reply-To: <BLU159-w1BD508A3BC8FDB4EA3337CE750@phx.gbl>

-----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	other threads:[~2011-06-19 20:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 12:51 bug#8724: 23.2; js-mode imenu should be more thorough dino chiesa
2011-06-19 20:40 ` Daniel Colascione [this message]
2021-06-02  7:58   ` Lars Ingebrigtsen
2021-06-05  0:24     ` Dmitry Gutov
2024-01-10 11:55       ` Stefan Kangas
2024-01-11  0:19         ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DFE5EC4.3070103@gmail.com \
    --to=dan.colascione@gmail.com \
    --cc=8724@debbugs.gnu.org \
    --cc=dpchiesa@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).