all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* making TAB in text major mode just work
@ 2007-11-22 20:35 jwithers
  2007-11-23  2:30 ` Giorgos Keramidas
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: jwithers @ 2007-11-22 20:35 UTC (permalink / raw)
  To: help-gnu-emacs

Folks,

In text mode, or in fundamental mode for that matter, if emacs decides
you are indenting to some point before a tab stop, it helpfully
decides that you want that indent on following lines. This is a real
pita when you are doing bullet points, as follows:

        |<-----the first tab stop
* This is a bullet point
* This is another bullet point

  This is a paragraph that is now indented incorrectly because emacs
has decided that my bullet points mean this line should be indented
two spaces.

I am looking for some way to stop this behavior, so that emacs doesn't
decide I need smart indentation, which is just ducky for coding, but
really sucks when I am writing reports. And doing a control-q tab
isn't really good in my mind. I don't want to have to keep remembering
to do something different than just type when I am in the flow of
working.

Any help would be appreciated, I have changed all the various
indentation settings I could find and looked on the emacswiki, but
havent' found a solution to this.

john withers

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

* Re: making TAB in text major mode just work
  2007-11-22 20:35 making TAB in text major mode just work jwithers
@ 2007-11-23  2:30 ` Giorgos Keramidas
  2007-11-23 11:37 ` Bastien
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Giorgos Keramidas @ 2007-11-23  2:30 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 22 Nov 2007 12:35:12 -0800 (PST), jwithers <jpwithers@gmail.com> wrote:
> Folks,
>
> In text mode, or in fundamental mode for that matter, if emacs decides
> you are indenting to some point before a tab stop, it helpfully
> decides that you want that indent on following lines. This is a real
> pita when you are doing bullet points, as follows:
>
>         |<-----the first tab stop
> * This is a bullet point
> * This is another bullet point
>
>   This is a paragraph that is now indented incorrectly because emacs
> has decided that my bullet points mean this line should be indented
> two spaces.
>
> I am looking for some way to stop this behavior, so that emacs doesn't
> decide I need smart indentation, [...]

You can bind TAB to `self-insert-command'.  This should do it.

One way of setting this for `text-mode' and its derivatives is:

    (add-hook 'text-mode-hook
              (lambda ()
                (local-set-key (kbd "TAB") 'self-insert-command)))

> And doing a control-q tab isn't really good in my mind. I don't want
> to have to keep remembering to do something different than just type
> when I am in the flow of working.

TAB is equivalent to `C-i' in many terminals.  You can quickly insert a
literal ASCII TAB character by hitting `M-i', or you can use the hook
change shown above... it's all a matter of preference :)

- Giorgos

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

* Re: making TAB in text major mode just work
  2007-11-22 20:35 making TAB in text major mode just work jwithers
  2007-11-23  2:30 ` Giorgos Keramidas
@ 2007-11-23 11:37 ` Bastien
       [not found] ` <mailman.3972.1195817873.18990.help-gnu-emacs@gnu.org>
  2007-11-26 15:53 ` Ehud Karni
  3 siblings, 0 replies; 8+ messages in thread
From: Bastien @ 2007-11-23 11:37 UTC (permalink / raw)
  To: help-gnu-emacs

jwithers <jpwithers@gmail.com> writes:

> * This is another bullet point
>
>   This is a paragraph that is now indented incorrectly because emacs
> has decided that my bullet points mean this line should be indented
> two spaces.

... just as Emacs will decide that pressing TAB at the beginning of the
second line will align both "A" in the first and second line -- see the
example below:

,----
|         A first line
| A second line
`----

I do not see what is wrong with that.

And if you want to concentrate on what you type, why are you pressing
TAB when at the "This is a paragraph" line?   This line starts at the
beginning of the line when written normally.

-- 
Bastien

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

* Re: making TAB in text major mode just work
       [not found] ` <mailman.3972.1195817873.18990.help-gnu-emacs@gnu.org>
@ 2007-11-23 16:51   ` Mathias Dahl
  2007-11-25 23:26     ` Bastien
  0 siblings, 1 reply; 8+ messages in thread
From: Mathias Dahl @ 2007-11-23 16:51 UTC (permalink / raw)
  To: help-gnu-emacs

Bastien <bzg@altern.org> writes:

> jwithers <jpwithers@gmail.com> writes:
>
>> * This is another bullet point
>>
>>   This is a paragraph that is now indented incorrectly because emacs
>> has decided that my bullet points mean this line should be indented
>> two spaces.
>
> And if you want to concentrate on what you type, why are you pressing
> TAB when at the "This is a paragraph" line?   This line starts at the
> beginning of the line when written normally.

I think he might want the text to start at the "real" tab stop,
indented even more.

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

* Re: making TAB in text major mode just work
  2007-11-23 16:51   ` Mathias Dahl
@ 2007-11-25 23:26     ` Bastien
  0 siblings, 0 replies; 8+ messages in thread
From: Bastien @ 2007-11-25 23:26 UTC (permalink / raw)
  To: help-gnu-emacs

Mathias Dahl <brakjoller@gmail.com> writes:

>> And if you want to concentrate on what you type, why are you pressing
>> TAB when at the "This is a paragraph" line?   This line starts at the
>> beginning of the line when written normally.
>
> I think he might want the text to start at the "real" tab stop,
> indented even more.

Then using `M-i' (M-x tab-to-tab-stop) might help.

Setting `tab-always-indent' to `nil' isn't very useful here because this
variable has no effect when the point is at the beginning of the line.

Maybe this variable could accept a value of 'never, meaning that it
should never indent relatively, even when the point is at the beginning
of the line?

BTW, the docstring of `tab-always-indent' does not mention 'always, even
customizing `tab-always-indent' offers this as an option.

-- 
Bastien

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

* Re: making TAB in text major mode just work
  2007-11-22 20:35 making TAB in text major mode just work jwithers
                   ` (2 preceding siblings ...)
       [not found] ` <mailman.3972.1195817873.18990.help-gnu-emacs@gnu.org>
@ 2007-11-26 15:53 ` Ehud Karni
  2007-11-26 18:20   ` Bastien
  3 siblings, 1 reply; 8+ messages in thread
From: Ehud Karni @ 2007-11-26 15:53 UTC (permalink / raw)
  To: jpwithers; +Cc: help-gnu-emacs

On Thu, 22 Nov 2007 12:35:12 jwithers wrote:
>
> In text mode, or in fundamental mode for that matter, ...
>  ... doing a control-q tab isn't really good in my mind.

Add this to your .emacs and it will solve your problems for text mode.
    (define-key text-mode-map "\011" 'forward-to-tab-stop)

Ehud.


--
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry

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

* Re: making TAB in text major mode just work
  2007-11-26 15:53 ` Ehud Karni
@ 2007-11-26 18:20   ` Bastien
  2007-11-26 21:23     ` Ehud Karni
  0 siblings, 1 reply; 8+ messages in thread
From: Bastien @ 2007-11-26 18:20 UTC (permalink / raw)
  To: help-gnu-emacs

"Ehud Karni" <ehud@unix.mvs.co.il> writes:

> On Thu, 22 Nov 2007 12:35:12 jwithers wrote:
>>
>> In text mode, or in fundamental mode for that matter, ...
>>  ... doing a control-q tab isn't really good in my mind.
>
> Add this to your .emacs and it will solve your problems for text mode.
>     (define-key text-mode-map "\011" 'forward-to-tab-stop)

Do you mean:

  (define-key text-mode-map "\011" 'tab-to-tab-stop)

or is `forward-to-tab-stop' a real function?

Here:

  (fboundp 'forward-to-tab-stop)
  => nil

-- 
Bastien

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

* Re: making TAB in text major mode just work
  2007-11-26 18:20   ` Bastien
@ 2007-11-26 21:23     ` Ehud Karni
  0 siblings, 0 replies; 8+ messages in thread
From: Ehud Karni @ 2007-11-26 21:23 UTC (permalink / raw)
  To: bzg; +Cc: help-gnu-emacs

On Mon, 26 Nov 2007 18:20:07 Bastien wrote:
>
> "Ehud Karni" <ehud@unix.mvs.co.il> writes:
>
> > On Thu, 22 Nov 2007 12:35:12 jwithers wrote:
> >>
> >> In text mode, or in fundamental mode for that matter, ...
> >>  ... doing a control-q tab isn't really good in my mind.
> >
> > Add this to your .emacs and it will solve your problems for text mode.
> >     (define-key text-mode-map "\011" 'forward-to-tab-stop)
>
> Do you mean:
>
>   (define-key text-mode-map "\011" 'tab-to-tab-stop)
>
> or is `forward-to-tab-stop' a real function?
>
> Here:
>
>   (fboundp 'forward-to-tab-stop)
>   => nil

My mistake, `forward-to-tab-stop' is a very real LOCAL function I use.
I suppose for the above request 'tab-to-tab-stop' or `move-to-tab-stop'
will do. Also change the "\011" to "\t" so:
    (define-key text-mode-map "\t" 'tab-to-tab-stop)


Ehud.


--
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry

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

end of thread, other threads:[~2007-11-26 21:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-22 20:35 making TAB in text major mode just work jwithers
2007-11-23  2:30 ` Giorgos Keramidas
2007-11-23 11:37 ` Bastien
     [not found] ` <mailman.3972.1195817873.18990.help-gnu-emacs@gnu.org>
2007-11-23 16:51   ` Mathias Dahl
2007-11-25 23:26     ` Bastien
2007-11-26 15:53 ` Ehud Karni
2007-11-26 18:20   ` Bastien
2007-11-26 21:23     ` Ehud Karni

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.