* indentation, setting variables, commands, and M-x
@ 2006-02-03 5:18 John M. Gabriele
2006-02-03 7:48 ` Eli Zaretskii
` (5 more replies)
0 siblings, 6 replies; 17+ messages in thread
From: John M. Gabriele @ 2006-02-03 5:18 UTC (permalink / raw)
Hi, I've just started to learn emacs, and would like to try
using it as my primary editor/IDE, but first need to get a few
things set up. For one thing, the indentation issue.
I'd like to only get spaces in my files, 4 for each level of
indentation, and also have the autoindent work (filling in
spaces as necessary). That is, when I hit the TAB key, I want
to get enough spaces to the next indent-level, filling in
spaces along the way.
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?
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?
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. :) But, again, how
do I "set a variable" for emacs (both in my .emacs file,
and live, while editing)?
Regarding the autoindent, Reading here:
http://www.emacswiki.org/cgi-bin/wiki/AutoIndentation it
sounds like autoindent isn't something that comes free, but
instead, to get it, you have to put a one-liner into your
.emacs file. Seems like maybe something that should be
default behaviour, no?
Thanks!
---J
--
(remove zeez if demunging email address)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
2006-02-03 5:18 indentation, setting variables, commands, and M-x John M. Gabriele
@ 2006-02-03 7:48 ` Eli Zaretskii
2006-02-03 8:54 ` Alan Mackenzie
` (4 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Eli Zaretskii @ 2006-02-03 7:48 UTC (permalink / raw)
> 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.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
2006-02-03 5:18 indentation, setting variables, commands, and M-x John M. Gabriele
2006-02-03 7:48 ` Eli Zaretskii
@ 2006-02-03 8:54 ` Alan Mackenzie
2006-02-03 16:49 ` Cameron Desautels
2006-02-03 9:53 ` Peter Dyballa
` (3 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Alan Mackenzie @ 2006-02-03 8:54 UTC (permalink / raw)
John M. Gabriele <john_sips_teaz@yahooz.com> wrote on Fri, 03 Feb 2006
00:18:20 -0500:
> Hi, I've just started to learn emacs, and would like to try using it as
> my primary editor/IDE, but first need to get a few things set up. For
> one thing, the indentation issue.
> I'd like to only get spaces in my files, 4 for each level of
> indentation, and also have the autoindent work (filling in spaces as
> necessary). That is, when I hit the TAB key, I want to get enough
> spaces to the next indent-level, filling in spaces along the way.
This is an absolutely standard setup for Emacs. You're in good company!
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.[*] So
if you pressed TAB on the following line:
if (foo)
{
bar () ;
baz () ; <===== press TAB on this line
, you'd get this:
if (foo)
{
bar () ;
baz () ;
[*] If you really, really, really want TAB to indent to the _next_ level,
you can configure this.
> 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?
A bit of background: your .emacs, your configuration file, is "just" a
file, and you can edit it like any other file. The best way to create it
is with C-x C-f <ret> ~/.emacs <ret>.
However, editing .emacs means knowing at least a minimal amount of Lisp.
The "customization" facility is a form-based point-and-click interface
which changes your .emacs without you having to grok Lisp.
To "customize the indent-tabs-mode variable", you'd do this: M-x
customize-variable <ret> indent-tabs-mode <ret>. You then change the
fields on the form, finally clicking on <save-for-future-sessions>. This
writes something like "(setq-default indent-tabs-mode t)" into your
.emacs file, creating the file if necessary.
Note that you might find the customization form not as simple and
straightforward as you might expect.
> 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?
If you execute some Lisp whilst editing, its effect won't be saved for
future sessions. The simplest way to execute lisp is with M-: (that's
"meta-colon"; use "<escape> :" if your keyboard can't do M-:).
> 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. :) But, again, how do I "set a variable" for
> emacs (both in my .emacs file, and live, while editing)?
Whilst editing: either M-x set-variable, or M-: (setq tab-width 4), or
use customize-variable. That's a matter of personal taste. For your
.emacs, either customize-variable, or write (setq-default tab-width 4)
directly into the file.
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'.
> Regarding the autoindent, Reading here:
> http://www.emacswiki.org/cgi-bin/wiki/AutoIndentation it sounds like
> autoindent isn't something that comes free, but instead, to get it, you
> have to put a one-liner into your .emacs file. Seems like maybe
> something that should be default behaviour, no?
Autoindentation is enabled by default for programming modes like C Mode
and Emacs Lisp Mode.
> ---J
Have fun!
--
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
2006-02-03 5:18 indentation, setting variables, commands, and M-x John M. Gabriele
2006-02-03 7:48 ` Eli Zaretskii
2006-02-03 8:54 ` Alan Mackenzie
@ 2006-02-03 9:53 ` Peter Dyballa
2006-02-03 15:52 ` Drew Adams
` (2 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Peter Dyballa @ 2006-02-03 9:53 UTC (permalink / raw)
Am 03.02.2006 um 06:18 schrieb John M. Gabriele:
> 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?
GNU Emacs allows you to (almost) simultaneously edit a large number
of files or files not yet saved as files in modified buffers. That "M-
x something" means that you invoke a command, a Lisp function for
interactive use (there are also non-interactive Lisp functions). To
stop editing one file (buffer) you just change to another buffer
(whose contents comes or comes not from an existing file) or you
create a new buffer by opening a file, .emacs for example. You can
decide to save what was achieved in the original buffer (although GNU
Emacs automatically saves the work in progress and keeps an almost
indefinite amount of undo's).
Any change you do to .emacs does *not* change the way the running GNU
Emacs behaves. It just prepares for the next one. If you want your
change apply for the running one, too, you would need to evaluate the
Lisp code.
See also my next answer.
>
> 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. :) But, again, how
> do I "set a variable" for emacs (both in my .emacs file,
> and live, while editing)?
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. You can scroll through these buffer by
pressing SPACE repeatedly and then 'pick' a name, or at the prompt
you can start writing the variable name's beginning and expand this
string with TAB until it starts to become ambiguous, i.e. there is
more than one choice to complete the name. If you see the variable
printed somewhere you can position the cursor on it and invoke C-h v.
Once the *Help* buffer is created which explains the variable, you
often see a hint that you can customise this variable. Follow the
hyper link and a *Customization* buffer opens. You can just try the
new setting (it changes Emacs' behaviour at run time), and you can
save this setting in .emacs, at once or later.
>
> Regarding the autoindent, Reading here:
> http://www.emacswiki.org/cgi-bin/wiki/AutoIndentation it
> sounds like autoindent isn't something that comes free, but
> instead, to get it, you have to put a one-liner into your
> .emacs file. Seems like maybe something that should be
> default behaviour, no?
Autoindent works in kind of 'qualified' modes. In text mode you
indent in such a way that words in the next line start in the same
column as the words in the line above, columns of words are built.
The one-liners can modify the way autoindentation works in the many
modes.
To find the default behaviour of modes just stay without a .emacs
file or launch GNU Emacs with the option -q, which makes it not to
read .emacs.
--
Greetings
Pete
Ce qui été compris n'existe plus. (Paul Eluard)
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: indentation, setting variables, commands, and M-x
2006-02-03 5:18 indentation, setting variables, commands, and M-x John M. Gabriele
` (2 preceding siblings ...)
2006-02-03 9:53 ` Peter Dyballa
@ 2006-02-03 15:52 ` Drew Adams
2006-02-03 19:21 ` john_sips_tea
[not found] ` <mailman.38.1138993306.2860.help-gnu-emacs@gnu.org>
5 siblings, 0 replies; 17+ messages in thread
From: Drew Adams @ 2006-02-03 15:52 UTC (permalink / raw)
Hi, I've just started to learn emacs, and would like to try
using it as my primary editor/IDE, but first need to get a few
things set up. For one thing, the indentation issue.
Emacs Wiki is a great source for information, but another source, which is
generally more complete, more official, and more accessible is the Emacs
manual. Just use `C-h i' (Control-h i) in Emacs, click "Emacs" (for the
Emacs manual), and then search for what you want.
The manual is in Info mode. To get information on the current mode (whatever
it is) at any time in Emacs, use `C-h m' (all Emacs help commands start with
`C-h', and `C-h ?' gives you the list).
In this case, you want to search the manual for "indent" or "indentation".
Looking through the explanation of Info mode (from `C-h m'), you'll see that
`i' looks up a topic in the index, and `s' searches the manual for a term.
Using either `i indentation' or `s indentation' will soon get you to the
part of the manual that answers most of your questions (`i indentation' will
take you there directly, because there is an "indentation" index entry).
Emacs is a self-documenting system - perhaps the first such and still
probably the best. Spend some time learning the help commands first (`C-h
?'), then explore the manual a bit. You'll soon be hooked.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
2006-02-03 8:54 ` Alan Mackenzie
@ 2006-02-03 16:49 ` Cameron Desautels
0 siblings, 0 replies; 17+ messages in thread
From: Cameron Desautels @ 2006-02-03 16:49 UTC (permalink / raw)
On Fri, Feb 03, 2006 at 08:54:28AM +0000, Alan Mackenzie wrote:
> A bit of background: your .emacs, your configuration file, is "just" a
> file, and you can edit it like any other file. The best way to create it
> is with C-x C-f <ret> ~/.emacs <ret>.
I believe you meant to say "C-x C-f ~/.emacs RET". You got an extra
return in there (which puts you into dired mode and then you flag all
backup files...).
--
Cameron Desautels <cam@apt2324.com>
<@buo> A byte walks into a bar and orders a pint. Bartender asks him
"what's wrong?" Byte says "parity error."
Bartender nods and says "yeah, I thought you looked a bit off."
--http://www.bash.org/?450301
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
2006-02-03 5:18 indentation, setting variables, commands, and M-x John M. Gabriele
` (3 preceding siblings ...)
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
[not found] ` <mailman.38.1138993306.2860.help-gnu-emacs@gnu.org>
5 siblings, 2 replies; 17+ messages in thread
From: john_sips_tea @ 2006-02-03 19:21 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
2006-02-03 19:21 ` john_sips_tea
@ 2006-02-03 19:27 ` john_sips_tea
2006-02-03 23:12 ` Peter Dyballa
1 sibling, 0 replies; 17+ messages in thread
From: john_sips_tea @ 2006-02-03 19:27 UTC (permalink / raw)
I wrote:
> I few things I didn't understand from your resplies:
Eeek. My fingers must've staged a revolt during the writing of that
sentence. :)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
[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
1 sibling, 1 reply; 17+ messages in thread
From: Neil Cerutti @ 2006-02-03 20:05 UTC (permalink / raw)
On 2006-02-03, Drew Adams <drew.adams@oracle.com> wrote:
> In this case, you want to search the manual for "indent" or
> "indentation". Looking through the explanation of Info mode (from
> `C-h m'), you'll see that `i' looks up a topic in the index, and `s'
> searches the manual for a term. Using either `i indentation' or `s
> indentation' will soon get you to the part of the manual that
> answers most of your questions (`i indentation' will take you there
> directly, because there is an "indentation" index entry).
It's a slight pain when Emacs uses vocabulary that is hard to guess,
e.g., fill for line-wrapping, and font-lock for syntax coloring. In
these situations, s and i aren't much good.
Those issues are slowly sorting themselves out for me, though.
> Emacs is a self-documenting system - perhaps the first such and
> still probably the best. Spend some time learning the help commands
> first (`C-h ?'), then explore the manual a bit. You'll soon be
> hooked.
I'm finally learning emacs because the functional programming world
seems to rely on it for so many of their IDEs. I'm on a strict regimen
of NO VIM until I'm finally confortable with it. Learning vim first
was just a historical accident, after all.
--
Neil Cerutti
When you're in the public eye, it's wrong to cheat on someone,
unless you're very careful. If you're normal and no one's going
to know, then do it. --Paris Hilton
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
[not found] ` <mailman.38.1138993306.2860.help-gnu-emacs@gnu.org>
2006-02-03 20:05 ` Neil Cerutti
@ 2006-02-03 20:55 ` john_sips_tea
2006-02-04 17:27 ` Drew Adams
1 sibling, 1 reply; 17+ messages in thread
From: john_sips_tea @ 2006-02-03 20:55 UTC (permalink / raw)
> In this case, you want to search the manual for "indent" or "indentation".
> Looking through the explanation of Info mode (from `C-h m'), you'll see that
> `i' looks up a topic in the index, and `s' searches the manual for a term.
Ok, I hit C-h m,and it waits for me to give a menu name. How do I get
to a
place where I can hit 'i' to look up a topic in the "index"? I see that
's' asks
me for a regex to search for, and it searches down the page, from the
current cursor location to find it. Is there a separate index page for
each
node? Or maybe only some nodes?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
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
1 sibling, 1 reply; 17+ messages in thread
From: Peter Dyballa @ 2006-02-03 23:12 UTC (permalink / raw)
Cc: Emacs help
Am 03.02.2006 um 20:21 schrieb john_sips_tea@yahoo.com:
> (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...
You need to do a bit more. font-lock-mode is a bit shy
(conservative). I have in my .emacs:
(cond ((fboundp 'global-font-lock-mode)
;; Turn on font-lock in all modes that support it
(setq global-font-lock-mode t)
; (setq font-lock-multiline 'undecided')
(setq jit-lock-stealth-verbose t)
(setq jit-lock-mode t)
; (setq jit-lock-stealth-load 80)
;; Maximum colors
(setq font-lock-maximum-decoration t)))
--
Greetings
Pete
Stau ist nur hinten blöd, vorne geht's!
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
2006-02-03 20:05 ` Neil Cerutti
@ 2006-02-04 11:13 ` Eli Zaretskii
0 siblings, 0 replies; 17+ messages in thread
From: Eli Zaretskii @ 2006-02-04 11:13 UTC (permalink / raw)
> From: Neil Cerutti <leadvoice@email.com>
> Date: 3 Feb 2006 21:05:09 +0100
>
> It's a slight pain when Emacs uses vocabulary that is hard to guess,
> e.g., fill for line-wrapping, and font-lock for syntax coloring. In
> these situations, s and i aren't much good.
That's why there's the Glossary section in the manual. You should
look there until you are familiar with Emacspeak.
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: indentation, setting variables, commands, and M-x
2006-02-03 20:55 ` john_sips_tea
@ 2006-02-04 17:27 ` Drew Adams
0 siblings, 0 replies; 17+ messages in thread
From: Drew Adams @ 2006-02-04 17:27 UTC (permalink / raw)
> In this case, you want to search the manual for "indent" or
> "indentation".
> Looking through the explanation of Info mode (from `C-h m'),
> you'll see that
> `i' looks up a topic in the index, and `s' searches the
> manual for a term.
Ok, I hit C-h m,and it waits for me to give a menu name. How do I get
to a place where I can hit 'i' to look up a topic in the "index"?
I see that 's' asks me for a regex to search for, and it searches
down the page, from the current cursor location to find it.
Is there a separate index page for each node? Or maybe only some nodes?
I probably wasn't clear enough.
C-h i -- enters Info
Click Emacs link -- enter Emacs manual
C-h m -- get help on Info mode
Read the Info mode help; it describes key bindings in Info mode, including
these bindings (you may have to scroll down the *Help* window a bit (use C-x
o to switch windows):
i Look up a topic in this file's Index and move to that node.
s Search through this Info file for specified regexp,
and select the node in which the next occurrence is found.
In buffer (window) *info*, use `C-x 1' to get rid of the *Help* window.
It is in Info mode (buffer *info*) that you can use the Info-mode key
bindings such as `i' and `s'.
My guess is that you used simply `m' in Info mode, not `C-h m'. `m' asks for
a menu item to visit.
`s' and `i' are totally separate. `s' simply searches; `i' looks up a term
in the manual's index.
`s' searches for a regexp, but that can be as simple as a word. You can use
`s' again, hitting just `RET' (Return key) to reuse the last input (e.g.
word). So, for example, `s indentation RET' finds the first occurrence in
the manual of "indentation". Then, `s RET' finds the next occurrence of
"indentation". Repeat `s RET' as needed. As I mentioned, when appropriate,
`i' is much quicker; in this case it takes you directly to the manual
section on indentation.
HTH.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
[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
0 siblings, 1 reply; 17+ messages in thread
From: John M. Gabriele @ 2006-02-05 3:46 UTC (permalink / raw)
Drew Adams wrote:
> > In this case, you want to search the manual for "indent" or
> > "indentation".
> > Looking through the explanation of Info mode (from `C-h m'),
> > you'll see that
> > `i' looks up a topic in the index, and `s' searches the
> > manual for a term.
>
> Ok, I hit C-h m,and it waits for me to give a menu name. How do I get
> to a place where I can hit 'i' to look up a topic in the "index"?
> I see that 's' asks me for a regex to search for, and it searches
> down the page, from the current cursor location to find it.
> Is there a separate index page for each node? Or maybe only some nodes?
>
> I probably wasn't clear enough.
>
> C-h i -- enters Info
> Click Emacs link -- enter Emacs manual
> C-h m -- get help on Info mode
>
> Read the Info mode help;
Ah. I get it now. "Info" mode is just like any other mode. :)
Also: C-h m == M-x describe-mode
> it describes key bindings in Info mode, including
> these bindings (you may have to scroll down the *Help* window a bit (use C-x
> o to switch windows):
>
> i Look up a topic in this file's Index and move to that node.
> s Search through this Info file for specified regexp,
> and select the node in which the next occurrence is found.
>
> In buffer (window) *info*, use `C-x 1' to get rid of the *Help* window.
>
> It is in Info mode (buffer *info*) that you can use the Info-mode key
> bindings such as `i' and `s'.
Got it. I previously had a problem with that because I wasn't first
at the Emacs node before hitting 'i'. Thanks.
> My guess is that you used simply `m' in Info mode, not `C-h m'. `m' asks for
> a menu item to visit.
Yes. 'm' gets to to where a menu item leads if I can type it in by name.
> `s' and `i' are totally separate. `s' simply searches; `i' looks up a term
> in the manual's index.
>
> `s' searches for a regexp, but that can be as simple as a word. You can use
> `s' again, hitting just `RET' (Return key) to reuse the last input (e.g.
> word). So, for example, `s indentation RET' finds the first occurrence in
> the manual of "indentation". Then, `s RET' finds the next occurrence of
> "indentation". Repeat `s RET' as needed. As I mentioned, when appropriate,
> `i' is much quicker; in this case it takes you directly to the manual
> section on indentation.
>
> HTH.
It does help. Thanks Drew. It's interesting how similar the info program
works compared to something like lynx (that is, if your docs were just
in html, and you used a text-mode html browser to access them). The main
difference I'm seeing right now is, that info nodes have an order to them
(you can hit 'n' for next, 'p' for previous) as well as having links
("menus" and "cross-references"), whereas html has only links.
---J
--
(remove zeez if demunging email address)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
2006-02-05 3:46 ` John M. Gabriele
@ 2006-02-05 19:52 ` Eli Zaretskii
0 siblings, 0 replies; 17+ messages in thread
From: Eli Zaretskii @ 2006-02-05 19:52 UTC (permalink / raw)
> From: "John M. Gabriele" <john_sips_teaz@yahooz.com>
> Date: Sat, 04 Feb 2006 22:46:35 -0500
>
> It's interesting how similar the info program
> works compared to something like lynx (that is, if your docs were just
> in html, and you used a text-mode html browser to access them). The main
> difference I'm seeing right now is, that info nodes have an order to them
> (you can hit 'n' for next, 'p' for previous) as well as having links
> ("menus" and "cross-references"), whereas html has only links.
The other (more important, IMHO) difference is that Info can search
via the index (the `i' command), which is much more efficient way of
finding things quickly, i.e. using a manual like a reference.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
2006-02-03 23:12 ` Peter Dyballa
@ 2006-02-06 18:36 ` Kevin Rodgers
2006-02-06 21:11 ` Peter Dyballa
0 siblings, 1 reply; 17+ messages in thread
From: Kevin Rodgers @ 2006-02-06 18:36 UTC (permalink / raw)
Peter Dyballa wrote:
> Am 03.02.2006 um 20:21 schrieb john_sips_tea@yahoo.com:
>> (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...
>
> You need to do a bit more. font-lock-mode is a bit shy (conservative).
> I have in my .emacs:
>
> (cond ((fboundp 'global-font-lock-mode)
> ;; Turn on font-lock in all modes that support it
> (setq global-font-lock-mode t)
> ; (setq font-lock-multiline 'undecided')
> (setq jit-lock-stealth-verbose t)
> (setq jit-lock-mode t)
> ; (setq jit-lock-stealth-load 80)
> ;; Maximum colors
> (setq font-lock-maximum-decoration t)))
Why would you test global-font-lock-mode's function binding, then set
its variable binding? Especially since its doc string tells you to call
the function: (global-font-lock-mode 1)
,----[ C-h v global-font-lock-mode RET ]
| Setting this variable directly does not take effect;
| use either M-x customize or the function `global-font-lock-mode'.
`----
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: indentation, setting variables, commands, and M-x
2006-02-06 18:36 ` Kevin Rodgers
@ 2006-02-06 21:11 ` Peter Dyballa
0 siblings, 0 replies; 17+ messages in thread
From: Peter Dyballa @ 2006-02-06 21:11 UTC (permalink / raw)
Cc: help-gnu-emacs
Am 06.02.2006 um 19:36 schrieb Kevin Rodgers:
> Why would you test global-font-lock-mode's function binding, then set
> its variable binding? Especially since its doc string tells you to
> call
> the function: (global-font-lock-mode 1)
Because I make mistakes and do not read everything ... I'll correct
my .emacs! Thanks!
--
Greetings
Pete
Mac OS X is like a wigwam: no fences, no gates, but an apache inside.
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2006-02-06 21:11 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-03 5:18 indentation, setting variables, commands, and M-x John M. Gabriele
2006-02-03 7:48 ` Eli Zaretskii
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
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).