Sponsored Content
Full Discussion: Emacs line indentation
Top Forums Programming Emacs line indentation Post 302259333 by Rledley on Monday 17th of November 2008 11:12:20 PM
Old 11-18-2008
Question Emacs line indentation

Hi. I'm writing a document in Python, so indentation is crucial.

I want to indent a whole section by exactly one tab. Any idea how to go about this? I'm using terminal emacs (no mouse input)

Thanks for any help!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Making Emacs to show line number

Hi all How can I make Emacs to show the line numbers at the left or right as a default. This might help me to quickly jump to a given line. Thanks SS (9 Replies)
Discussion started by: saurya_s
9 Replies

2. UNIX for Dummies Questions & Answers

emacs as a line editor

hello, I would like to use emacs as a line editor (I use emacs as editor). I try "set -o emacs" but I have nothing. Thank you for any help (5 Replies)
Discussion started by: annemar
5 Replies

3. Programming

A question of indentation

Hi, Using GNU indent(1) I tried to indent a C source file which has no indentation (all lines start at column 1). The result I am trying to achieve, should look like this with the exception that only tabs are used for indentation (no spaces). Unfortunately, I couldn't find the appropriate... (1 Reply)
Discussion started by: Michael Iatrou
1 Replies

4. Shell Programming and Scripting

Regarding indentation using unix script

I have piece of Informatica code in a file as : IIF(substr(flag,0,2)=1,false,IIF(flag= 1 ,0,NULL)) Please provide me with idea how to write a unix script which reads this file and write indented code into another file. The output in the second file should look as: ... (1 Reply)
Discussion started by: srikanth.ch
1 Replies

5. Shell Programming and Scripting

indentation and lowercase to uppercase

hi, i need to write a bash script that does two things. the program will take from the command line a file name, which is a C code, and an integer, which is the size of my indentation i would then have to indent every nested code by the number of columns provided by the user in the... (1 Reply)
Discussion started by: kratos.
1 Replies

6. Shell Programming and Scripting

Indentation help

Hi I have coded 300 line script.Its not indented properly.i am not good at indentation. I would appreciate your help on this. i want to use a 4 space indentataion.Hence if i "set tabstop=4" and use tabs for coding and if some one else open this script in their system it looks unindented since... (11 Replies)
Discussion started by: pinnacle
11 Replies

7. UNIX for Dummies Questions & Answers

How to use emacs? Also how to open existing emacs files with .cgi format?

Hi All, I am new to this forum and a beginner in unix. Please correct me if I put the question in a wrong way.. How to use emacs editor? Also how to open existing emacs files with .cgi format? I have the following link :- http link i.e. url and path : /abc/xyz.dev/xyz/documents What... (7 Replies)
Discussion started by: swathi123
7 Replies

8. UNIX for Dummies Questions & Answers

Indentation using awk

I need to write an awk program who does this http://i.stack.imgur.com/yzSqB.jpg I'd be very grateful for any help, Thanks a lot (1 Reply)
Discussion started by: guy9050
1 Replies

9. Homework & Coursework Questions

Indentation using awk

1. The problem statement, all variables and given/known data: I need to write an awk program who does this (sorry its too big) http://i.stack.imgur.com/yzSqB.jpg 2. Relevant commands, code, scripts, algorithms: .. 3. The attempts at a solution (include all code and scripts): declaring a... (2 Replies)
Discussion started by: guy9050
2 Replies

10. UNIX for Beginners Questions & Answers

Indentation for Lists in html

An writing some html instructions to have text beside an image. The image is located on the left and I want the tect to appear on the right side of the image. The text includes a list. The problem is that the list boxes and not shifted. The text within the list align on the left with the... (20 Replies)
Discussion started by: kristinu
20 Replies
indent(1)						      General Commands Manual							 indent(1)

Name
       indent - indent and format C program source

Syntax
       indent input [output] [flags]

Description
       The command is intended primarily as a C program formatter.  Specifically, indents code lines, aligns comments, inserts spaces around oper-
       ators where necessary and breaks up declaration lists as in ``int a,b,c;''.

       The command does not break up long statements to make them fit within the maximum line length, but it does flag lines that  are	too  long.
       Lines  are broken so that each statement starts a new line, and braces appear alone on a line.  Also, an attempt is made to line up identi-
       fiers in declarations.

       The flags that can be specified follow. They can appear before or after the file names.	If the output file is omitted, the formatted  file
       is  written back into input and a ``backup'' copy of input is written in the current directory.	If input is named ``/blah/blah/file'', the
       backup file is named ``.Bfile''.  If output is specified, checks to make sure it is different from input.

Options
       The following options are used to control the formatting style imposed by

       -lnnn	   Determines maximum length of output line.  The default is 75.

       -cnnn	   Determines column in which comments start.  The default is 33.

       -cdnnn	   Determines column in which comments on declarations start.  The default is for these comments to start in the  same	column	as
		   other comments.

       -innn	   Determines number of spaces for one indentation level.  The default is 4.

       -dj,-ndj    Causes declarations to be left justified.  -ndj causes them to be indented the same as code.  The default is -ndj.

       -v,-nv	   -v  turns  on  ``verbose''  mode, -nv turns it off.	When in verbose mode, reports when it splits one line of input into two or
		   more lines of output, and it gives some size statistics at completion.  The default is -nv.

       -bc,-nbc    Forces newline after each comma in a declaration.  -nbc turns off this option.  The default is -bc.

       -dnnn	   Controls the placement of comments which are not to the right of code.  Specifying -d2 means that such comments are placed  two
		   indentation	levels	to  the  left of code.	The default -d0 lines up these comments with the code.	See the section on comment
		   indentation below.

       -br,-bl	   Specifying -bl causes complex statements to be lined up in a space order.  For example,
		      if (...)
		      {
			  code
		      }
		   Specifying -br (the default) makes them look like this:
		      if (...) {
			  code
		      }

       You may set up your own ``profile'' of defaults to by creating the file ``.indent.pro'' in your	login  directory  and  including  whatever
       switches  you  like.  If is run and a profile file exists, then it is read to set up the program's defaults.  Switches on the command line,
       though, always override profile switches.  The profile file must be a single line of not more than 127 characters.  The switches should	be
       separated on the line by spaces or tabs.

       Multiline expressions

       The  command  does not break up complicated expressions that extend over multiple lines.  However, it usually indents such expressions that
       have already been broken up correctly.  Such an expression might look like the following:
       x =
	       (
		   (Arbitrary parenthesized expression)
		   +
		   (
		       (Parenthesized expression)
		       *
		       (Parenthesized expression)
		   )
	       );

       Comments

       The command recognizes the following four kinds of comments:

       1)  straight text

       2)  ``box'' comments

       3)  UNIX-style comments

       4)  comments that should be passed through unchanged

       The comments are interpreted as follows:

       ``Box'' comments    The command assumes that any comment with a dash immediately after the start of comment (i.e.  ``/*-'')  is	a  comment
			   surrounded by a box of stars.  Each line of such a comment is left unchanged, except that the first non-blank character
			   of each successive line is lined up with the beginning slash of the first line.  Box comments are indented (see below).

       ``Unix-style'' comments
			   This is the type of section header which is used extensively in the UNIX  system  source.   If  the	start  of  comment
			   (``/*'') appears on a line by itself, assumes that it is a UNIX-style comment.  These are treated similarly to box com-
			   ments, except the first non-blank character on each line is lined up with the `*' of the ``/*''.

       Unchanged comments  Any comment which starts in column 1 is left completely unchanged.  This is intended primarily for documentation header
			   pages.  The check for unchanged comments is made before the check for UNIX-style comments.

       Straight text	   All	other  comments are treated as straight text.  Indent fits as many words (separated by blanks, tabs, or new lines)
			   on a line as possible.  Straight text comments are indented.

       Comment indentation

       Box, UNIX-style, and straight text comments may be indented.  If a comment is on a line with code it is started in the ``comment  column'',
       which is set by the -cnnn command line parameter.  Otherwise, the comment is started at nnn indentation levels less than where code is cur-
       rently being placed, where nnn is specified by the -dnnn command line parameter.  (Indented comments is never be placed in column  1.)	If
       the code on a line extends past the comment column, the comment is moved to the next line.

Restrictions
       Does not know how to format ``long'' declarations.

Diagnostics
       Diagnostic error messages, mostly to tell that a text line has been broken or is too long for the output line.

Files
       .indent.pro    profile file

																	 indent(1)
All times are GMT -4. The time now is 04:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy