all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "jronald" <followait@163.com>
Subject: Re: setq and setq-default
Date: Thu, 14 Sep 2006 02:26:12 +0800	[thread overview]
Message-ID: <ee9iga$doq$1@news.yaako.com> (raw)
In-Reply-To: 1158164996.335560.182180@i3g2000cwc.googlegroups.com

I think setq-default set a global variable, and setq set a variable in its 
scope, which may override the global one.
If so, can setq set a global variable when it is in the global scope.

If tab-width and default-tab-width both exsists, what is the priority emacs 
treats them?

<robert.thorpe@antenova.com> 
??????:1158164996.335560.182180@i3g2000cwc.googlegroups.com...
> jronald wrote:
>> I studied them for a while, but without details and examples.
>>
>> For example, what is the difference of the two below:
>> (setq-default tab-width 8)
>
> This is the general way to set the default value of a variable.  If you
> put (setq-default foo 9) then in the context of every buffer you create
> foo will be 9 unless the buffer has it's own value for that variable.
>
>> (setq default-tab-width 8)
>
> This means the same thing, except it is a mechanism specific to
> tab-width, not all variables have a special "default" form associated
> with them.  Only a handful have them, I don't know why, perhaps
> setq-default didn't exist in very early Emacs.
> 

  reply	other threads:[~2006-09-13 18:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-13 15:03 setq and setq-default jronald
2006-09-13 16:29 ` robert.thorpe
2006-09-13 18:26   ` jronald [this message]
2006-09-14 18:42     ` robert.thorpe
2006-09-14 18:57       ` David Kastrup
2006-09-15 11:00         ` robert.thorpe
     [not found] <ee94hs$48u$1@news.yaako.com>
2006-09-13 15:31 ` Reiner Steib

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='ee9iga$doq$1@news.yaako.com' \
    --to=followait@163.com \
    /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.