unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: Tab
       [not found] ` <20020319092050.960E9CD2B9@smtp.bcn.isoco.net>
@ 2002-03-26 12:59   ` Alexander Koptelov
  0 siblings, 0 replies; 11+ messages in thread
From: Alexander Koptelov @ 2002-03-26 12:59 UTC (permalink / raw)
  Cc: Praveen D V, help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

>>>>> "fxn" == F Xavier Noria <fxn@isoco.com> writes:

    fxn> On Tue, 19 Mar 2002 14:05:11 +0530
    fxn> Praveen D V <praveend@sasken.com> wrote:

    fxn> : Is it possible to see <TAB> characters, like ^I, in Emacs??

    fxn> I used glyph-highlight for that, but the link in the Emacs Lisp List
    fxn> seems to be broken and I cleaned this hard disk recently :-(. Anyone
    fxn> keeps a copy of the source?

Here it is.


[-- Attachment #2: glyph-highlight.el --]
[-- Type: application/emacs-lisp, Size: 4000 bytes --]

[-- Attachment #3: Type: text/plain, Size: 520 bytes --]


I haven't found it in gnu.emacs.sources (strange =\), but message with this
file attached can be found at

http://wuarchive.wustl.edu/usenet/gnu.emacs.sources/articles/6203482.Z

    fxn> -- fxn

Best regards    

    fxn> _______________________________________________ Help-gnu-emacs mailing
    fxn> list Help-gnu-emacs@gnu.org
    fxn> http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

-- 
Alexander Koptelov
Institute for System Programming, Russian Academy of Sciences
e-mail: steve@ispras.ru
icq:    36208499

^ permalink raw reply	[flat|nested] 11+ messages in thread

* TAB
@ 2003-11-17 14:32 David Rasmussen
  2003-11-17 17:31 ` TAB Kevin Rodgers
  2003-11-18  0:45 ` TAB Dan Anderson
  0 siblings, 2 replies; 11+ messages in thread
From: David Rasmussen @ 2003-11-17 14:32 UTC (permalink / raw)


When I edit java-files, most of the times emacs inserts spaces when I 
press TAB to indent something. But sometimes I've found it inserts a TAB 
character instead. Why? How can I turn it off? I never want TAB 
characters when editing Java or C++ source code files.

/David

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TAB
  2003-11-17 14:32 TAB David Rasmussen
@ 2003-11-17 17:31 ` Kevin Rodgers
  2003-11-17 18:16   ` TAB Dan Anderson
                     ` (2 more replies)
  2003-11-18  0:45 ` TAB Dan Anderson
  1 sibling, 3 replies; 11+ messages in thread
From: Kevin Rodgers @ 2003-11-17 17:31 UTC (permalink / raw)


David Rasmussen wrote:

> When I edit java-files, most of the times emacs inserts spaces when I 
> press TAB to indent something. But sometimes I've found it inserts a TAB 
> character instead. Why?


C-h v indent-tabs-mode

> How can I turn it off? I never want TAB 
> characters when editing Java or C++ source code files.

(setq-default indent-tabs-mode nil)	; for all modes, or

(add-hook 'java-mode-hook		; for just java mode
	  (lambda () (setq indent-tabs-mode nil)))

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TAB
  2003-11-17 17:31 ` TAB Kevin Rodgers
@ 2003-11-17 18:16   ` Dan Anderson
  2003-11-18 19:23     ` TAB jan
       [not found]   ` <mailman.170.1069096910.399.help-gnu-emacs@gnu.org>
  2003-11-19  9:42   ` TAB David Rasmussen
  2 siblings, 1 reply; 11+ messages in thread
From: Dan Anderson @ 2003-11-17 18:16 UTC (permalink / raw)
  Cc: help-gnu-emacs

On Mon, 2003-11-17 at 12:31, Kevin Rodgers wrote:
> David Rasmussen wrote:
> 
> > When I edit java-files, most of the times emacs inserts spaces when I 
> > press TAB to indent something. But sometimes I've found it inserts a TAB 
> > character instead. Why?
> 
> 
> C-h v indent-tabs-mode
> 
> > How can I turn it off? I never want TAB 
> > characters when editing Java or C++ source code files.
> 
> (setq-default indent-tabs-mode nil)	; for all modes, or
> 
> (add-hook 'java-mode-hook		; for just java mode
> 	  (lambda () (setq indent-tabs-mode nil)))

That tells him how to turn of tabs.  Is there any way to change tabs to
spaces?  i.e. when tabbing insert 4 spaces instead of a tab (if tabs
default to 4 spaces long)?

-Dan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TAB
       [not found]   ` <mailman.170.1069096910.399.help-gnu-emacs@gnu.org>
@ 2003-11-17 19:42     ` Kevin Rodgers
  2003-11-17 19:49     ` TAB Sean Richards
  1 sibling, 0 replies; 11+ messages in thread
From: Kevin Rodgers @ 2003-11-17 19:42 UTC (permalink / raw)


Dan Anderson wrote:

> On Mon, 2003-11-17 at 12:31, Kevin Rodgers wrote:
>>David Rasmussen wrote:
>>
>>>When I edit java-files, most of the times emacs inserts spaces when I 
>>>press TAB to indent something. But sometimes I've found it inserts a TAB 
>>>character instead. Why?
>>
>>C-h v indent-tabs-mode
>>
>>>How can I turn it off? I never want TAB 
>>>characters when editing Java or C++ source code files.
>>>
>>(setq-default indent-tabs-mode nil)	; for all modes, or
>>
>>(add-hook 'java-mode-hook		; for just java mode
>>	  (lambda () (setq indent-tabs-mode nil)))
> 
> That tells him how to turn of tabs.  Is there any way to change tabs to
> spaces?  i.e. when tabbing insert 4 spaces instead of a tab (if tabs
> default to 4 spaces long)?

I don't even know what you mean by "turn off tabs".  Setting indent-tabs-mode

to nil does exactly what its doc string says: the TAB key, which is bound to
c-indent-command, will always insert spaces and never insert tab characters:

| TAB runs the command c-indent-command
|    which is an interactive compiled Lisp function in `cc-cmds'.
| (c-indent-command &optional ARG)
|
| Indent current line as C code, and/or insert some whitespace.
...
|  [*] The amount and kind of whitespace inserted is controlled by the
|  variable `c-insert-tab-function', which is called to do the actual
|  insertion of whitespace.  Normally the function in this variable
|  just inserts a tab character, or the equivalent number of spaces,
|  depending on the variable `indent-tabs-mode'.


-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TAB
       [not found]   ` <mailman.170.1069096910.399.help-gnu-emacs@gnu.org>
  2003-11-17 19:42     ` TAB Kevin Rodgers
@ 2003-11-17 19:49     ` Sean Richards
  1 sibling, 0 replies; 11+ messages in thread
From: Sean Richards @ 2003-11-17 19:49 UTC (permalink / raw)


Dan Anderson <dan@mathjunkies.com> writes:

> On Mon, 2003-11-17 at 12:31, Kevin Rodgers wrote:
>> David Rasmussen wrote:
>> 
>> > When I edit java-files, most of the times emacs inserts spaces when I 
>> > press TAB to indent something. But sometimes I've found it inserts a TAB 
>> > character instead. Why?
>> 
>> 
>> C-h v indent-tabs-mode
>> 
>> > How can I turn it off? I never want TAB 
>> > characters when editing Java or C++ source code files.
>> 
>> (setq-default indent-tabs-mode nil)	; for all modes, or
>> 
>> (add-hook 'java-mode-hook		; for just java mode
>> 	  (lambda () (setq indent-tabs-mode nil)))
>
> That tells him how to turn of tabs.  Is there any way to change tabs to
> spaces?  i.e. when tabbing insert 4 spaces instead of a tab (if tabs
> default to 4 spaces long)?

I use in my ~/.emacs
 
(setq-default tab-width 4)
(setq-default indent-tabs-mode nil)

That makes Emacs insert 4 spaces instead of a tab. 

>From the Emacs manual  ....

Tabs vs. Spaces
===============

   Emacs normally uses both tabs and spaces to indent lines.  If you
prefer, all indentation can be made from spaces only.  To request this,
set `indent-tabs-mode' to `nil'.  This is a per-buffer variable, so
altering the variable affects only the current buffer, but there is a
default value which you can change as well.  *Note Locals::.

Sean

-- 
"Hver sin smak", sa vintapperen, han drakk mens de andre sloss.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TAB
@ 2003-11-17 20:42 Joe Corneli
  0 siblings, 0 replies; 11+ messages in thread
From: Joe Corneli @ 2003-11-17 20:42 UTC (permalink / raw)
  Cc: help-gnu-emacs

I think the following explains how to do what you want. BTW I don't
write java code, but I was thinking that a similar feature for lisp
might be nice. It seems to be harder to find that information (at
least on this computer...).


C-x C-f sample.java RET
C-h k C-i

*snip snip*
The amount and kind of whitespace inserted is controlled by the
variable `c-insert-tab-function', which is called to do the actual
insertion of whitespace.  Normally the function in this variable
just inserts a tab character, or the equivalent number of spaces,
depending on the variable `indent-tabs-mode'.
                           ================

C-h v indent-tabs-mode RET

*snip snip*
indent-tabs-mode's value is t

Documentation:
*Indentation can insert tabs if this is non-nil.
Setting this variable automatically makes it local to the current buffer.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TAB
  2003-11-17 14:32 TAB David Rasmussen
  2003-11-17 17:31 ` TAB Kevin Rodgers
@ 2003-11-18  0:45 ` Dan Anderson
  1 sibling, 0 replies; 11+ messages in thread
From: Dan Anderson @ 2003-11-18  0:45 UTC (permalink / raw)
  Cc: help-gnu-emacs

While looking for something completely unrelated in the Emacs manual I
found:


Tabs vs. Spaces
===============

   Emacs normally uses both tabs and spaces to indent lines.  If you
prefer, all indentation can be made from spaces only.  To request this,
set `indent-tabs-mode' to `nil'.  This is a per-buffer variable, so
altering the variable affects only the current buffer, but there is a
default value which you can change as well.  *Note Locals::.

   There are also commands to convert tabs to spaces or vice versa,
always preserving the columns of all nonblank text.  `M-x tabify' scans
the region for sequences of spaces, and converts sequences of at least
three spaces to tabs if that can be done without changing indentation.
`M-x untabify' changes all tabs in the region to appropriate numbers of
spaces.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TAB
  2003-11-17 18:16   ` TAB Dan Anderson
@ 2003-11-18 19:23     ` jan
  0 siblings, 0 replies; 11+ messages in thread
From: jan @ 2003-11-18 19:23 UTC (permalink / raw)


Dan Anderson <dan@mathjunkies.com> writes:

> That tells him how to turn of tabs.  Is there any way to change tabs
> to spaces?  i.e. when tabbing insert 4 spaces instead of a tab (if
> tabs default to 4 spaces long)?

You can change tabs to spaces with `untabify' and back with `tabify'

-- 
jan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TAB
  2003-11-17 17:31 ` TAB Kevin Rodgers
  2003-11-17 18:16   ` TAB Dan Anderson
       [not found]   ` <mailman.170.1069096910.399.help-gnu-emacs@gnu.org>
@ 2003-11-19  9:42   ` David Rasmussen
  2003-11-19 14:17     ` TAB Eli Zaretskii
  2 siblings, 1 reply; 11+ messages in thread
From: David Rasmussen @ 2003-11-19  9:42 UTC (permalink / raw)


Kevin Rodgers wrote:

> 
> C-h v indent-tabs-mode
> 

Thanks.

> 
> (setq-default indent-tabs-mode nil)    ; for all modes, or
> 
> (add-hook 'java-mode-hook        ; for just java mode
>       (lambda () (setq indent-tabs-mode nil)))
> 

Hmm. OK. Is there a place I can read about the .emacs configuration 
file? I realize that it is elisp (which I don't know much about, let 
alone Lisp), but where can I read about the most important idioms of the 
.emacs configuration file, and just enough for this purpose about elisp?

/David

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TAB
  2003-11-19  9:42   ` TAB David Rasmussen
@ 2003-11-19 14:17     ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2003-11-19 14:17 UTC (permalink / raw)


> From: David Rasmussen <david.rasmussen@gmx.net>
> Newsgroups: gnu.emacs.help
> Date: Wed, 19 Nov 2003 10:42:05 +0100
> 
> Hmm. OK. Is there a place I can read about the .emacs configuration 
> file?

The Emacs manual has a section about that.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-11-19 14:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-17 14:32 TAB David Rasmussen
2003-11-17 17:31 ` TAB Kevin Rodgers
2003-11-17 18:16   ` TAB Dan Anderson
2003-11-18 19:23     ` TAB jan
     [not found]   ` <mailman.170.1069096910.399.help-gnu-emacs@gnu.org>
2003-11-17 19:42     ` TAB Kevin Rodgers
2003-11-17 19:49     ` TAB Sean Richards
2003-11-19  9:42   ` TAB David Rasmussen
2003-11-19 14:17     ` TAB Eli Zaretskii
2003-11-18  0:45 ` TAB Dan Anderson
  -- strict thread matches above, loose matches on Subject: below --
2003-11-17 20:42 TAB Joe Corneli
     [not found] <20020319140511.A2178@sasken.com>
     [not found] ` <20020319092050.960E9CD2B9@smtp.bcn.isoco.net>
2002-03-26 12:59   ` Tab Alexander Koptelov

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).