block editing, collapse, comment.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users block editing, collapse, comment.
# 1  
Old 11-28-2008
block editing, collapse, comment.

any way i can block edit a program ?

i wrote a macro to do it in emacs
so it works like :

void foo ( int ... ) ; // collapsed.

it moves the body to temperary buffer, but i can't rely on this Smilie
# 2  
Old 11-28-2008
Have you ever tried emacs' "folding mode"? It is triggered in the text with specially formed comments like this:

Code:
function foo
# {{{ this start a "fold"
{
/some/command
/another/command

return 0
}
# this ends a "fold" }}}

In this example you would only see the line with the functions name, everything else would be folded away.

Folding is even recursive, so you could open a top-level fold and see collapsed lower-level folds inside, which you could open again, etc.

I hope this helps.

bakunin
# 3  
Old 12-05-2008
that is certenely much better of what i was using, .
many thanks .
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using :<<cut / cut to comment out block of bash script

I am using : << cut / cut to comment out block of code. Works fine on few lines of script, then it gives me this cryptic error when I try to comment out about 80 lines. The "warning " is at last line of script. done < results 169 echo "END read all positioning parameters" 170... (8 Replies)
Discussion started by: annacreek
8 Replies

2. Shell Programming and Scripting

Search and comment block of text from apache httpd.conf

I want to search for a block of text in httpd.conf that between two strings and comment it. There are multiple blocks with "<Directory.. and </Directory>" <Directory "${ORACLE_INSTANCE}/config/${COMPONENT_TYPE}/${COMPONENT_NAME}/htdocs"> # # Possible values for the Options directive are... (3 Replies)
Discussion started by: kchinnam
3 Replies

3. Shell Programming and Scripting

Collapse linked values

please help, I want to group together all linked data pairs. If I have 10 pairs, each row showing col2 and col3 are linked. R1 1 2 R2 1 3 R3 2 4 R4 3 4 R5 5 6 R6 8 1 R7 6 7 R8 9 10 Then I am looking to make R1 1 2 3 4 8 R5 5 6 7 R8 9 10 (2 Replies)
Discussion started by: sheetalk
2 Replies

4. UNIX for Dummies Questions & Answers

simple code to collapse rows in bash

Hello to the experts! I have a file that I'd like to collapse based on a common ID column, separated by a character delimiter. example input a 1 6 word1 uniq1 b 2 7 WORD2 uniq2 b 2 7 WORD2 uniq3 b 2 7 WORD2 uniq4 c 3 8 word4 uniq5 d 4 9 word5 uniq6 e 5 1 word6 uniq7 desired output a 1... (3 Replies)
Discussion started by: torchij
3 Replies

5. Shell Programming and Scripting

Script to put block comment after finding regex in xml file

hi, i need my bash script to find regex in xml file.. and comment 2 lines before and after the line that contains regex.. can't use # needs to be <!-- at the beginning and --> and the end of the comment. so eg.. first block <filter> <filter-name>MyRegEx</filter-name> ... (11 Replies)
Discussion started by: Poki
11 Replies

6. Shell Programming and Scripting

Pulling data from a standard comment block - perl

OK so I've inherited a set of scripts that do some work on a database. They do all have a standard comment block at the beginning that has good information on the script. I would like to generate a quick web page report that lists the script name and the description lines (for now it may be... (1 Reply)
Discussion started by: khuilman
1 Replies

7. Shell Programming and Scripting

Block Comment in Shell script

how to put multiline comments in a shell script like /* Some code */ in C language? (3 Replies)
Discussion started by: skyineyes
3 Replies
Login or Register to Ask a Question