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

`pcomplete-suffix-list' is an obsolete variable (as of 24.1) #10

Closed
tarsius opened this issue Mar 16, 2012 · 6 comments
Closed

`pcomplete-suffix-list' is an obsolete variable (as of 24.1) #10

tarsius opened this issue Mar 16, 2012 · 6 comments

Comments

@tarsius
Copy link
Contributor

tarsius commented Mar 16, 2012

What is this supposed to do in helm-esh-get-candidates?

(let* (...
        (pcomplete-autolist pcomplete-autolist)
        (pcomplete-suffix-list pcomplete-suffix-list))

I don't see these variables being modified so why the dynamic binding?
Also this causes one of the very few compile warnings.

@thierryvolpiatto
Copy link
Member

these variables are used internally by pcomplete and are needed.
`pcomplete-suffix-list' is needed on emacs-23, so we keep it for compatibility.

@lewang lewang closed this as completed Mar 17, 2012
@tarsius
Copy link
Contributor Author

tarsius commented Mar 17, 2012

Okay so they are used by pcomplete internally.

But why do we need a dynamic value for them? Especially since they are initialized to be eq to the global values and then never changed.

@lewang
Copy link
Member

lewang commented Mar 17, 2012

@tarsius The code implies they could be changed under some circumstance and the original value needs to be saved. Do you know for sure they will never be changed?

@tarsius
Copy link
Contributor Author

tarsius commented Mar 17, 2012

No, but who do you expect to change them?

If the values are potentially changed by some code called by helm-esh-get-candidates then I agree. (Edit: I assume this is the case just want to make sure.)

If some code that is part of pcomplete changes it then this is either a feature or a bug of pcomplete.

Finally if the local bindings are there to protect against changes made to these variables elsewhere (not by pcomplete internal code and not from within helm-esh-get-candidates) then this obviously does not work.

@thierryvolpiatto
Copy link
Member

Jonas Bernoulli
reply@reply.github.com
writes:

Okay so they are used by pcomplete internally.

But why do we need a dynamic value for them?

You have to wrap all `pcomplete-completions' calls with these
initialized values.
Expect bugs if you don't.

Especially since they are initialized to be eq to the global values
and then never changed.
They are changed internally by pcomplete during the process.
However, it behave differently between emacs23 and 24.
The code have been heavily modified in emacs24.
So indeed some value are never changed in your emacs version but maybe
used and changed by pcomplete in other emacs versions.

Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997

@tarsius
Copy link
Contributor Author

tarsius commented Mar 17, 2012

Okay fair enough.

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

3 participants