From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: xemacs and c-basic-offset Date: Sun, 23 Aug 2009 18:20:58 +0000 Message-ID: <20090823182058.GA5021@muc.de> References: Reply-To: bug-cc-mode@gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251051526 13898 80.91.229.12 (23 Aug 2009 18:18:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Aug 2009 18:18:46 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Simeon Nifos Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 23 20:18:38 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MfHeH-0006kF-R0 for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Aug 2009 20:18:38 +0200 Original-Received: from localhost ([127.0.0.1]:46377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfHeH-0001TQ-5d for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Aug 2009 14:18:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfHdq-0001Sw-Hz for help-gnu-emacs@gnu.org; Sun, 23 Aug 2009 14:18:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfHdm-0001R1-0s for help-gnu-emacs@gnu.org; Sun, 23 Aug 2009 14:18:09 -0400 Original-Received: from [199.232.76.173] (port=40441 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfHdl-0001Qp-Qi for help-gnu-emacs@gnu.org; Sun, 23 Aug 2009 14:18:05 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:3611 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MfHdl-0007fR-9j for help-gnu-emacs@gnu.org; Sun, 23 Aug 2009 14:18:05 -0400 Original-Received: (qmail 89810 invoked by uid 3782); 23 Aug 2009 18:17:59 -0000 Original-Received: from acm.muc.de (pD9E52486.dip.t-dialin.net [217.229.36.134]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 23 Aug 2009 20:17:58 +0200 Original-Received: (qmail 5822 invoked by uid 1000); 23 Aug 2009 18:20:58 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:67452 Archived-At: 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 , or if you prefer to download it (e.g. in info format), . 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).