all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Rudolfo Ungern <rolf_unger@hotmail.com>
Cc: bug-cc-mode@gnu.org, help-gnu-emacs@gnu.org
Subject: Re: imenu with cc-mode in emacs 22 (win32)
Date: Wed, 12 Nov 2008 12:58:40 +0000	[thread overview]
Message-ID: <20081112125840.GC1188@muc.de> (raw)
In-Reply-To: <55935300-52c8-4641-a644-01c6d06e4362@z28g2000prd.googlegroups.com>

[ Reply-To: set to bug-cc-mode@gnu.org ]

Hi, Rolf!

On Wed, Nov 12, 2008 at 03:21:32AM -0800, Rudolfo Ungern wrote:
> Hi,

> i switched to emacs-22.3 recently and have a problem with speedbar/
> imenu in cc-mode. When I try to navigate with imenu to a function emacs
> eats up all the CPU resources and is not responding anymore.

Not good.  Does this happen with any C file, or just sometimes?  If the
latter, could you possibly pare a file down to the minimum which shows
the bug, then post it?  Thanks!

Please give an exact recipe (in terms of keystrokes or mouse clicks) to
reproduce the problem.

I've redirected this mail to the CC Mode list at bug-cc-mode@gnu.org,
because it smells like that sort of problem.

> Imenu is working with perl files (with perl-mode) with sql files, but
> not with cc mode. No matter if it is c++ or plain c code.

What is your CC exact Mode configuration?  (Please do C-c C-b in a CC
Mode buffer.  That will open a mail buffer with all the information,
pre-addressed to bug-cc-mode@gnu.org.  If you use a different mail
client, just copy everything across.  Thanks!)

> It must be something in my .emacs, because navigating in the same
> source files with imenu works if I skip my .emacs (that is: start emacs
> as another user)

It might well be your .emacs which is triggering the bug, but the bug
itself is mine.  :-)

> On the other hand the same .emacs file works find with emacs-21.3 and
> imenu.  (of course i use some different code depending on the emacs
> version, but that does not affect imenu nor cc-mode.

CC Mode was amended a lot between Emacs 21.3 and 22.1.

> It seems like the imenu related lisp code runs in some never-ending
> loop.  I guess it would help me a lot, if I can have some hints how to
> activate the elisp debugger.

The simplest ways are (setq debug-on-error t) and (setq debug-on-quit t).
The second one seems the most relevant here.  After setting
debug-on-quit, get into the infinite loop and C-g it - this gets you into
the debugger, with a display of the calling stack.  The debugger is
documented on the page "debugger" in the Elisp manual.

Or for really heavy debugging, look up Edebug in the elisp manual.  With
edebug, you have to "instrument" a function first.  When you get to that
function, you can then do things like single stepping, etc.

> I know that this post is pretty vague, but the alternative would have
> been to paste 400 lines of the .emacs into this post.

Well, who know, I might ask you to do just that a bit later.  :-)

> I usually use

>  (add-hook 'c-mode-common-hook 'my-c-mode-hook)

> in my .emacs file, with some indentation adjustments in my-c-mode-
> hook.  but even if I deactivate this add-hook expression I still run in
> the problem with imenu.

> The other suspected piece of code is in customization:

> (custom-set-variables
>   ;
>  '(imenu-sort-function (quote imenu--sort-by-name)))

> but commenting it out, doesn't help either.

> If someone knows what areas have changed in imenu from emacs21 to
> emacs22, that could give me a hint where to search for the root of the
> problem.

CC Mode changed from version 5.28 to 5.31.n.  This contains the bulk of
the imenu code for C, etc.  The pertinent file in Emacs is in
.../emacs/lisp/progmodes/cc-menu.el.  The imenu code itself is in
.../emacs/lisp/imenu.el.  You can see recent changes to it in
.../emacs/lisp/ChangeLog.  Alternatively, have a look at the CVS
repository at
http://cvs.savannah.gnu.org/viewvc/emacs/emacs/lisp/imenu.el.

Have fun!

> Thanks, Rolf

-- 
Alan Mackenzie (Nuremberg, Germany).

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/


  reply	other threads:[~2008-11-12 12:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-12 11:21 imenu with cc-mode in emacs 22 (win32) Rudolfo Ungern
2008-11-12 12:58 ` Alan Mackenzie [this message]
     [not found] ` <mailman.133.1226494022.26697.help-gnu-emacs@gnu.org>
2008-11-13  1:45   ` Rudolfo Ungern
2008-11-13 11:26     ` Rudolfo Ungern
2008-11-17 18:58       ` Rudolfo Ungern
2008-11-18 15:57         ` Rudolfo Ungern

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

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

  git send-email \
    --in-reply-to=20081112125840.GC1188@muc.de \
    --to=acm@muc.de \
    --cc=bug-cc-mode@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=rolf_unger@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.