* Re: xemacs and c-basic-offset
2009-08-23 2:43 xemacs and c-basic-offset Simeon Nifos
@ 2009-08-23 3:38 ` Daniel Pittman
[not found] ` <mailman.5185.1250999548.2239.help-gnu-emacs@gnu.org>
2009-08-23 18:20 ` Alan Mackenzie
2 siblings, 0 replies; 5+ messages in thread
From: Daniel Pittman @ 2009-08-23 3:38 UTC (permalink / raw)
To: help-gnu-emacs
Simeon Nifos <archwndas@googlemail.com> writes:
> Dear emacs users, (setq-default c-basic-offset 2) in my .emacs file works as
> expected. I am satisfied.
>
> However, the same command in .xemacs/init.el or .xemacs/custom.el 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. Is there anyway to make this work as nicely as it works
> in emacs?
You perhaps want to use `customize-variable', which should do the right thing
about getting the setting, um, set. It prompts for the variable. You might
also find more comfort in M-x customize-group c RET
This probably isn't the best place to seek XEmacs specific advice, though, and
an XEmacs group is more likely to have qualified people to assist you.
> You see, the only reason I am using xemacs is because it supports TABS which
> emacs doesn't support, as far as I know.
I am not certain what about TABS you are missing, but the Emacs info manual,
accessible with C-h r, seems to cover this:
C-h F tab-to-tab-stop RET
Then, read that node, or visit the "Tab Stops" section below which talks about
how Emacs implements arbitrary tab stops in buffers.
> By the way, I love emacs but I am really frustrated by the fact that the
> learning curve is so bad ... (exponential in time).
Did you run through the tutorial, accessible with C-h t? Did that help, or
are your problems after you got to that point?
Do you know about customize, the easy way to configure Emacs?
> Isn't there any manual-tutorial, how to set up the essential features a
> normal guy needs by his editor...
Generally speaking, Emacs offers those features out of the box. The problem
is that the common ground between what you, I, and every other "normal
person"[1] needs is pretty small.
For example: I have not touched a c-mode setting in years, because I do next
to no C level development any longer. I have, however, invested substantial
effort into configuring Perl mode, which many people will not care about a
whit.
> I mean features provided by default in several IDE environments for c++ at
> least ...
Mmmm. You may be stuck with the fact that Emacs, out of the box, doesn't do a
lot of the things that these other environments do by default. On the other
hand, Emacs doesn't *restrict* you to those things, either, which I prefer.
That said, Emacs is not the be-all and end-all of editors[2], so if you find
it easier to edit C++ in one of those IDEs you may just want to stick with
that.
I won't deny that Emacs has ...
> 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 ...
... quite a learning curve, and can be difficult to follow. I think the
effort is rewarded, but you may not. Don't be afraid to say "this tool isn't
for me" — I did, regarding vi derivatives, because they don't work the way /I/
like to work, not because either I, or the tool, is defective.
Regards,
Daniel
Footnotes:
[1] Since, y'know, plenty of women use Emacs as well, so you shouldn't
exclude them from consideration.
[2] Well, I think it is, but opinions clearly vary as people seem to keep
using all those other editors as well, and liking them. :)
--
✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707
♽ made with 100 percent post-consumer electrons
Looking for work? Love Perl? In Melbourne, Australia? We are hiring.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: xemacs and c-basic-offset
2009-08-23 2:43 xemacs and c-basic-offset Simeon Nifos
2009-08-23 3:38 ` Daniel Pittman
[not found] ` <mailman.5185.1250999548.2239.help-gnu-emacs@gnu.org>
@ 2009-08-23 18:20 ` Alan Mackenzie
2 siblings, 0 replies; 5+ messages in thread
From: Alan Mackenzie @ 2009-08-23 18:20 UTC (permalink / raw)
To: Simeon Nifos; +Cc: help-gnu-emacs
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).
^ permalink raw reply [flat|nested] 5+ messages in thread