On Fri, Jul 29, 2016 at 01:30:25PM -0400, Scott Kostyshak wrote:

> I plan to soon propose to change the default of the working directory to
> '.', as this thread originally started out as. I would like to test a
> bit and take a look at where else that path is used besides creating a
> new file.

Patch attached.

Scott
From 22ee499acedca55a94b326e2422ef79022bdc32f Mon Sep 17 00:00:00 2001
From: Scott Kostyshak <skost...@lyx.org>
Date: Sat, 8 Oct 2016 20:59:54 -0400
Subject: [PATCH] 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.
---
 src/LyX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/LyX.cpp b/src/LyX.cpp
index fec8281..047e265 100644
--- a/src/LyX.cpp
+++ b/src/LyX.cpp
@@ -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(),
-- 
2.7.4

Attachment: signature.asc
Description: PGP signature

Reply via email to