LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-17-2003, 04:36 AM   #1
TrippyChik
LQ Newbie
 
Registered: Oct 2003
Location: FL
Distribution: Red Hat 9
Posts: 2

Rep: Reputation: 0
Question EMACS-text editor


OK here goes...newbie running Red Hat 9 and I'm trying to learn to do BASH...I go into my text editor (either the one from the accessories menu or from my programming menu: emacs, vi, xemacs.) OK. Now I open up say emacs and try to write a program and nothing happens. I type everything in and voila! nothing happens. Am I supposed to open up a terminal window first? HELP (before I have a meltdown!)
 
Old 10-17-2003, 04:40 AM   #2
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
i don't use emacs, but i'd fathom a guess that you still have to save the file (buffer) and set it's permissions to execute using chmod.
 
Old 10-17-2003, 05:06 AM   #3
arunshivanandan
Member
 
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643

Rep: Reputation: 30
emacs is a bit tough to use.(understainding C-x,C-y etc takes some time.)Better use vi text editor or some ide like kdevelop or anjuta or glade.
 
Old 10-17-2003, 05:13 AM   #4
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 31
Emacs is not tough to use. You just have to know the key combinations to make it work. The following are the most used keys...(After the keys, just enter the filename)

Ctrl-x Ctrl-f :- Open a new file, or if a file exists, open it.
Ctrl-x Ctrl-s:- Save the modified file.
Ctrl-x Ctrl-w:- Save the file as <new name>
Ctrl-x Ctrl-c:- Quit emacs

Type "Ctrl-h t" for a simple tutorial on emacs (Inside emacs of-course).

Note that emacs is a mode-less editor(It means that whatever you enter is taken as text, unless if it is used with some key such as Ctrl, alt etc..)
 
Old 10-17-2003, 05:20 AM   #5
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 31
And I want to add that once you start learning emacs, every IDE's will start to seem primitive to you. It has such a good support for all the languages you know, and even for languages you don't know.
 
Old 10-17-2003, 05:34 AM   #6
mhearn
LQ Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 47
Hear hear - emacs is godly. If you are interested in programming, learn how to use it, you won't regret it. Vi is no easier to use by the way.

Just save the buffer then run it with "bash filename"
 
Old 10-17-2003, 05:43 AM   #7
arunshivanandan
Member
 
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643

Rep: Reputation: 30
http://www.linuxquestions.org/questi...hreadid=104180 is a post on vi vs emacs.
 
Old 10-17-2003, 08:56 AM   #8
ehawk
Senior Member
 
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
xemacs

I find that xemacs is much nicer to use than emacs. The graphical menus make the "kung-fu typing" of emacs unecessary, but the shortcut keys are still given when you look at a gui command. Of course you have to save the file before executing it, and save it after changes to execute the modified code.
 
Old 10-17-2003, 08:58 AM   #9
mhearn
LQ Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 47
I take it you never saw GNU emacs in graphics mode?

http://theoretic.com/mike/coding-emacs-transparent.png
 
Old 10-17-2003, 09:17 AM   #10
ehawk
Senior Member
 
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
Talking hey, you're right!

How 'bout that! I remember trying emacs on some computers at my school before, and didn't see the menus....but they definitely seem to be there now! But still, the versions we have here are 20.7.1 and 21.2.1, and neither seems as gui-wise as xemacs 21.4. If you have permissions to install the latest stuff....oh well.... I saw the png that was posted...look pretty much the same as emacs I can use...just doesn't seem as nice as xemacs, once you see what you can change in those menus....

Last edited by ehawk; 10-17-2003 at 09:28 AM.
 
Old 10-17-2003, 09:36 AM   #11
mfeat
Member
 
Registered: Aug 2003
Location: Akron, OH
Distribution: Fedora Core 3
Posts: 185

Rep: Reputation: 30
The emacs in Redhat v9 comes up with a menu & toolbar at the top. Just click on the diskette to save the file and click on menu Tools then select Compile and enter the compile command at the bottom where it says "Compile command:". Enter chmod +x {file} for the first time to make the file executable. Do the compile command again, this time enter "make {file}; {file}" to compile and run the program. These commands will show up automatically every time the compile command is run from that point forward.

Any number of host commands can be run from the "Compile command" prompt, all commands entered are saved and can be scrolled through using the up & down arrows. Also, any number of multiple commands can be entered as one compile command, just separate each command with a semicolon.

I customized emacs file to use function keys F3 to save & F4 to compile by adding the following to my .emacs file:

(global-set-key [f3] 'save-buffer)
(global-set-key [f4] 'compile)

Just press F3 and F4 to compile & run
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 11:28 AM
using emacs editor with fedora core 4 gambato79 Fedora 1 07-15-2005 10:39 AM
VI Editor & Emacs drumstick Linux - Software 9 05-30-2005 07:26 AM
Makefile with emacs editor problem? varala_kanth Linux - Software 0 04-03-2004 02:05 AM
Text Mode Editor: What Choices? BASH, VI, EMACS? LinxAI Linux - Newbie 12 03-28-2004 11:17 PM


All times are GMT -5. The time now is 04:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration