LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-26-2004, 09:51 AM   #1
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Rep: Reputation: 30
Changing emacs' default file location


Hi all,
I'd like to change the default location Emacs looks when first you press C-x C-f (ie. open file). By default the directory is the one containing the emacs binary, and having to change that to somewhere a few directories below ~ each time I open it is getting old...

Not had much luck on google, but there's so many .emacs options that I suspect I'm just not searching for the right one.
Thanks,
-Laura
 
Old 11-15-2004, 05:07 PM   #2
garymd
LQ Newbie
 
Registered: Apr 2004
Location: Olympia, wa
Distribution: Mandrake 10, 10.1
Posts: 29

Rep: Reputation: 15
Would you tell me what command you use in EMacs to change directory?

I typed Esc-x, but when I type in a directory,like /etc/tmp, I just get the response, 'no match'.

thanks

Last edited by garymd; 11-15-2004 at 05:11 PM.
 
Old 11-15-2004, 10:27 PM   #3
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Original Poster
Rep: Reputation: 30
Well, I don't really mean in terms of changing directory - I mean the initial directory it looks in when trying to open a file (Ctrl+X Ctrl+F).
 
Old 11-16-2004, 04:58 PM   #4
garymd
LQ Newbie
 
Registered: Apr 2004
Location: Olympia, wa
Distribution: Mandrake 10, 10.1
Posts: 29

Rep: Reputation: 15
I understand your question - unfortunately I can't help - but my own question (albeit ignorance) is how do you change the directory to be able to call up a file.

If I use Ctrl-x, Esc-x and then type the new directory I just get "no match". I am wondering if I am typing the directory incorrectly or nedd some other command?

I am using syntax like: "/etc/X11" for directory.

I found your post searching for emacs help and it seemed like you were able to change directory.

If y can help I would appreciate it.
 
Old 11-16-2004, 06:55 PM   #5
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Original Poster
Rep: Reputation: 30
Well, I'm not really sure what you're asking. Are you trying to get a directory listing of /etc/X11, or are you trying to open a file which is located in /etc/X11? "Changing directory" is a shell operation, not a text-editing operation, so I'm a little confused :-)

If what you're trying to do is open a file- the command that I listed in my post (Ctrl-x, Ctrl-F) is the command that you should be using.
For example, if you want to open /etc/X11/XF86Config, type Ctrl-x Ctrl-f, and type /etc/X11/XF86Config.

emacs supports tab-completion, if that helps you any :-) Entering a partial path and hitting Tab will give you the full completion, if the path/filename is unique, or let you know if it's not. If the path is not unique hitting Tab again will bring up the "Completions" buffer, which will give you a listing of everything that emacs finds matching your entry.

As another thought, if you're trying to run a shell command, the emacs command is M-! (i.e. Alt+Shift+1), and you'll get a prompt saying "Shell command:" from which you can run a single command (ls /etc/X11/, perhaps?). To get a whole shell running inside of emacs as a separate buffer, the command would be 'M-x shell'

Hopefully that's not too much information!
 
Old 11-16-2004, 11:19 PM   #6
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
that's an interesting question however i don't think you can without going into the source code directly
emacs kind of "thinks" about what directory is default like if you are currently editing in a directory it guesses you mean the same one and like that..... or it defaults to ~

there is a behavior you can use but it's most likely not any easier
ESC - x shell
then cd in that shell process should change default dir (this behaviour can be blocked in .emacs)

or better yet i think someone else was saying just from a xterm type shell
cd to the directory you want and type
emacs ./
or just emacs ./ in ~ and tunnel to where you want to be
emacs is a file and directory browser as well
 
Old 11-17-2004, 12:01 AM   #7
garymd
LQ Newbie
 
Registered: Apr 2004
Location: Olympia, wa
Distribution: Mandrake 10, 10.1
Posts: 29

Rep: Reputation: 15
Thumbs up

Okay - I figured out my problem. It was especially confusing as my very similar version of emacs onmy desktop and laptop did not quite behave the same and I am not too familiar with unix commands (mdk 10 vs 10.1). It turns out that on the 10.1 there is a "~/" that is put in place after you hit C-x C-f, so that you are in a certain directory and when I added the path it was already after the original directory.

Anyway, thanks much for your help. I learned a lot just from both of your comments




Last edited by garymd; 11-17-2004 at 12:08 AM.
 
  


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
changing default for pdf file opening moonmoth Linux - Software 7 07-27-2005 04:05 PM
Changing the default /tmp location nws_linux Linux - Newbie 6 09-16-2004 11:45 AM
Changing default Mozilla location compassman Linux - Software 2 06-26-2004 04:44 PM
changing user's default ftp home location GraemeK Linux - Networking 0 12-31-2003 01:11 PM
changing default mount location MeanJoshGreen Linux - Hardware 3 12-07-2003 03:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:14 AM.

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