Bug 131257 - kde-emacs script doesn't work with cc-mode 5.31.x
Summary: kde-emacs script doesn't work with cc-mode 5.31.x
Status: RESOLVED NOT A BUG
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Akarsh Simha
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-23 21:43 UTC by Andreas Pakulat
Modified: 2020-10-11 18:41 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Pakulat 2006-07-23 21:43:49 UTC
Version:            (using KDE KDE 3.5.3)
Installed from:    Debian testing/unstable Packages
OS:                Linux

Hi,

I'm filing this against kde because I couldn't find a more apropriate place.

The kde-emacs scripts uses c-narrow-out-enclosing-class which is not available in the latest stable version of cc-mode anymore. I don't know how other people install emacs, but at least the Debian packages of emacs snapshots contain such a recent version of cc-mode.

If this isn't obvious: The missing function makes the indentation impossible, i.e. I can't indent anything in a KDE source file.

I already talked to the cc-mode people on their help-list and I was told by Alan Mackenzie that if you need assistance with this you could contact him on bug-cc-mode@gnu.org

I hope this can be fixed at least for KDE 3.5.5 (as I guess it's a bit too late for 3.5.4, IIRC the tagging is tomorrow)

Andreas
Comment 1 Andreas Pakulat 2006-07-24 00:35:26 UTC
Hi,

I was notified in the discussion on cc-mode-help (sorry still not in the archive of sourceforge.net) that the mentioned c-narrow.. function is actually not supposed to be used outside of cc-mode, i.e. it is not part of the "public API". So this should be definetly fixed, especially with the long lifetime of KDE3.5 in mind.

Andreas
Comment 2 Allen Winter 2008-06-14 18:50:04 UTC
I'm experiencing this too with emacs 22.2.1

Comment 3 David Faure 2008-06-16 12:04:44 UTC
For testing, does it help if you replace the 30 with 31 in kde-emacs-core.el around line 186? [talking about trunk here, not 3.5 branch]

The "new" stuff was only enabled for c-version 5.30.* instead of >= 5.30.
Comment 4 Mirko Boehm 2008-07-25 12:01:51 UTC
Changing the line to  ((string-match "^5\\.31\\." c-version) indeed seems to fix the problem. Not committed, since it does not look like the real fix, though. 

Comment 5 David Faure 2008-07-25 13:02:22 UTC
Does this work too?

--- kde-emacs-core.el   (revision 837649)
+++ kde-emacs-core.el   (working copy)
@@ -180,7 +180,7 @@ With arg, do it arg times."
 ;;        If you don't have 5.30 comment out the following c-guess-basic-syntax
 ;;        and uncomment the one underneath.
 (cond
- ((string-match "^5\\.30\\." c-version)
+ ((>= (string-to-number c-version) 5.30)
   (defun c-guess-basic-syntax ()
   "Return the syntactic context of the current line.
 This function does not do any hidden buffer changes."
Comment 6 Jason 'vanRijn' Kasper 2008-10-26 22:34:21 UTC
This is biting me now too. I'm running OpenSUSE 11, with emacs-23.0.60_cvs20080905-1.1 and CC Mode version 5.31.6. I'm also seeing...

let*: Symbol's function definition is void: c-narrow-out-enclosing-class

... when I hit <Tab> at the beginning of a line to indent. Also, I tried changing the string-match to 5\\.31\\. as well as the change dfaure mentioned in comment #5 and neither of them fixed this problem for me.
Comment 7 Jason 'vanRijn' Kasper 2008-10-30 22:32:08 UTC
Ugh. This is also happening when I hit "{". So I'm now unable to use the <Tab> or "{" keys editing files. Is there any chance someone could look at this? I understand that xemacs doesn't have this problem and Zack and David use xemacs, but this is really annoying and makes emacs + our kde scripts totally useless. =:((
Comment 8 Zack Rusin 2008-10-30 23:02:01 UTC
I, of course, use GNU/Emacs, not XEmacs, I just didn't have time to even look at this bug because the cc-mode parser completely changed in 5.31. Really someone with a little bit of time needs to talk to cc-engine developers so that we can figure out how to handle signals/slots/Q_OBJECT/Q_PROPERTY stuff... In the mean time I committed a hack that disables that code and at least lets you work (it's what I've done locally).
Comment 9 Jason 'vanRijn' Kasper 2008-10-31 09:26:17 UTC
Zack: Ahh, so glad to hear that!  You'll have to talk with Thiago about besmirching your good emacs-using name. =;D Thank you SO much for committing this. I know it's only a hack/short-term solution, but I really appreciate it, since I can now use emacs again. Thanks very much!!!
Comment 10 Nate Graham 2020-09-30 04:25:34 UTC
I don't think this thing exists anymore.
Comment 11 David Faure 2020-10-11 18:41:21 UTC
Actually kde-dev-scripts/kde-emacs still exists (but I stopped using it years ago).
The last person to touch it was akarsh@kde.org in 2016.

Unless he reacts to this bug, I guess we should delete kde-emacs as it's unmaintained.