From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: seberino@spawar.navy.mil (Christian Seberino) Newsgroups: gmane.emacs.help Subject: Re: Please why ORDER of .emacs lines here matters..... Date: 31 Jul 2003 22:36:22 -0700 Organization: http://groups.google.com/ Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <3F298FDA.10906@yahoo.com> NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1059716464 2960 80.91.224.249 (1 Aug 2003 05:41:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 1 Aug 2003 05:41:04 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 01 07:41:03 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19iSea-0000kn-00 for ; Fri, 01 Aug 2003 07:40:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19iSeL-0007Kp-LN for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Aug 2003 01:40:21 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 66 Original-NNTP-Posting-Host: 67.112.141.226 Original-X-Trace: posting.google.com 1059716183 9550 127.0.0.1 (1 Aug 2003 05:36:23 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 1 Aug 2003 05:36:23 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:115606 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11524 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11524 Kevin Thanks so much. I'm impressed because I tried your theory that py-indent-offset would work like I wanted in second buffer even though it did not work in first. This was indeed true!!! Why is it better/different to invoke my customizations in a "hook" then just calling my function in place of the mode??? My way worked for c, java, fortran77 and fortran90. It would have worked in python too except for this one variable.... Should I redo all other langs to have "hook functions"?? Like cs-java-mode-hook, cs-fortran90-mode-hook, etc.??? If it is better in general for some reason then I'll do it. I am *very* grateful for this insight. This was really bugging me! Chris Kevin Rodgers wrote in message news:<3F298FDA.10906@yahoo.com>... > Christian Seberino wrote: > > > Notice the py-indent-offset line (2nd one) below. If I move this > > line further down then I don't > > get 8 space idents anymore. The order matters!!!! But why??? > > py-indent-offset is probably a buffer local variable whose value is set > in the python-mode function to the global default. setq-default only > affects the global value, so if you set that after calling python-mode > the buffer local binding is already set to the original value. (If that > is true, then your claim the it doesn't work isn't quite true: the first > Python mode buffer will have the old global default, but subsequent > Python mode buffers should have the new global default.) > > > > (defun cs-python-mode() > > (setq-default py-indent-offset 8 ) > > (python-mode) > > (turn-on-font-lock) > > (setq-default auto-fill-function 'do-auto-fill) > > (setq-default py-python-command "python2.2" ) > > (setq-default py-continuation-offset 8 ) > > (setq-default py-smart-indentation nil ) > > (setq-default py-block-comment-prefix "#" )) > > Either move those setq-defaults to the top level (outside your function), > > or just use python mode: > > (add-hook 'python-mode-hook 'cs-python-mode-hook) > > (defun cs-python-mode-hook () > (turn-on-font-lock) > (setq auto-fill-function 'do-auto-fill > py-python-command "python2.2" > py-indent-offset 8 > py-continuation-offset 8 > py-smart-indentation nil > py-block-comment-prefix "#"))