all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: seberino@spawar.navy.mil (Christian Seberino)
Subject: Re: Please why ORDER of .emacs lines here matters.....
Date: 31 Jul 2003 22:36:22 -0700	[thread overview]
Message-ID: <bf23f78f.0307312136.9385194@posting.google.com> (raw)
In-Reply-To: 3F298FDA.10906@yahoo.com

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 <ihs_4664@yahoo.com> 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 "#"))

  reply	other threads:[~2003-08-01  5:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-31 20:14 Please why ORDER of .emacs lines here matters Christian Seberino
2003-07-31 21:53 ` Kevin Rodgers
2003-08-01  5:36   ` Christian Seberino [this message]
2003-08-01 16:13     ` Kevin Rodgers
2003-08-01 20:50     ` Alan Mackenzie
2003-08-05  8:42     ` Thien-Thi Nguyen
2003-08-08  8:42       ` Alan Mackenzie
2003-08-01 20:48 ` Kai Großjohann
2003-08-10 17:43 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf23f78f.0307312136.9385194@posting.google.com \
    --to=seberino@spawar.navy.mil \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.