How to "beautify" script?

How to "beautify" script?

Post by Olivier Laure » Sat, 05 Jul 2003 01:00:37



Hi,

I'm a real newbie with emacs. These days, I work mainly through SSH,
so I using more and more emacs (I tried but failed to understand vi).
I just ordered an O'reilly book on Amazon, but in the meantime...Dumb
questions, I didn't found over the internet an answer for this:

I like well made codes with spaces such as:


   {
    foreach()
      {
       and so on;
      }
   }

When I hit enter, the problem I've got is that emacs keeps going to
the beginning of the line. Well that'sn't very important...But when
you write hundred of lines, it is a bit annoying.

 How can i "force it" to go at the same "column" of the previous line
last character?

By the way, I used to work on windows, we didn't follow microsoft new
technology .net and we decided to migrate to open source. I'm
discovering the GNU galaxy. Frankly I'm quite impressed by the large
volumes on information you can freely get and all active communities.
It's like "re"-learning computing :-). I just visited the PERL planet
and now I'm travelling onto the emacs planet. :-)

Thanks :-)

Olivier

 
 
 

How to "beautify" script?

Post by Barry Margoli » Sat, 05 Jul 2003 02:34:43




>Hi,

>I'm a real newbie with emacs. These days, I work mainly through SSH,
>so I using more and more emacs (I tried but failed to understand vi).
>I just ordered an O'reilly book on Amazon, but in the meantime...Dumb
>questions, I didn't found over the internet an answer for this:

>I like well made codes with spaces such as:


>   {
>    foreach()
>      {
>       and so on;
>      }
>   }

>When I hit enter, the problem I've got is that emacs keeps going to
>the beginning of the line. Well that'sn't very important...But when
>you write hundred of lines, it is a bit annoying.

> How can i "force it" to go at the same "column" of the previous line
>last character?

If you press TAB, it will indent to the appropriate column, based on its
knowledge of standard formatting of the language you're programming in.
And if you use Control-j instead of Enter, it will do the equivalent of
Enter followed by TAB.

--

Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

How to "beautify" script?

Post by Brian Palme » Sat, 05 Jul 2003 10:03:25





> > How can i "force it" to go at the same "column" of the previous line
> >last character?

> If you press TAB, it will indent to the appropriate column, based on its
> knowledge of standard formatting of the language you're programming in.
> And if you use Control-j instead of Enter, it will do the equivalent of
> Enter followed by TAB.

And, Olivier, if you want enter to automatically do the indentation,
you can do M-x local-set-key RET newline-and-indent RET
while you're in a perl buffer, and the enter key will be mapped to the
command newline-and-indent (which does the obvious).

Your book should explain key mapping in more detail, or check the
emacs manual.

--
If you want divine justice, die.
                  -- Nick Seldon

 
 
 

How to "beautify" script?

Post by Paolo Gianross » Sat, 05 Jul 2003 23:39:50



> By the way, I used to work on windows, we didn't follow microsoft new
> technology .net and we decided to migrate to open source. I'm
> discovering the GNU galaxy. Frankly I'm quite impressed by the large
> volumes on information you can freely get and all active communities.
> It's like "re"-learning computing :-). I just visited the PERL planet
> and now I'm travelling onto the emacs planet. :-)

welcome aboard... :)

Quote:

> Thanks :-)

> Olivier

cheers
paolino
--
God is dead.            Nietzche           /"\                          
Nietzche is dead.       God                \ /     ASCII Ribbon Campaign
-                                           X      Against HTML Mail    
Paolo Gianrossi                            / \                          



 
 
 

How to "beautify" script?

Post by Yawar Ami » Sun, 13 Jul 2003 20:10:36



Quote:> How can i "force it" to go at the same "column" of the previous line
> last character?

Add a line such as the following to your `~/.emacs' file:

(global-set-key "\C-m" 'reindent-then-newline-and-indent)

Then, when you press ENTER at the end of a line, that line will be properly
indented, and then the cursor will jump to the proper position on the next
line---it'll be properly indented as well.

BTW, if you don't mind my asking, what book(s) have you chosen?  I'd
recommend O'Reilly's ``Learning GNU Emacs'' (no surprises!).  Oh, and get
Robert J. Chassell's great ``An Introduction to Programming in Emacs
Lisp''.  You can download it; it's under the GNU Free Documentation
License.  Just do a Google search for it---and by the way, get the Info
file version (`emacs-lisp-intro.info'), if possible.  The reason I'm
recommending this book is, Mr. Chassell includes a chapter on customizing
your Emacs initialization file (`.emacs'), with a step-by-step tour through
his own (20-year old) `.emacs' file.  That should be very helpful!

HTH,
Yawar Amin

 
 
 

1. (setenv "LANGUAGE" "da_DK") + dired -> "No file on line"

I am using xemacs version 20.4; fra Feb 1998 (debian potato) , and I
had a problem. When I used auc-tex my viewer wrote

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "c",
        LC_ALL = "c",
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

It seems that outside xemacs I had the right language settings
(da_DK), but inside xemacs something was wrong. Therefore I added the
following lines to my .emacs

(setenv "LANG" "da_DK")
(setenv "LANGUAGE" "da_DK")
(setenv "LC_ALL" "da_DK")

Sadly that gave me a new problem. When I used dired and tried to open
a file, xemacs wrote : "No file on line". I found a faq on the web

http://www.lerner.co.il/emacs/faq_6.html#SEC89

It says:

 Dired uses a regular expression to find the beginning of a file
 name. In a long Unix-style directory listing ("ls -l"), the file name
 starts after the date. The regexp has thus been written to look for
 the date, the format of which can vary on non-US systems.

 There are two approaches to solving this. The first one involves
 setting things up so that "ls -l" outputs US date format. This can be
 done by setting the locale. See your OS manual for more information.

 The second approach involves changing the regular expression used by
 dired, dired-move-to-filename-regexp.

Now I am somewhat baffled. I don't know how to do any of the two. If
someone has a quick solution please help me. (I use bash)

        Thanks in advance
        Niels

PS: I realise upgrading would probably be a quick solution, but I am
not the sysadm, and I don't have the skill to install a new xemacs
myself.

--
Niels L Ellegaard  http://dirac.ruc.dk/~gnalle/
SPECIAL OFFER! I proofread unsolicited commercial email sent to this
address at a rate of US $500.00 per incident!  Include billing address
in your message and save US $500.00 per hour off ordinary address
resolution and tracking charge!

2. word processing question

3. problems with "point", "mark" and "region"

4. Help! Migrating Windows Apps!

5. Q: How to highlight the "++", "--", "==" ... for C or C++

6. missing file "hal.dll" causes freeze upon booting.

7. "file mode spec error"+"emacs" & "emacs-20.6"

8. Creative 6424E CDRW problem

9. "Beautify files"!

10. demacs "fill" breaks "za" sequence in word after "z"!

11. Modeline shows "Raw" and "ISO8"

12. "abbrev" does not work for "while" ???

13. XEmacs with JDE,"Run App" I get "java -v <myclassfile>"