emacs AAAAAAAAAAAAAHHH!!!

I

ioneabu

Sorry for the annoying subject, but I cannot express my frustration any
better here. I am willing to take on learning anything new that will
help me to program better and more efficiently.

I have now used emacs on OS X and Win XP. I have gone through the
tutorial and learned to navigate around and do the basics. I also
learned to invoke cperl-mode and even how to cut & paste some lisp code
into an .emacs file to supposedly start up with cperl-mode configured
in various ways.

All I really wanted up front was to see my Perl syntax color coded and
to compile and run my Perl program from within emacs, just to see it
work.

I did see it expand things for me, like:

while (()) {
}

which was pretty neat. It also persistantly gave me an explanation of
what #!/usr/bin/perl was for. Occasionally, it gave unhelpful advice
about unclosed {} on certain lines, which I am certain it was not
correct.

I have wasted a day and a half that could have been dedicated to
learning a new module or two or learning more core Perl or whatever.

I see that many people use and love emacs and think it is the greatest
for programming and everything else. I cannot find a decent online
tutorial for using emacs to write Perl. Everyplace I look just gives
the same few lines for the .emacs file and little else. I don't even
see a Perl/emacs book on amazon.com.

Is it worth continuing or am I just as well off without it? I like vi
and I also use a simple editor I wrote for Windows which has an ever
present directory and file list box at the left of the screen which
makes it really easy to fly through directories and files quickly.
Sometimes I just like to grab the mouse and grab a bunch of text for
copying, cutting etc... instead of thinking, 'let me mark here and mark
there, yank, jump over here now, delete, aaaaah! I just erased the
stuff in my buffer!' I grew up with Windows/Mac type editors and am
learning Unix type editing later in life.

Thanks for any advice

wana
 
M

Mike Dowling

Sorry for the annoying subject, but I cannot express my frustration any
better here. I am willing to take on learning anything new that will
help me to program better and more efficiently.

For the life of me, I cannot see your problem, unless it's a lack of
familiarity with emacs in general. It takes some getting used to, and
it's keyboard oriented as opposed to mouse oriented, but once you get
the hang of it, it's a great editor.
I have now used emacs on OS X and Win XP.

I suffer under windows at work as well, but emacs is at its best with
UNIX.
I see that many people use and love emacs and think it is the greatest
for programming and everything else.

Well, I still prefer vi when no intelligence on behalf of the editor is
required. Fast, efficient, effective.
I cannot find a decent online tutorial for using emacs to write Perl.
Everyplace I look just gives the same few lines for the .emacs file
and little else. I don't even see a Perl/emacs book on amazon.com.

There are books around on emacs, many of which are very worthwhile.
(Mine are very old, and refer to ancient versions, but a google search
should do the trick.) Also, take a look at the manual. I found
printing it out a look easier than the GNU info (which I dislike). Try
looking at the elisp source code of cperl-mode.el (and most other elisp
packages). A lot is usually explained there as to how to use the
package, and how to customise it. Soon you'll have a complex but
effective .emacs file that is tailored to you and your needs.

Cheers,
Mike Dowling
 
J

Juha Laiho

(e-mail address removed) said:
Sorry for the annoying subject, but I cannot express my frustration any
better here. I am willing to take on learning anything new that will
help me to program better and more efficiently.

I understand your frustration - emacs can be (and easily is) pretty
intrusive. It's meant to be considered as a way of life. If you spend
enough of your time writing code so that you can accept the emacs way
of life, then your life really will become easier. On the other hand,
if you just dabble at a piece of code every now and then, then emacs
may well be too intrusive (by default, at least). Of course, as emacs
is pretty much completely customisable through writing snippets of
elisp, you could tell emacs to keep out of your way. But then, writing
this amount of elist I guess would mean you're doing so much with emacs
that it is your way of life, so we have a slight chicken-and-egg
problem here.

Mind you, the same seems to be true for every large piece of software:
most fullblown GUI IDEs I've seen (like NetBeans for Java) are the
same -- and even MS Word is the same, if you just want to write a simple
one-page note. So, if you're spending a lot of your time with some
computer-related activity, get good tools for that, and learn to
utilise them. After the initial shock, they will ease your work. If
you're just dabbling occasionally, use as lightweight tools as you
can get away with -- they'll not be in your way.
I see that many people use and love emacs and think it is the greatest
for programming and everything else. I cannot find a decent online
tutorial for using emacs to write Perl. Everyplace I look just gives
the same few lines for the .emacs file and little else. I don't even
see a Perl/emacs book on amazon.com.

Don't look for perl/emacs book. Look for a emacs book: because it's emacs
anyway, it'll be more or less the same. Learn elisp to some extent (more
than just copy-paste). Have a look in the cperl-mode.el file for insights
into how/why cperl mode does something in the way it does (and also to
possibly find some useful settings that are not documented for a reason
or another).

But as said, I understand your frustration. For the time being, I'm not
spending enough time writing code to really use Emacs, so I've reverted
to the small tools. Back when I did write more code, I did find emacs
a good tool - but did remember having a similar frustration as you
describe.
 
B

babydoe

wana said:
All I really wanted up front was to see my Perl syntax color coded
and to compile and run my Perl program from within emacs, just
to see it work.

I'll start you off :

1. download the file 'mode-compile.el'

http://www.tls.cena.fr/~boubaker/distrib/mode-compile.el

and store it in your site-lisp directory.

2. download the file perl-54-info.tar.gz from CPAN and
extract the files and store in your 'info' directory.

3. in your info directory open up the 'dir' file and add
the following line at the bottom of the file.

Development
* Perl Modules: (pm).
* Perl - Practical Extraction and Report Language: (perl).

(be careful that the very last line in the 'dir' file is
a blank line otherwise it won't be read by Emacs)

4. in your site-lisp directory create a file 'default.el'
(you will have to look at variable exec-path to point
to your perl and Emacs binaries)

;;
------------%<---------------------------------------------------------
;; default.el should contain any convenience settings
;;
;;
;; look and feel customizing
;;
(setq debug-on-error t)
(setq default-frame-alist
'((top . 15)(left . 15) ; indent for cascade frames
(width . 80)(height . 30)
(cursor-color . "Red")
(cursor-type . bar)
(foreground-color . "black")
(background-color . "ivory")
(font . "-*-Courier New-normal-r-*-*-11-82-96-96-c-*-iso8859-1")))

(set-face-background 'modeline "navy")
(set-face-foreground 'modeline "gold")
(set-face-font
'italic "-*-Courier New-normal-i-*-*-11-82-96-96-c-*-iso8859-1")
(set-face-font
'bold "-*-Courier New-bold-r-*-*-11-82-96-96-c-*-iso8859-1")
(set-face-font
'bold-italic "-*-Courier New-bold-i-*-*-11-82-96-96-c-*-iso8859-1")
(setq initial-frame-alist '((top . 0) (left . 0)))

;;; coloring syntax
(global-font-lock-mode t)
(setq font-lock-maximum-decoration 3)

;; set exec-path explicitly, and then Sync exec-path to PATH
(setq exec-path '("c:/perl/bin" "c:/Emacs/bin"))
(setenv "PATH" (mapconcat 'identity exec-path path-separator))

(require 'cperl-site)
(require 'mode-compile-site)
;;
------------%<---------------------------------------------------------

5. also in site-lisp directory create 'cperl-site.el' and
paste the following into it (changing for your CPERL5LIB)

;;
------------%<---------------------------------------------------------
;; CPERL-SITE.EL
;;
;; Make cperl-mode the normal mode for Perl
(setenv "PERL5LIB" "c:/perl/lib/;c:/perl/site/lib")
(require 'cperl-mode)
(defalias 'perl-mode 'cperl-mode)

(setq cperl-hairy t)
(setq auto-mode-alist (cons '("\\.plx$" . cperl-mode) auto-mode-alist))

(provide 'cperl-site)

;; CPERL-SITE ends here.
;;
------------%<---------------------------------------------------------

6. create 'mode-compile-site.el' is site-lisp and paste

;;
------------%<---------------------------------------------------------
;;; MODE-COMPILE-SITE ---

(defvar mode-compile-map (make-sparse-keymap)
"Keymap for mode-compile mode.")

(setq mode-compile-expert-p t)

(condition-case err
(progn
(require 'easymenu)
(easy-menu-define mode-compile-menu mode-compile-map
"Call compilation according to mode"
'("Compile..."
["Run" mode-compile t]
["Next error" next-error t]
["Kill" mode-compile-kill t])))
(error (message "%s" err)))

(easy-menu-change '("tools") "compile" mode-compile-menu)

(autoload 'mode-compile "mode-compile"
"Command to compile current buffer file dependently of the major
mode" t)
(autoload 'mode-compile-kill "mode-compile"
"Command to kill a compilation launched by `mode-compile'" t)

(global-set-key "\C-cc" 'mode-compile)
(global-set-key "\C-ck" 'mode-compile-kill)

(provide 'mode-compile-site)

;;; END MODE-COMPILE-SITE.EL ---
;;
------------%<---------------------------------------------------------

7. You should now be able to run perl by typing 'ctrl-C c'

8. An aside, on win32, I use TEI Emacs : it's the duck's guts.

http://www.tei-c.org/Software/tei-emacs/

Also useful are some ported Unix tools (msys):

http://www.mingw.org/msys.shtml
 
I

ioneabu

I'll start you off :
....

7. You should now be able to run perl by typing 'ctrl-C c'

8. An aside, on win32, I use TEI Emacs : it's the duck's guts.

http://www.tei-c.org/Software/tei-emacs/

Also useful are some ported Unix tools (msys):

http://www.mingw.org/msys.shtml


Thank you very much for this! And thanks to all for thoughts and
empathy. I do try to only work on little bite-size bits of code at a
time and I am not a professional, but I would like to get in on the
whole emacs thing eventually. I read that the creator of emacs has a
big book out and there is another big one on lisp for emacs. I'll try
and master the tutorial stuff little by little and when I'm ready, I'll
get the emacs book.

Thanks again!

wana (TEI Emacs download at 18%)
 
M

m

I have now used emacs on OS X and Win XP. I have gone through the
tutorial and learned to navigate around and do the basics. I also
learned to invoke cperl-mode and even how to cut & paste some lisp code
into an .emacs file to supposedly start up with cperl-mode configured
in various ways.
Is it worth continuing or am I just as well off without it? I like vi

Thanks for any advice

wana

try eclipse. i use it always and its grt even in windows.will help in
all your other languages also.
 
C

Constantin Wiemer

Sorry for the annoying subject, but I cannot express my frustration any
better here. I am willing to take on learning anything new that will
help me to program better and more efficiently.

I have now used emacs on OS X and Win XP. I have gone through the
tutorial and learned to navigate around and do the basics. I also
learned to invoke cperl-mode and even how to cut & paste some lisp code
into an .emacs file to supposedly start up with cperl-mode configured
in various ways.

All I really wanted up front was to see my Perl syntax color coded and
to compile and run my Perl program from within emacs, just to see it
work.

I did see it expand things for me, like:

while (()) {
}

which was pretty neat. It also persistantly gave me an explanation of
what #!/usr/bin/perl was for. Occasionally, it gave unhelpful advice
about unclosed {} on certain lines, which I am certain it was not
correct.

I have wasted a day and a half that could have been dedicated to
learning a new module or two or learning more core Perl or whatever.

I see that many people use and love emacs and think it is the greatest
for programming and everything else. I cannot find a decent online
tutorial for using emacs to write Perl. Everyplace I look just gives
the same few lines for the .emacs file and little else. I don't even
see a Perl/emacs book on amazon.com.

Is it worth continuing or am I just as well off without it? I like vi
and I also use a simple editor I wrote for Windows which has an ever
present directory and file list box at the left of the screen which
makes it really easy to fly through directories and files quickly.
Sometimes I just like to grab the mouse and grab a bunch of text for
copying, cutting etc... instead of thinking, 'let me mark here and mark
there, yank, jump over here now, delete, aaaaah! I just erased the
stuff in my buffer!' I grew up with Windows/Mac type editors and am
learning Unix type editing later in life.

Thanks for any advice

wana

If you prefer a more Windows/Mac-like but still powerful editor, you may
want to give NEdit (http://www.nedit.org) a try. It allows GUI-based
editing but has a lot of features and is also programmable.

Hope this helps,

Constantin Wiemer
 
A

Arndt Jonasson

Sorry for the annoying subject, but I cannot express my frustration any
better here. I am willing to take on learning anything new that will
help me to program better and more efficiently.

Some commands in Emacs I find very helpful when writing/reading code in
programming languages that use matching brackets of varying kinds
(that is, virtually all) are C-M-f, C-M-b and C-M-k, for jumping over
one "expression" forwards, backwards, and deleting it forwards, respectively.
An expression here is anything between balanced brackets (this is sometimes
useful even for ordinary text).

The "mark" concept is also one I use heavily. You can set a mark with
C-space, and later jump back to that place in the buffer with C-x
C-x. Sometimes marks get set automatically, like when you finish a
search. Marks are saved in a stack (or ring - they go back to the end
when the "stack" is popped), so if I know I had an interesting
position marked and want to get back to it, I use C-U C-space a few
times.

A third thing that helps when writing code is automatic indenting (not
so automatic that it does it as soon I press anything at all - I don't
like "electric" indenting). If I press Tab on a line, it gets indented
appropriately considering what is above. Often an unexpected result from
this helps me see an earlier syntax error. (Sometimes it fails - I can't
vouch for how well it works in Perl mode, since I haven't programmed
much Perl yet - this depends on how many peculiar ways there are in the
language of using brackets that don't match.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,076
Latest member
OrderKetoBeez

Latest Threads

Top