in Education by
I am fairly new to Emacs and I have been trying to figure out how to change the default folder for C-x C-f on start-up. For instance when I first load Emacs and hit C-x C-f its default folder is C:\emacs\emacs-21.3\bin, but I would rather it be the desktop. I believe there is some way to customize the .emacs file to do this, but I am still unsure what that is. Update: There are three solutions to the problem that I found to work, however I believe solution 3 is Windows only. Solution 1: Add (cd "C:/Users/Name/Desktop") to the .emacs file Solution 2: Add (setq default-directory "C:/Documents and Settings/USER_NAME/Desktop/") to the .emacs file Solution 3: Right click the Emacs short cut, hit properties and change the start in field to the desired directory. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You didn't say so, but it sounds like you're starting Emacs from a Windows shortcut. The directory that you see with c-x c-f is the cwd, in Emacs terms, the default-directory (a variable). When you start Emacs using an MS Windows shortcut, the default-directory is initially the folder (directory) specified in the "Start In" field of the shortcut properties. Right click the shortcut, select Properties, and type the path to your desktop in the Start In field. If you're using Emacs from the command line, default-directory starts as the directory where you started Emacs (the cwd). This approach is better than editing your .emacs file, since it will allow you to have more than one shortcuts with more than one starting directory, and it lets you have the normal command line behavior of Emacs if you need it. CWD = current working directory = PWD = present working directory. It makes a lot more sense at the command line than in a GUI.

Related questions

0 votes
    I've been using Git for a while now and have recently downloaded an update only to find this warning message ... share repos with? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    Currently I try to switch from vim to emacs and have some difficulty while editing code. For most of ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    When I cut (kill) text in Emacs 22.1.1 (in its own window on X, in KDE, on Kubuntu), ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    I program with Emacs on Ubuntu (Hardy Heron at the moment), and I like the default text coloration ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    I like to use Emacs' shell mode, but it has a few deficiencies. One of those is that it's not ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    I've been aware of Steve Yegge's advice to swap Ctrl and Caps Lock for a while now, although I ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 12, 2022 in Education by JackTerrance
0 votes
    I've been aware of Steve Yegge's advice to swap Ctrl and Caps Lock for a while now, although I ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 12, 2022 in Education by JackTerrance
0 votes
    I am not sure whether this is just a simple mistake of my code. But I just cannot figure out ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I was wondering if there was a way (at least on Ubuntu, which I am using) to have Emacs "always ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I was wondering if there was a way (at least on Ubuntu, which I am using) to have Emacs "always ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    I was wondering if there was a way (at least on Ubuntu, which I am using) to have Emacs "always ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    When coding in elisp, I find that I'm stopping at hyphens when moving by words, and would prefer ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    I am trying to upload my localhost site that I am making to the live server. Before I did that I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    Having a Golang project and Go workspace. I'm trying to run my test, but I'm having the following ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I am trying to upload my localhost site that I am making to the live server. Before I did that I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
...