Hi, The cscope menu item has recently vanished from my emacs 22 menu bar. It is present in dired but not when opening a source file. The problem has started recently but I do not know which emerge did it. I'll attach my emacs startup files asap. Thanks, jules
Created attachment 130057 [details] Emacs startup files
Sorry, we cannot handle this bug report unless you provide us with at least some information. Which version of Emacs ("emacs --version") and which version of cscope you are using? And how can we reproduce the bug? Reopen this bug then.
I haven't tested this on other boxes, but the cscope and emacs version are below. You might see the problem if you untar my emacs startup files. Thanks, jules colding@omc-2 ~ $ emacs --version GNU Emacs 22.1.2 Copyright (C) 2007 Free Software Foundation, Inc. GNU Emacs comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of Emacs under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. colding@omc-2 ~ $ eix cscope [I] dev-util/cscope Available versions: 15.6-r1 {emacs} Installed versions: 15.6-r1(11:40:23 AM 05/10/2007)(emacs) Homepage: http://cscope.sourceforge.net/ Description: Interactively examine a C program
and BTW: colding@omc-2 ~ $ emerge --info Portage 2.1.2.12 (default-linux/amd64/2007.0, gcc-4.1.2, glibc-2.5-r4, 2.6.22-gentoo-r5 x86_64) ================================================================= System uname: 2.6.22-gentoo-r5 x86_64 AMD Opteron(tm) Processor 252 Gentoo Base System release 1.12.9 Timestamp of tree: Wed, 05 Sep 2007 06:20:01 +0000 app-shells/bash: 3.2_p17 dev-java/java-config: 1.3.7, 2.0.33-r1 dev-lang/python: 2.3.5-r3, 2.4.4-r4 dev-python/pycrypto: 2.0.1-r6 sys-apps/baselayout: 1.12.9-r2 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.61 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.16 sys-devel/libtool: 1.5.24 virtual/os-headers: 2.6.21 ACCEPT_KEYWORDS="amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=k8 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/X11/xkb" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-march=k8 -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://mirror.muntinternet.net/pub/gentoo/ http://mirror.uni-c.dk/pub/gentoo/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/" LC_ALL="en_US.utf8" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="X aac aalib acl alsa amd64 berkdb bitmap-fonts browserplugin bzip2 cdr cli cracklib crypt cups dri dvd dvdr dvdread emacs fam fbcon firefox foomaticdb fortran gdbm gnome gpm gtk gzip-el hal iconv isdnlog jpeg midi mmx mp3 mudflap ncurses nls nptl nptlonly nsplugin nvidia ogg opengl openmp oss pam pcre pdf perl png portaudio pppd python readline reflection session spl sse sse2 ssl tcpd tetex theora toolkit-scroll-bars truetype-fonts type1-fonts unicode vorbis wma xine xorg xvid zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Reopening.
I cannot reproduce the bug; a "Cscope" item appears whenever I open a C source file. Does the problem also occur if you start emacs with "emacs -q" and load xcscope manually?
No, it does not. The '-q' + manually load trick works perfectly. My emacs startup files do not reproduce the problem for you so I'm lost as to why I see the problem. Do you have any idea what could cause it? Thanks, jules
(In reply to comment #7) > Do you have any idea what could cause it? (In reply to comment #3) > [I] dev-util/cscope > Available versions: 15.6-r1 {emacs} > Installed versions: 15.6-r1(11:40:23 AM 05/10/2007)(emacs) Since Emacs 22 was released only in June, cscope must have been byte-compiled with a different Emacs version. (You may find out by looking into /usr/share/emacs/site-lisp/xcscope/xcscope.elc: the Emacs version it was compiled with should be in the 4th header line.) Try to emerge cscope again to make sure that it is byte-compiled with Emacs version 22.1.
Yep, it was byte-compiled against emacs 21 but re-emerging it again (and checking that it was now byte-compiled against emacs 22.1.2) and restarting emacs did not solve the problem. Very strange...
I've now rebuild all emacs related packages with no result. I think cscope just doesn't like me...
Since the problem doesn't occur with "emacs -q", I would normally say that it must be caused by your startup files. OTOH, I cannot reproduce it with your startup files (only things I had changed there: I removed the loading of "gpl" and "idl-font-lock" since these are not installed here). Maybe some other package is interfering with cscope. Can you attach your site-gentoo.el?
Created attachment 130150 [details] site-gentoo.el Sure, here you go.
(In reply to comment #12) > Created an attachment (id=130150) [edit] > site-gentoo.el Again, nothing suspicious here ... What is the value of variable c-mode-hook ("C-h v c-mode-hook RET")? It should contain cscope:hook.
c-mode-hook is a variable defined in `cc-vars.el'. Its value is shown below. Documentation: *Hook called by `c-mode'. You can customize this variable. Value: ((lambda nil (define-key c-mode-map [f7] 'compile) (define-key c++-mode-map [f7] 'compile)) (lambda nil (define-key c-mode-map [f4] 'indent-region) (define-key c++-mode-map [f4] 'indent-region) (define-key c-mode-map [S-f4] 'indent-buffer) (define-key c++-mode-map [S-f4] 'indent-buffer)) (lambda nil (define-key c-mode-map [S-f3] 'gpl-c) (define-key c++-mode-map [S-f3] 'gpl-c)) (lambda nil (define-key c-mode-map [S-f1] 'find-file-at-cursor) (define-key c++-mode-map [S-f1] 'find-file-at-cursor)) semantic-default-c-setup cscope:hook)
Hm, and is it actually called? What happens if you set a breakpoint: M-x debug-on-entry RET cscope:hook RET and open a C file then? It should enter the debugger and after pressing "d" a few times (four times in my case) you should see that cscope-minor-mode and easy-menu-add are called: Debugger entered--entering a function: * easy-menu-add((keymap "Cscope" (Find\ symbol menu-item "Find symbol" ... * byte-code("... * cscope-minor-mode() * byte-code("... * cscope:hook() run-hooks(c-mode-common-hook c-mode-hook) apply(run-hooks (c-mode-common-hook c-mode-hook)) run-mode-hooks(c-mode-common-hook c-mode-hook) c-mode() ...
Hmm... It immediately gave me this: Loading debug...done Loading semantic-c...done File mode specification error: (error "Autoloading failed to define function semantic-default-c-setup") Actually, during start I see this in "*Compile-Log*": ############## *Compile-Log* ################### Leaving directory `~/' Compiling file /home/colding/elisp/site-func.el at Thu Sep 6 12:05:18 2007 Entering directory `/home/colding/elisp/' Compiling file /home/colding/elisp/site-start.el at Thu Sep 6 12:05:18 2007 site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-tag-external-member-parent' obsoletes overload `nonterminal-external-member-parent' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-tag-external-member-p' obsoletes overload `nonterminal-external-member-p' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-tag-external-member-children' obsoletes overload `nonterminal-external-member-children' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-name' obsoletes overload `name-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-abbreviate' obsoletes overload `abbreviate-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-summarize' obsoletes overload `summarize-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-prototype' obsoletes overload `prototype-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-concise-prototype' obsoletes overload `concise-prototype-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-uml-abbreviate' obsoletes overload `uml-abbreviate-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-uml-prototype' obsoletes overload `uml-prototype-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-uml-concise-prototype' obsoletes overload `uml-concise-prototype-nonterminal' #################### END ###################### I've been wondering what triggers it but I just can't find the place.
OK, after un-merging cedet (a fork of semantic is a part of cedet) and specifically emerging semantic it works! Thanks a lot for all of your help :-) Best regards, jules
Which makes me think that maybe this bug should be moved to whomever maintains cedet?
(In reply to comment #18) > Which makes me think that maybe this bug should be moved to whomever > maintains cedet? All maintained by the Emacs team. ;-) And we should better find the bug, since we plan to remove the very outdated app-emacs/semantic package, see bug #190768. Was it the newest cedet version (i.e., 1.0_pre4-r1) that you were using? (In reply to comment #16) > Hmm... It immediately gave me this: Does "immediately" mean that it happened when you called debug-on-entry, or when you opened the C file?
(In reply to comment #19) > (In reply to comment #18) > > Which makes me think that maybe this bug should be moved to whomever > > maintains cedet? > > All maintained by the Emacs team. ;-) I've almost never been bitten by a bug related to emacs, so you must be doing a very good job ;-) > And we should better find the bug, since > we plan to remove the very outdated app-emacs/semantic package, see bug > #190768. > > Was it the newest cedet version (i.e., 1.0_pre4-r1) that you were using? Yes, I was using app-emacs/cedet-1.0_pre4-r1. > (In reply to comment #16) > > Hmm... It immediately gave me this: > > Does "immediately" mean that it happened when you called debug-on-entry, or > when you opened the C file? When I opened the C file.
Finally I can reproduce the problem: emerge =cedet-1.0_pre3-r2 emerge =cedet-1.0_pre4-r1 Opening a C file (with emacs-22.1-r1) will then result in: File mode specification error: (error "Autoloading failed to define function semantic-default-c-setup") The problem goes away if I do "emerge -C cedet" followed by "emerge cedet". It looks like cedet doesn't like to be upgraded, so this might be the issue of bug #183205 again.
(In reply to comment #21) > Finally I can reproduce the problem: Good news! I haven't the slightest idea how to fix it, but I'm happy that you are hot on the trail of it ;-)
Created attachment 130225 [details, diff] files/1.0_pre4-semantic-require-ede.patch Looks like this bug has been seen by others before, without a solution: <http://thread.gmane.org/gmane.emacs.semantic/1346> Further investigation shows me the following: 1. The problem is due to the file semantic/bovine/semantic-c.elc that is truncated during byte-compilation. 2. Truncation only happens if site-lisp/cedet/ede is in the load-path. Deleting it results in a good semantic-c.elc. 3. If (require 'document) is commented out in semantic-c.el, the resulting byte-compiled file is also o.k. (some warnings during compilation though). 4. Combining findings 2 and 3: semantic/document.el contains a (require 'ede) inside a condition-case. These three lines have been added between 1.0_pre3 and pre4. I think that it is save to remove them since the byte-compiled document.elc is identical in both cases. Attached patch should fix the issue.
I've reported this upstream: <http://thread.gmane.org/gmane.emacs.semantic/1378>
Thanks! Will the patch be applied to the tree?
Just an update. I've now unmerged cedet, semantic, eieio and speedbar followed by a fresh emerge of cedet. I'm still getting the '*Compile-Log*' below but only if my .emacs.desktop file contains a c-file to load when emacs is started. It doesn't complain when emacs is started with no c-files to load and then subsequently loads a c-file. Other than that everything, including cscope, works just fine. BTW - this is without your cedet patch. ########### The '*Compile-Log*' buffer right after startup ##### Leaving directory `~/' Compiling file /home/colding/elisp/site-func.el at Mon Sep 10 13:09:37 2007 Entering directory `/home/colding/elisp/' Compiling file /home/colding/elisp/site-start.el at Mon Sep 10 13:09:37 2007 site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-tag-external-member-parent' obsoletes overload `nonterminal-external-member-parent' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-tag-external-member-p' obsoletes overload `nonterminal-external-member-p' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-tag-external-member-children' obsoletes overload `nonterminal-external-member-children' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-name' obsoletes overload `name-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-abbreviate' obsoletes overload `abbreviate-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-summarize' obsoletes overload `summarize-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-prototype' obsoletes overload `prototype-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-concise-prototype' obsoletes overload `concise-prototype-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-uml-abbreviate' obsoletes overload `uml-abbreviate-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-uml-prototype' obsoletes overload `uml-prototype-nonterminal' site-start.el:Warning: /home/colding/elisp/site-start.el: `semantic-format-tag-uml-concise-prototype' obsoletes overload `uml-concise-prototype-nonterminal'
Created attachment 130483 [details] emacs desktop file that gives the compile warning upon startup
(In reply to comment #25) > Thanks! Will the patch be applied to the tree? If upstream doesn't come up with a better solution within the next week, then I will apply my patch. The obvious workaround until then is to unmerge app-emacs/cedet and merge it again. (In reply to comment #26) > I'm still getting the '*Compile-Log*' below but only if my .emacs.desktop > file contains a c-file to load when emacs is started. Did this also happen with cedet-1.0_pre3-r2?
(In reply to comment #28) > (In reply to comment #25) > > Thanks! Will the patch be applied to the tree? > > If upstream doesn't come up with a better solution within the next week, > then I will apply my patch. OK, great. > (In reply to comment #26) > > I'm still getting the '*Compile-Log*' below but only if my .emacs.desktop > > file contains a c-file to load when emacs is started. > > Did this also happen with cedet-1.0_pre3-r2? I just unmerged the newer one and emerged the older to test this and, yes, it does happen with cedet-1.0_pre3-r2 too. The actual output is different but similar: Leaving directory `~/' Compiling file /home/colding/elisp/site-func.el at Tue Sep 11 09:49:06 2007 Entering directory `/home/colding/elisp/' Compiling file /home/colding/elisp/site-start.el at Tue Sep 11 09:49:06 2007 site-start.el:Warning: `semantic-format-tag-name' obsoletes overload `name-nonterminal' site-start.el:Warning: `semantic-format-tag-abbreviate' obsoletes overload `abbreviate-nonterminal' site-start.el:Warning: `semantic-format-tag-summarize' obsoletes overload `summarize-nonterminal' site-start.el:Warning: `semantic-format-tag-prototype' obsoletes overload `prototype-nonterminal' site-start.el:Warning: `semantic-format-tag-concise-prototype' obsoletes overload `concise-prototype-nonterminal' site-start.el:Warning: `semantic-format-tag-uml-abbreviate' obsoletes overload `uml-abbreviate-nonterminal' site-start.el:Warning: `semantic-format-tag-uml-prototype' obsoletes overload `uml-prototype-nonterminal' site-start.el:Warning: `semantic-format-tag-uml-concise-prototype' obsoletes overload `uml-concise-prototype-nonterminal'
After reading the following message: <http://thread.gmane.org/gmane.emacs.semantic/1382> I don't expect any answer from upstream to this issue anymore. Ebuild with patch committed as -r2. Thank you for reporting this bug and for your help with debugging.