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

module variables not getting set #252

Open
yusi1 opened this issue Jun 24, 2022 · 6 comments
Open

module variables not getting set #252

yusi1 opened this issue Jun 24, 2022 · 6 comments

Comments

@yusi1
Copy link
Contributor

yusi1 commented Jun 24, 2022

I have a module called productivity and it needs some variables to be set that are defined in the source for the module with defvar, but when I go into the StumpWM REPL C-w : in my setup, StumpWM says the variable is undefined, even though I loaded the module in? Also that means I can't set the variable to something because it doesn't exist in the first place, shouldn't the variables defined in the module source get loaded in when I load the module in, in my init file?

For some reason I have to go into the source code for the module and directly change the variables there, but changing them in the init file doesn't work, it is very weird.

Maybe it is something wrong with my system, idk.

@PuercoPop
Copy link
Member

@yusi1 Most likely the issue is that you are not referring to the write symbol, try using the qualified symbol name by using :, ej. productivity:*productivity-mode-is-on*

@yusi1
Copy link
Contributor Author

yusi1 commented Jun 25, 2022

So I tried doing:

(setf productivity:*productivity-keys*
      '(("C-w" *root-map*)))

But StumpWM says the symbol is not in the package? Very weird, because it is.

@yusi1
Copy link
Contributor Author

yusi1 commented Jun 25, 2022

But I tried in the REPL:
C-w h v and then I did productivity:*productivity-keys* and it says it is defined, but it still says the old value?

@yusi1
Copy link
Contributor Author

yusi1 commented Jun 25, 2022

So I tried to actually set the variable through the REPL but StumpWM says:
The symbol "*PRODUCTIVITY-KEYS*" is not external in PRODUCTIVITY package.

@yusi1
Copy link
Contributor Author

yusi1 commented Jun 25, 2022

Ok, so I've managed to fix my problem, instead of using a single colon, I used two colons before the variable since it is an unexported variable, now productivity mode picks up the variable from my init file, I read this StackOverflow post that helped me understand what was going on: https://stackoverflow.com/questions/8567155/why-colons-precede-variables-in-common-lisp

@yusi1 yusi1 closed this as completed Jun 25, 2022
@yusi1 yusi1 reopened this Jun 25, 2022
@yusi1
Copy link
Contributor Author

yusi1 commented Jun 25, 2022

I opened this pull request to change this in the README for the module so that no one else comes across this problem: #253

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

No branches or pull requests

2 participants