all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tab-always-indent doesn't work
@ 2006-12-12  2:59 Ronald
  2006-12-12 13:36 ` c-tab-always-indent works Ronald
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ronald @ 2006-12-12  2:59 UTC (permalink / raw)


I can't add comment in c files as below (comment can't be aligned using tab)

for(;;){
	int i;		//a
	int iii;	//b
}

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

* c-tab-always-indent works
  2006-12-12  2:59 tab-always-indent doesn't work Ronald
@ 2006-12-12 13:36 ` Ronald
  2006-12-12 13:50 ` tab-always-indent doesn't work Robert Thorpe
  2006-12-13 14:33 ` Yshaolin
  2 siblings, 0 replies; 5+ messages in thread
From: Ronald @ 2006-12-12 13:36 UTC (permalink / raw)


(add-hook 'c-mode-common-hook '(lambda()
				(setq c-tab-always-indent nil)))

Why doesn't (setq tab-always-indent nil) work? Overrided by cc mode?

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

* Re: tab-always-indent doesn't work
  2006-12-12  2:59 tab-always-indent doesn't work Ronald
  2006-12-12 13:36 ` c-tab-always-indent works Ronald
@ 2006-12-12 13:50 ` Robert Thorpe
  2006-12-18 17:49   ` Robert Thorpe
  2006-12-13 14:33 ` Yshaolin
  2 siblings, 1 reply; 5+ messages in thread
From: Robert Thorpe @ 2006-12-12 13:50 UTC (permalink / raw)


Ronald wrote:
> I can't add comment in c files as below (comment can't be aligned using tab)
>
> for(;;){
> 	int i;		//a
> 	int iii;	//b
> }

What tab-always-indent's documentation says is:-

*Controls the operation of the TAB key.
If t, hitting TAB always just indents the current line.
If nil, hitting TAB indents the current line if point is at the left
margin
  or in the line's indentation, otherwise it insert a `real' tab
character.

So if you set it to t then hitting tab will indent the current line.
So, pressing tab at then end of "int i;" will not do anything if the
current line is already indented.  If it is set to nil then only when
the cursor is in the left margin will tab "indent", otherwise it will
deliver a real tab.

HOWEVER...
Program modes do not use tab-always-indent, they have their own
variables...
c-tab-always-indent
perl-tab-always-indent
fortran-tab-mode-default
Some even, like lisp-mode, have no equivalent variable.
You must set these variables separately.

(I think that tab-always-indent's documentation is unclear and needs
fixing)

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

* Re: tab-always-indent doesn't work
  2006-12-12  2:59 tab-always-indent doesn't work Ronald
  2006-12-12 13:36 ` c-tab-always-indent works Ronald
  2006-12-12 13:50 ` tab-always-indent doesn't work Robert Thorpe
@ 2006-12-13 14:33 ` Yshaolin
  2 siblings, 0 replies; 5+ messages in thread
From: Yshaolin @ 2006-12-13 14:33 UTC (permalink / raw)


you can use M-; to align your comment

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

* Re: tab-always-indent doesn't work
  2006-12-12 13:50 ` tab-always-indent doesn't work Robert Thorpe
@ 2006-12-18 17:49   ` Robert Thorpe
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Thorpe @ 2006-12-18 17:49 UTC (permalink / raw)


> HOWEVER...
> Program modes do not use tab-always-indent, they have their own
> variables...
> c-tab-always-indent
> perl-tab-always-indent
> fortran-tab-mode-default
> Some even, like lisp-mode, have no equivalent variable.
> You must set these variables separately.
>
> (I think that tab-always-indent's documentation is unclear and needs
> fixing)

FWIW I suggested a change to tab-always-indent's docs to the Emacs
maintainers to fix this issue.

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

end of thread, other threads:[~2006-12-18 17:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-12  2:59 tab-always-indent doesn't work Ronald
2006-12-12 13:36 ` c-tab-always-indent works Ronald
2006-12-12 13:50 ` tab-always-indent doesn't work Robert Thorpe
2006-12-18 17:49   ` Robert Thorpe
2006-12-13 14:33 ` Yshaolin

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.