emacs-devel
[Top][All Lists]
Advanced

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

Re: c-submode-indicators at wrong place in minor-mode-alist


From: Alan Mackenzie
Subject: Re: c-submode-indicators at wrong place in minor-mode-alist
Date: Thu, 15 Dec 2005 14:25:19 +0000 (GMT)

Hi, Nick and Stefan!

On Thu, 15 Dec 2005, Nick Roberts wrote:


> > After opening a C file and activating smerge-mode, I get a modeline
> > that reads:
> > 
> > ............... (C SMerge/l Fly Abbrev)
> > 
> > The /l comes from c-submode-indicators and has nothing to do with SMerge.
> > 
> > The problem is that SMerge was loaded after C mode was turned on so it ended
> > up in front of c-submode-indicators in minor-mode-alist.
> > 
> > I think that c-submode-indicators should either be put in mode-line-process,
> > or that c-mode sets mode-name to '("C" c-submode-indicators).

Problem Acknowledged.

>I have also made the following bug report for c-submode-indicators (4th Dec)
>but not heard anything, possibly because I didn't cc to address@hidden
>last time:

Sorry.  It's not a matter of arrogant aloofness, I just didn't spot it in
the mass of emails in emacs-devel.  Always bug CC Mode with a cc to
bug-cc-mode!  :-)

>  I have two suggestions:

>  1) Clicking mouse-2 on the characters after "C" on the mode-line describes
>  c-submode-indicators.  It would be helpful if this variable was documented
>  to explain the meaning of its value.

>  2) The sub-menus of the "Toggle..." menu-item should be radio buttons so
>  the user can see their current value.

>Also the menu item "Syntactic indentation" is permanently disabled and can't
>be toggled.

As a matter of interest, are any of these mousey things coupled with a
particular window manager or toolkit or the like?  (Personally, I develop
with Emacs on a tty.)

>For some reason none of the defvars in cc-langs.el seem to have doc strings.

Some do - `c-identifier-syntax-table', for example.

CC Mode has a convention that defuns/variables with doc strings are part
of the API (i.e. things like line-up functions and derived modes are
"permitted" to use them), but those without doc strings are "internal",
i.e. subject to arbitrary change/disappearance between CC Mode versions.

>The missing functionality might be due to my setup: CC mode almost seems
>to be a dialect of Emacs Lisp with its own virtual world of macros.

That's not unfair.  ;-)  Most of these macros are for smoothing over the
differences between (X)Emacs versions (we've only just dropped support
for Emacs 19.34), getting a steady compilation environment (so that byte
compilation will do the Right Thing regardless of what's loaded in the
Emacs Lisp space) or for language variables.

Language variables are those whose values depend on the target language
(C, C++, Java, Objective C, IDL, Pike, AWK).  Here's an example:

    (c-lang-defconst c-string-escaped-newlines
      "Set if the language support backslash escaped newlines inside string
    literals."
      t nil
      (c c++ objc pike) t)

    (c-lang-defvar c-string-escaped-newlines
      (c-lang-const c-string-escaped-newlines))

This defines the variable `c-string-escaped-newlines', and sets it up to
the value t for C, C++, Objective C and Pike, and nil for the other
languages.  The system also allows derived modes to hook into it.  The
simplicity of these declarations necessitates very hairy macros (which I
don't fully understand either) to support them.

It is also fair to point out that a great deal of CC Mode (cc-engine.el,
cc-cmds.el, ...) is written in "standard" Elisp.

>Nick

-- 
Alan Mackenzie (Munich, Germany).






reply via email to

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