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

Removal of Recent Files and Projects from geany.conf #1763

Closed
mbrandis opened this issue Feb 8, 2018 · 11 comments
Closed

Removal of Recent Files and Projects from geany.conf #1763

mbrandis opened this issue Feb 8, 2018 · 11 comments
Milestone

Comments

@mbrandis
Copy link

mbrandis commented Feb 8, 2018

Hi!

I would like to propose an enhancement/feature request:

  • At the moment the recent files/projects are saved in geany.conf.
  • I would like to save geany.conf in a revision control system, so I can share the configuration between different computers.
  • The recent files from different computers lead often to merge conflicts of the configuration file.
  • E.g. I do this very successfully with vi, one configuration over many computers.

Is is possible, to move the recent files/projects to a separate (local) state file?

Regards,
Mark

@elextr
Copy link
Member

elextr commented Feb 8, 2018

Well, its probably possible to separate settings from session, but somebodys got to do it. Pull requests are welcome.

@lpaulsen93
Copy link
Contributor

Maybe an alternative would be to be able to clear the recent files and projects list?

@mbrandis
Copy link
Author

mbrandis commented Feb 8, 2018

I thought about that. I would not miss the recent files after a new start, but the recent projects are really useful.
If geany was written in Perl or Python I would try my luck. I'm not versed in C at all.

@elextr
Copy link
Member

elextr commented Feb 8, 2018

If geany was written in Perl or Python I would try my luck. I'm not versed in C at all.

Well, geany.conf is just a plain text file, so you can write a script to remove the entries from a copy that you VCS and put geany.conf in .gitignore. And a script to restore all but the session info.

In general storing tool configs for general purpose tools like editors in shared VCS is frowned upon, not everyone wants to use the same editor, though you can of course do anything with your own stuff.

@campisano
Copy link

I'm doing something like @elextr suggestion (ugly I know):

rm -rf ~/.cache/geany_config; cp -L -r ~/.config/geany/ ~/.cache/geany_config; geany -c ~/.cache/geany_config; rm -rf ~/.cache/geany_config

Maybe there are other configs statements to 'extract', like geometry, for the scope of put geany.conf in a VSC. In addiction, the geany.conf file is generated at first start with a lot of default configs. I did a try removing them and keep just what I did change, but the editor will put them again.

I think that can be a useful feature to have a way to add just a subset of instructions/configs in a file to enhance/customize the behavior of geany, like themes or external commands. Maybe a better way to do so can be the use of something like a geany.d folder with custom files to be read when exist, and that can overwrite the configs in geany.conf... What do you think?

@elextr
Copy link
Member

elextr commented Oct 14, 2020

I did a try removing them and keep just what I did change, but the editor will put them again.

Yes, the Glib library that writes .conf files writes the whole file.

@admorris
Copy link
Contributor

admorris commented Apr 3, 2021

I started a PR which I hope will resolve this issue. I need help tracking down a GUI bug I introduced.

@elextr
Copy link
Member

elextr commented Apr 3, 2021

@abmorris what is your use-case for not using Geany projects?

@admorris
Copy link
Contributor

admorris commented Apr 4, 2021

I want to back-up and synchronise my settings (dotfiles-style) across all computers where I use geany. Since my $HOME path is different on each, and I generally work on different projects on each, the recent files list from one computer is pretty meaningless on another. I believe this is the use-case that @mbrandis is describing at the top of this issue.

kugel- pushed a commit that referenced this issue Apr 7, 2021
…nt files and VTE session) (#2776)

Related to  #1763.

## New behaviour

Preferences are written to and read from `geany.conf` (like before), whereas "session data" is written to and read from `session.conf`.

For the sake of backwards compatibility, if `session.conf` does not exist, the data is read from `geany.conf` instead. 

## Implementation

I introduced an `enum` in `src/keyfile.c` called `ConfigPayload` which determines whether to read/write preference-data or session-data. 

The strings `"geany.conf"` and `"session.conf"` are now defined as preprocessor macros `PREFERENCES_FILE` and `SESSION_FILE`, respectively.

## Matters of taste
- The old recent files are not cleared from `geany.conf`
- The string `"geany.conf"` still appears in `src/keybindings.c` and `src/libmain.c`, so changing the `PREFERENCES_FILE` macro in `src/keyfile.c` is not enough to rename this file.
@kugel-
Copy link
Member

kugel- commented Apr 7, 2021

This is addressed in the session_split branch which should be merged before the next release

@kugel- kugel- added this to In Progress in session split Apr 7, 2021
xiota pushed a commit to xiota/geany that referenced this issue Nov 22, 2021
…nt files and VTE session) (geany#2776)

Related to  geany#1763.

## New behaviour

Preferences are written to and read from `geany.conf` (like before), whereas "session data" is written to and read from `session.conf`.

For the sake of backwards compatibility, if `session.conf` does not exist, the data is read from `geany.conf` instead. 

## Implementation

I introduced an `enum` in `src/keyfile.c` called `ConfigPayload` which determines whether to read/write preference-data or session-data. 

The strings `"geany.conf"` and `"session.conf"` are now defined as preprocessor macros `PREFERENCES_FILE` and `SESSION_FILE`, respectively.

## Matters of taste
- The old recent files are not cleared from `geany.conf`
- The string `"geany.conf"` still appears in `src/keybindings.c` and `src/libmain.c`, so changing the `PREFERENCES_FILE` macro in `src/keyfile.c` is not enough to rename this file.
@kugel-
Copy link
Member

kugel- commented Nov 23, 2021

session_split branch merged 6856edd

@kugel- kugel- closed this as completed Nov 23, 2021
@kugel- kugel- moved this from In Progress to Done in session split Apr 24, 2022
@b4n b4n added this to the 1.39/2.0 milestone Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

7 participants