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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-26-2004, 09:51 AM
|
#1
|
Member
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929
Rep:
|
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
|
|
|
11-15-2004, 05:07 PM
|
#2
|
LQ Newbie
Registered: Apr 2004
Location: Olympia, wa
Distribution: Mandrake 10, 10.1
Posts: 29
Rep:
|
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.
|
|
|
11-15-2004, 10:27 PM
|
#3
|
Member
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929
Original Poster
Rep:
|
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).
|
|
|
11-16-2004, 04:58 PM
|
#4
|
LQ Newbie
Registered: Apr 2004
Location: Olympia, wa
Distribution: Mandrake 10, 10.1
Posts: 29
Rep:
|
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.
|
|
|
11-16-2004, 06:55 PM
|
#5
|
Member
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929
Original Poster
Rep:
|
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!
|
|
|
11-16-2004, 11:19 PM
|
#6
|
Senior Member
Registered: Jun 2004
Posts: 2,553
Rep:
|
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
|
|
|
11-17-2004, 12:01 AM
|
#7
|
LQ Newbie
Registered: Apr 2004
Location: Olympia, wa
Distribution: Mandrake 10, 10.1
Posts: 29
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 06:34 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|