all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Tab-key not working in auctex?
@ 2006-11-10  0:46 Johs
  2006-11-10 10:13 ` Malte Spiess
  0 siblings, 1 reply; 12+ messages in thread
From: Johs @ 2006-11-10  0:46 UTC (permalink / raw)


I have installed auctex for emacs in Ubuntu. But when I press the Tab-key 
nothing happens.

I know that multiple whitespaces are treated as one in latex but in my .tex 
file it is sometimes nice to use Tab-key indentation to make the text easier 
to read (when writing pseudocode).

How do I make my Tab-key respond i auctex?

Johs 

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

* Re: Tab-key not working in auctex?
  2006-11-10  0:46 Tab-key not working in auctex? Johs
@ 2006-11-10 10:13 ` Malte Spiess
  2006-11-10 15:14   ` Johs
  0 siblings, 1 reply; 12+ messages in thread
From: Malte Spiess @ 2006-11-10 10:13 UTC (permalink / raw)


"Johs" <gjh@sdfsf.com> writes:

> I have installed auctex for emacs in Ubuntu. But when I press the Tab-key 
> nothing happens.
>
> I know that multiple whitespaces are treated as one in latex but in my .tex 
> file it is sometimes nice to use Tab-key indentation to make the text easier 
> to read (when writing pseudocode).

Do you mean that never anything happens when you press TAB or just in certain
situations nothing happens?

> How do I make my Tab-key respond i auctex?

What does it say when you hit "C-h k TAB"? (Display documentation of the
function invoked by TAB.)

Really wonder why it does not work out of the box. Have you tried it in
any \begin... \end... environment?

> Johs 

Greetings

Malte

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

* Re: Tab-key not working in auctex?
  2006-11-10 10:13 ` Malte Spiess
@ 2006-11-10 15:14   ` Johs
  2006-11-10 16:02     ` Malte Spiess
  0 siblings, 1 reply; 12+ messages in thread
From: Johs @ 2006-11-10 15:14 UTC (permalink / raw)


Malte Spiess wrote:

> "Johs" <gjh@sdfsf.com> writes:
> 
>> I have installed auctex for emacs in Ubuntu. But when I press the Tab-key
>> nothing happens.
>>
>> I know that multiple whitespaces are treated as one in latex but in my
>> .tex file it is sometimes nice to use Tab-key indentation to make the
>> text easier to read (when writing pseudocode).
> 
> Do you mean that never anything happens when you press TAB or just in
> certain situations nothing happens?
> 
>> How do I make my Tab-key respond i auctex?
> 
> What does it say when you hit "C-h k TAB"? (Display documentation of the
> function invoked by TAB.)

It says:

TAB runs the command indent-for-tab-command
   which is an interactive compiled Lisp function in `indent'.
(indent-for-tab-command &optional PREFIX-ARG)

Indent line in proper way for current major mode or insert a tab.
Depending on `tab-always-indent', either insert a tab or indent.
If initial point was within line's indentation, position after
the indentation.  Else stay at same point in text.
The function actually called to indent is determined by the value of
`indent-line-function'.


but nothing happens when I press the Tab-key. Maybe Tab-key is not meant to
work in auctex.


> Really wonder why it does not work out of the box. Have you tried it in
> any \begin... \end... environment?


Yes and nothing happens there either.

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

* Re: Tab-key not working in auctex?
  2006-11-10 15:14   ` Johs
@ 2006-11-10 16:02     ` Malte Spiess
  2006-11-10 17:21       ` Johs
  0 siblings, 1 reply; 12+ messages in thread
From: Malte Spiess @ 2006-11-10 16:02 UTC (permalink / raw)


Johs <asdasd@asd.com> writes:

> Malte Spiess wrote:
>
>> "Johs" <gjh@sdfsf.com> writes:
>> 
>>> I have installed auctex for emacs in Ubuntu. But when I press the
>>> Tab-key nothing happens.
>>> I know that multiple whitespaces are treated as one in latex but in
>>> my .tex file it is sometimes nice to use Tab-key indentation to make
>>> the text easier to read (when writing pseudocode).
>>  Do you mean that never anything happens when you press TAB or just in
>> certain situations nothing happens?
>> 
>>> How do I make my Tab-key respond i auctex?
>>  What does it say when you hit "C-h k TAB"? (Display documentation of
>> the function invoked by TAB.)
>
> It says:
>
> TAB runs the command indent-for-tab-command
>    which is an interactive compiled Lisp function in `indent'.
> (indent-for-tab-command &optional PREFIX-ARG)
> [...]
>
> but nothing happens when I press the Tab-key. Maybe Tab-key is not meant
> to work in auctex.

Don't worry, it works fine here! Found this for you in the AucTeX info
page:
,----
|    Indentation is done by LaTeX environments and by TeX groups, that is
| the body of an environment is indented by the value of
| `LaTeX-indent-level' (default 2).  Also, items of an `itemize-like'
| environment are indented by the value of `LaTeX-item-indent', default
| -2.  If more environments are nested, they are indented `accumulated'
| just like most programming languages usually are seen indented in
| nested constructs.  
`----

Basically it says you should customize the variables
`LaTeX-indent-level' and `LaTeX-item-indent'.
(e.g. via M-x customize-variable)

>> Really wonder why it does not work out of the box. Have you tried it
>> in any \begin... \end... environment?
>
> Yes and nothing happens there either.

Okay, no problem, just customize the variables - should be fine! Else
just write again.

Good luck

Malte

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

* Re: Tab-key not working in auctex?
  2006-11-10 16:02     ` Malte Spiess
@ 2006-11-10 17:21       ` Johs
  2006-11-10 17:41         ` Ralf Angeli
  0 siblings, 1 reply; 12+ messages in thread
From: Johs @ 2006-11-10 17:21 UTC (permalink / raw)


Malte Spiess wrote:

> Johs <asdasd@asd.com> writes:
> 
>> Malte Spiess wrote:
>>
>>> "Johs" <gjh@sdfsf.com> writes:
>>> 
>>>> I have installed auctex for emacs in Ubuntu. But when I press the
>>>> Tab-key nothing happens.
>>>> I know that multiple whitespaces are treated as one in latex but in
>>>> my .tex file it is sometimes nice to use Tab-key indentation to make
>>>> the text easier to read (when writing pseudocode).
>>>  Do you mean that never anything happens when you press TAB or just in
>>> certain situations nothing happens?
>>> 
>>>> How do I make my Tab-key respond i auctex?
>>>  What does it say when you hit "C-h k TAB"? (Display documentation of
>>> the function invoked by TAB.)
>>
>> It says:
>>
>> TAB runs the command indent-for-tab-command
>>    which is an interactive compiled Lisp function in `indent'.
>> (indent-for-tab-command &optional PREFIX-ARG)
>> [...]
>>
>> but nothing happens when I press the Tab-key. Maybe Tab-key is not meant
>> to work in auctex.
> 
> Don't worry, it works fine here! Found this for you in the AucTeX info
> page:
> ,----
> |    Indentation is done by LaTeX environments and by TeX groups, that is
> | the body of an environment is indented by the value of
> | `LaTeX-indent-level' (default 2).  Also, items of an `itemize-like'
> | environment are indented by the value of `LaTeX-item-indent', default
> | -2.  If more environments are nested, they are indented `accumulated'
> | just like most programming languages usually are seen indented in
> | nested constructs.
> `----
> 
> Basically it says you should customize the variables
> `LaTeX-indent-level' and `LaTeX-item-indent'.
> (e.g. via M-x customize-variable)


'LaTex-indent-level' is already set to 2 and `LaTeX-item-indent' is set
to -2. So that is not the problem.

Tab-key works fine when I edit .txt files but seems to be dead when I
edit .tex files. This is the auctex section of my .emacs file:

;;;;;;;;;;;;;;;  BEGIN AUCTEX ;;;;;;;;;;;;;;;;;;;;;;

(require 'tex-site)

;; Enable auto-fill
(add-hook 'TeX-mode-hook 'turn-on-auto-fill)


(add-hook 'TeX-mode-hook
          (lambda ()
            (TeX-source-specials-mode 1)
            (add-to-list 'TeX-output-view-style
                         '("^pdf$" "." "kpdf %o"))
            (add-to-list 'TeX-output-view-style
                         '("^dvi$" "." "kdvi %o"))))
;;;;;;;;;;;;;;  END AUCTEX ;;;;;;;;;;;;;;;;;;;;;;;;;




There is nothing below the above line in the .emacs file. I have also tried
to add this the "(add-hook 'Tex-mode-hook ....)))" section:

(add-hook 'TeX-mode-hook
          (lambda ()
            (TeX-source-specials-mode 1)
            (local-set-key "\C-l" 'th-complete-or-indent t)
            (local-set-key "\t" 'LaTex-indent-line t)
            (add-to-list 'TeX-output-view-style
                         '("^pdf$" "." "kpdf %o"))
            (add-to-list 'TeX-output-view-style
                         '("^dvi$" "." "kdvi %o"))))


But that does nothing either.

What happens when you press the Tab-key in auctex?

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

* Re: Tab-key not working in auctex?
  2006-11-10 17:21       ` Johs
@ 2006-11-10 17:41         ` Ralf Angeli
  2006-11-10 19:23           ` Johs
  0 siblings, 1 reply; 12+ messages in thread
From: Ralf Angeli @ 2006-11-10 17:41 UTC (permalink / raw)


* Johs (2006-11-10) writes:

> What happens when you press the Tab-key in auctex?

(info "(auctex)Indenting")

-- 
Ralf

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

* Re: Tab-key not working in auctex?
  2006-11-10 17:41         ` Ralf Angeli
@ 2006-11-10 19:23           ` Johs
  2006-11-10 19:26             ` Ralf Angeli
  0 siblings, 1 reply; 12+ messages in thread
From: Johs @ 2006-11-10 19:23 UTC (permalink / raw)


Ralf Angeli wrote:

> * Johs (2006-11-10) writes:
> 
>> What happens when you press the Tab-key in auctex?
> 
> (info "(auctex)Indenting")
> 


Have read that and it even describes that pressing the Tab-key should
perform an indentation:

`<TAB>'
     `LaTeX-indent-line' will indent the current line.





But that is not working eventhough I get this when I press C-h k TAB:


TAB runs the command indent-for-tab-command
   which is an interactive compiled Lisp function in `indent'.
(indent-for-tab-command &optional PREFIX-ARG)

Indent line in proper way for current major mode or insert a tab.
Depending on `tab-always-indent', either insert a tab or indent.
If initial point was within line's indentation, position after
the indentation.  Else stay at same point in text.
The function actually called to indent is determined by the value of
`indent-line-function'.



I have also tried to select a few words and then press 'M-x indent-region'.
I then get the message:

You can rund the command 'indent-region' with C-M-\

and nothing happens. Further this should also be accomplished by pressing
TAB. But as I wrote in my original post the Tab-key does not respond in
auctex.

Maybe its a bug in Ubuntu 6.10.

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

* Re: Tab-key not working in auctex?
  2006-11-10 19:23           ` Johs
@ 2006-11-10 19:26             ` Ralf Angeli
  2006-11-10 19:41               ` Johs
  0 siblings, 1 reply; 12+ messages in thread
From: Ralf Angeli @ 2006-11-10 19:26 UTC (permalink / raw)


* Johs (2006-11-10) writes:

> Ralf Angeli wrote:
>
>> * Johs (2006-11-10) writes:
>> 
>>> What happens when you press the Tab-key in auctex?
>> 
>> (info "(auctex)Indenting")
>
> Have read that and it even describes that pressing the Tab-key should
> perform an indentation:
>
> `<TAB>'
>      `LaTeX-indent-line' will indent the current line.
>
> But that is not working eventhough I get this when I press C-h k TAB:

Perhaps you haven't understood what indentation means.  Please provide
a minimal example file and describe on which line you typed TAB and
what you expected to happen.

-- 
Ralf

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

* Re: Tab-key not working in auctex?
  2006-11-10 19:26             ` Ralf Angeli
@ 2006-11-10 19:41               ` Johs
  2006-11-10 19:50                 ` Ralf Angeli
  0 siblings, 1 reply; 12+ messages in thread
From: Johs @ 2006-11-10 19:41 UTC (permalink / raw)


Ralf Angeli wrote:

> * Johs (2006-11-10) writes:
> 
>> Ralf Angeli wrote:
>>
>>> * Johs (2006-11-10) writes:
>>> 
>>>> What happens when you press the Tab-key in auctex?
>>> 
>>> (info "(auctex)Indenting")
>>
>> Have read that and it even describes that pressing the Tab-key should
>> perform an indentation:
>>
>> `<TAB>'
>>      `LaTeX-indent-line' will indent the current line.
>>
>> But that is not working eventhough I get this when I press C-h k TAB:
> 
> Perhaps you haven't understood what indentation means.  Please provide
> a minimal example file and describe on which line you typed TAB and
> what you expected to happen.
> 



The command I was looking for was 'indent-relative':

(add-hook 'TeX-mode-hook
          (lambda ()
            (local-set-key "\t" 'indent-relative)))

that does the trick!

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

* Re: Tab-key not working in auctex?
  2006-11-10 19:41               ` Johs
@ 2006-11-10 19:50                 ` Ralf Angeli
  2006-11-10 19:57                   ` Johs
  0 siblings, 1 reply; 12+ messages in thread
From: Ralf Angeli @ 2006-11-10 19:50 UTC (permalink / raw)


* Johs (2006-11-10) writes:

> Ralf Angeli wrote:
>
>> Perhaps you haven't understood what indentation means.  Please provide
>> a minimal example file and describe on which line you typed TAB and
>> what you expected to happen.
>
> The command I was looking for was 'indent-relative':

I doubt it.  It seems you haven't understood what this command does
either.  To me it looks like you are not interested in syntactic
indentation but rather want to insert a bare tab character each time
you hit the tab key.

-- 
Ralf

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

* Re: Tab-key not working in auctex?
  2006-11-10 19:50                 ` Ralf Angeli
@ 2006-11-10 19:57                   ` Johs
  2006-11-10 20:16                     ` Ralf Angeli
  0 siblings, 1 reply; 12+ messages in thread
From: Johs @ 2006-11-10 19:57 UTC (permalink / raw)


Ralf Angeli wrote:

> * Johs (2006-11-10) writes:
> 
>> Ralf Angeli wrote:
>>
>>> Perhaps you haven't understood what indentation means.  Please provide
>>> a minimal example file and describe on which line you typed TAB and
>>> what you expected to happen.
>>
>> The command I was looking for was 'indent-relative':
> 
> I doubt it.  It seems you haven't understood what this command does
> either.  To me it looks like you are not interested in syntactic
> indentation but rather want to insert a bare tab character each time
> you hit the tab key.
> 

yes that is what I want and that is what 'indent-relative' does.

Its only in my .tex file that there are "tabs" when I preview the
corresponding dvi file all tabs are just shown as single whitespaces which
is what I want.

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

* Re: Tab-key not working in auctex?
  2006-11-10 19:57                   ` Johs
@ 2006-11-10 20:16                     ` Ralf Angeli
  0 siblings, 0 replies; 12+ messages in thread
From: Ralf Angeli @ 2006-11-10 20:16 UTC (permalink / raw)


* Johs (2006-11-10) writes:

> Ralf Angeli wrote:
>
>> * Johs (2006-11-10) writes:
>> 
>>> The command I was looking for was 'indent-relative':
>> 
>> I doubt it.  It seems you haven't understood what this command does
>> either.  To me it looks like you are not interested in syntactic
>> indentation but rather want to insert a bare tab character each time
>> you hit the tab key.
>
> yes that is what I want and that is what 'indent-relative' does.

Sorry to disappoint you, but it doesn't.

> Its only in my .tex file that there are "tabs" when I preview the
> corresponding dvi file all tabs are just shown as single whitespaces which
> is what I want.

If you really want to disable the help AUCTeX can give you with
syntactical indentation, you could use
(local-set-key (kbd "TAB") 'self-insert-command)
But please try to learn what syntactical indentation means before
disabling it.

-- 
Ralf

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

end of thread, other threads:[~2006-11-10 20:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-10  0:46 Tab-key not working in auctex? Johs
2006-11-10 10:13 ` Malte Spiess
2006-11-10 15:14   ` Johs
2006-11-10 16:02     ` Malte Spiess
2006-11-10 17:21       ` Johs
2006-11-10 17:41         ` Ralf Angeli
2006-11-10 19:23           ` Johs
2006-11-10 19:26             ` Ralf Angeli
2006-11-10 19:41               ` Johs
2006-11-10 19:50                 ` Ralf Angeli
2006-11-10 19:57                   ` Johs
2006-11-10 20:16                     ` Ralf Angeli

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.