unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
Subject: Re: indentation, setting variables, commands, and M-x
Date: Fri, 03 Feb 2006 09:48:15 +0200	[thread overview]
Message-ID: <ur76kkhmo.fsf@gnu.org> (raw)
In-Reply-To: <KKBEf.155$ZY.99@fe12.lga> (john_sips_teaz@yahooz.com)

> From: "John M. Gabriele" <john_sips_teaz@yahooz.com>
> Date: Fri, 03 Feb 2006 00:18:20 -0500
> 
> I just read here: http://www.emacswiki.org/cgi-bin/wiki/NoTabs
> that I can add this
> 
>      (setq-default indent-tabs-mode nil)
> 
> to my .emacs file (which I haven't yet created). That page says
> I can "customize the indent-tabs-mode variable". What does that
> mean exactly? How do I go about "customizing" it?

Customizing a variable means do exactly what you are about to do: add
a line to your .emacs that sets the variable to some value.

The line above is actually Lisp code.  If you want to avoid adding
Lisp to your .emacs yourself, or if some variable needs tricky
customization that your Lisp is not good enough to master, try the
"M-x customize" interface, which will present a buffer with clickable
buttons and then write the necessary Lisp for you.  For example, "M-x
customize-variable RET indent-tabs-mode RET" will do that for the
variable you want.

> I'm also curious: what's the translation between adding the
> above line to my .emacs, and typing something in while editing
> (presumably "M-x something")? That is, if someone tells me a
> line to add to my .emacs file, how can I figure out how to do
> the same thing from within the editor while editing?

The easiest way to do that is type the necessary stuff into your
.emacs, and then evaluate it.  For a single parenthesized expression,
go to the closing right paren and type "C-x C-e".  For several
expressions, do this for each expression in turn.

> Continuing with the indentation issue, I read here:
> http://www.emacswiki.org/cgi-bin/wiki/IndentationBasics that
> there's a number of "variables" I can set. I see "tab-width"
> there. Yay! That looks like what I want. :)

It isn't, most probably, not if you wish to code in C/C++.  For those
languages, the indentation system is very elaborate, so the way to
customize it is to use the interactive procedure explained in the CC
Mode manual.  Type "C-h i m CC mode RET", then "g Interactive RET",
and you will be looking at that explanation.  (This invokes the Info
mode that is a mode to read on-line manuals.  If you aren't yet
familiar with Info, take a few minutes to do so, since a complex
system such as Emacs is impossible to use efficiently without knowing
how to take advantage of its elaborate documentation.)

> But, again, how
> do I "set a variable" for emacs (both in my .emacs file,
> and live, while editing)?

See above.  In addition, for a single variable with a simple value,
typing "M-x set-variable RET indent-tabs-mode RET nil RET" will do
what you want.

  reply	other threads:[~2006-02-03  7:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-03  5:18 indentation, setting variables, commands, and M-x John M. Gabriele
2006-02-03  7:48 ` Eli Zaretskii [this message]
2006-02-03  8:54 ` Alan Mackenzie
2006-02-03 16:49   ` Cameron Desautels
2006-02-03  9:53 ` Peter Dyballa
2006-02-03 15:52 ` Drew Adams
2006-02-03 19:21 ` john_sips_tea
2006-02-03 19:27   ` john_sips_tea
2006-02-03 23:12   ` Peter Dyballa
2006-02-06 18:36     ` Kevin Rodgers
2006-02-06 21:11       ` Peter Dyballa
     [not found] ` <mailman.38.1138993306.2860.help-gnu-emacs@gnu.org>
2006-02-03 20:05   ` Neil Cerutti
2006-02-04 11:13     ` Eli Zaretskii
2006-02-03 20:55   ` john_sips_tea
2006-02-04 17:27     ` Drew Adams
     [not found] <mailman.31.1139095080.2870.help-gnu-emacs@gnu.org>
2006-02-05  3:46 ` John M. Gabriele
2006-02-05 19:52   ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=ur76kkhmo.fsf@gnu.org \
    --to=eliz@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).