[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: indentation, setting variables, commands, and M-x
From: |
john_sips_tea |
Subject: |
Re: indentation, setting variables, commands, and M-x |
Date: |
3 Feb 2006 11:21:10 -0800 |
User-agent: |
G2/0.2 |
Wow! Thanks for all the great replies everyone.
I've summarized them into my own notes here:
http://www.simisen.com/jmg/emacs.html
http://www.simisen.com/jmg/info_command.html
I few things I didn't understand from your resplies:
Eli wrote:
> > (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.
Do that right in the text/buffer that I'm editing?
Alan wrote:
> Actually, TAB doesn't indent to the next indent-level, it indents to the
> _correct_ level, as determined by the syntax of the source code.
Sweet. Sounds easy to get used to. :)
> There is an extra complication with tab-width: it is a "buffer-local"
> variable, i.e. when you set it, the setting only has effect in the
> current buffer. To change the default, use `setq-default'. To change
> the value in the current buffer, use `setq'.
Thanks for the clarification. :)
> Autoindentation is enabled by default for programming modes like C Mode
> and Emacs Lisp Mode.
Ah. The major programming language modes (am I saying that right?)
are more sophisticated than I'd thought.
What's the difference between a "mode" and a "variable"?
indent-tabs-mode looks like it could be both...
Peter wrote:
> You can look up a 'variable' with the command C-h v. In the mini-
> buffer you'll be prompted for a name, but you can try (command)
> completion, pressing TAB. Then a *Completions* buffer opens showing
> all variables available.
Nice. Didn't know about C-h v.
> Autoindent works in kind of 'qualified' modes.
Hm. Well, It doesn't seem to be working for me. I tried
creating a .java file and a .py file, and editing both, neither
one autoindents. It could be that I need to install some
extra Python mode? But that doesn't explain why the java
one wouldn't work...
BTW, here's my first attempt at a ~/.emacs file:
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq-default transient-mark-mode 1)
(setq-default font-lock-mode 1)
Does that look right?
The transient-mark-mode works, but the font-lock-mode
doesn't seem to work... Hm. If I open a .java file, syntax
highlighting only works only if I do:
M-x font-lock-mode
M-x font-lock-mode
(disable, then re-enable). Weird... (Actually, please
let me know if that's the topic of a different thread.)
Thanks,
---John
- indentation, setting variables, commands, and M-x, John M. Gabriele, 2006/02/03
- Re: indentation, setting variables, commands, and M-x, Eli Zaretskii, 2006/02/03
- Re: indentation, setting variables, commands, and M-x, Alan Mackenzie, 2006/02/03
- Re: indentation, setting variables, commands, and M-x, Peter Dyballa, 2006/02/03
- RE: indentation, setting variables, commands, and M-x, Drew Adams, 2006/02/03
- Re: indentation, setting variables, commands, and M-x,
john_sips_tea <=
- Re: indentation, setting variables, commands, and M-x, john_sips_tea, 2006/02/03
- Re: indentation, setting variables, commands, and M-x, Peter Dyballa, 2006/02/03
- Re: indentation, setting variables, commands, and M-x, Kevin Rodgers, 2006/02/06
- Re: indentation, setting variables, commands, and M-x, Peter Dyballa, 2006/02/06
- Message not available
- Re: indentation, setting variables, commands, and M-x, Neil Cerutti, 2006/02/03
- Re: indentation, setting variables, commands, and M-x, John M. Gabriele, 2006/02/04
- Prev by Date:
RE: indentation, setting variables, commands, and M-x
- Next by Date:
Re: indentation, setting variables, commands, and M-x
- Previous by thread:
RE: indentation, setting variables, commands, and M-x
- Next by thread:
Re: indentation, setting variables, commands, and M-x
- Index(es):