Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop litering .lg_history in current directory. #1443

Closed
linas opened this issue Feb 21, 2023 · 8 comments
Closed

Stop litering .lg_history in current directory. #1443

linas opened this issue Feb 21, 2023 · 8 comments

Comments

@linas
Copy link
Member

linas commented Feb 21, 2023

Currently, this line:

#define HFILE ".lg_history"

causes the .lg_history file to be written in the current working directory, resulting in LG litter everywhere. It's getting annoying. It should be changed to either ~/.lg_history or to ~/.cache/link-grammar/lg_history

I tried changing it to ~/.lg_history but that did not work. Seems that history_w(hist, &ev, H_LOAD, HFILE); does not know what to do with the tilde. And, at any rate, this won't work in windows, anyway. So I'm opening this bug report instead ...

@ampli
Copy link
Member

ampli commented Feb 21, 2023

There is a function expand_homedir() in parser-utilities.h.
There is a comment there:

 * Note: ~user is not supported here on Windows.

However, it seems this is a comment rot since the code seem to support Windows (and 54f6723 says I tested it).

@linas
Copy link
Member Author

linas commented Feb 21, 2023

Cool, thanks, I'll trying hacking that up, unless you want to do it.

@ampli
Copy link
Member

ampli commented Feb 21, 2023

Please do it, because I'm preparing yet some other PRs just now.

@linas
Copy link
Member Author

linas commented Feb 21, 2023

Fixed, in #1446 for Linux only. I'm leaving this open, for Windows and Apple. Should be easy; just .. different #defines, right?

linas added a commit to linas/link-grammar that referenced this issue Feb 21, 2023
@linas
Copy link
Member Author

linas commented Feb 21, 2023

Closing because resolved in #1447.

@linas linas closed this as completed Feb 21, 2023
@linas linas reopened this Feb 21, 2023
@linas
Copy link
Member Author

linas commented Feb 21, 2023

Closed wrong issue.

@linas
Copy link
Member Author

linas commented Feb 22, 2023

See comments in #1446 for current status

@ampli
Copy link
Member

ampli commented May 24, 2024

I have just submitted PR #1534 - XDG-base-directory implementation that has per-dict history.

@ampli ampli closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants