help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: xemacs and c-basic-offset


From: Alan Mackenzie
Subject: Re: xemacs and c-basic-offset
Date: Sun, 23 Aug 2009 18:20:58 +0000
User-agent: Mutt/1.5.9i

Hi, Simeon!

On Sat, Aug 22, 2009 at 07:43:22PM -0700, Simeon Nifos wrote:
> Dear emacs users,

> (setq-default c-basic-offset 2)

> in my .emacs file works as expected. I am satisfied.

Good!  But `setq' should work just as well (I think).

> However, the same command in .xemacs/init.el or .xemacs/custom.el ....

As a matter of interest, which version of XEmacs are you using (M-x
xemacs-version) and which version of CC Mode (M-x c-version)?

> .... does not do what it does in .emacs. Infact, it does nothing. If I
> open a c++ file with xemacs and then press:

> META-x (enter) ,
> set-variable (enter),
> c-basic-offset (enter)
> 2 (enter)

> then this works only for the current buffer.  If I open a new file in
> the same  buffer it doesn't work for the new file and I need to repeat
> the process.

Yes.  c-basic-offset, along with the other "style variables", becomes
buffer local when CC Mode is loaded.  So you need to set c-basic-offset
_before_ CC Mode gets loaded.  Are you setting c-basic-offset in your
init.el before anything (desktop, perhaps?) that loads CC Mode?

> Is there anyway to make this work as nicely as it works in emacs? You
> see, the only reason I am using xemacs is because it supports TABS
> which emacs doesn't support, as far as I know.

Would you please try starting XEmacs without your initialisation files
(? # xemacs -q --no-site-file), do the setting of c-basic-offset as you
described above, and then loading a C++ source file.  Is c-basic-offset
now 2?

> Could you please enlight me here?

I suspect that you need to move the setting of c-basic-offset earlier in
your .init.el, as suggested above.

> By the way, I love emacs but I am really frustrated by the fact that
> the learning curve is so bad ... (exponential in time).

That's the way Emacs is.  It's supremely easy to use, but maddeningly
difficult to learn.  We've all been through this, so don't worry about
it.  It's not just you.  ;-)

> Isn't there any manual-tutorial, how to set up the essential features a
> normal guy needs by his editor... I mean features provided by default
> in several IDE environments for c++ at least ...

There's the CC Mode manual.  It's available at
<http://cc-mode.sf.net/html-manual/>, or if you prefer to download it
(e.g. in info format), <http://cc-mode.sf.net/manual/>.

Emacs in general, and CC Mode in particular, allow you to set things up
the way you want them, rather than imposing "helpful" things on you the
way many editors and GUIs do.  The way you work best isn't the same as
how other people work.  The trouble about this is that you _must_ spend
time on getting these things set up.

> I have lost days and days to set up some subset of the features I need
> googling all over the web and by trial and error ...

What features do you need?  Some of them will just be a matter of
configuration, some might need a bit of hacking.  I'll probably be able
to help you out.

By the way, I've directed replies to bug-cc-mode@gnu.org, the canonical
mailing list for these things.

> Thanks in advance,
> SN.

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

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