Change default working directory from ~/ to "."

Note that the lyxrc.document_path variable corresponds to what we
call the "Working directory" in the GUI preferences dialog.

Setting document_path to "." makes it so when LyX is started from a
directory, that directory is the default path for many of LyX's
operations, such as the following:

- new file, new from template
- adding a custom BibTeX file
- GUI compare dialog
- local layout button in document settings
- external material file browser
- graphics browser, include browser

The best guess for where the user wants to save or find files is the
directory the user started LyX from. Before, the default was always
the home directory. If desired, the old behavior can be restored by
changing the default path in Preferences > "Working directory".

This commit takes advantage of 9b64d7bd, which allows the use of a
relative path for path preferences.
This commit is contained in:
Scott Kostyshak 2016-10-08 20:59:54 -04:00
parent 5022ad51cb
commit 892593fbdc
2 changed files with 7 additions and 1 deletions

View File

@ -19,6 +19,12 @@
!!!The following pref variables were changed in 2.3:
* \document_path
Default is changed to ".". The best guess for where the user wants to save
or find files is the directory the user started LyX from. Before, the
default was always the home directory. If desired, the old behavior can be
restored by changing the default path in Preferences > "Working directory".
!!!The following pref variables are obsoleted in 2.3:

View File

@ -831,7 +831,7 @@ bool LyX::init()
#endif
lyxrc.tempdir_path = package().temp_dir().absFileName();
lyxrc.document_path = package().document_dir().absFileName();
lyxrc.document_path = ".";
if (lyxrc.example_path.empty()) {
lyxrc.example_path = addPath(package().system_support().absFileName(),