[Python-mode] python-mode modifies load-path emacs-wide.
Barry Warsaw
barry at python.org
Tue Aug 16 23:58:36 CEST 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Aug 16, 2011, at 11:07 PM, Cavesnow wrote:
>I will try to explain my idea a bit better. Removing part with the
>direct modification of load-path I think is clear: a library shouldn't
>interfer with global settings.
Agreed.
>If I understand correctly pycomplete would probably be loaded from inside
>python-mode and it is not meant to be a stand-alone library. Correct me if I
>am wrong.
Andreas can answer that, but I can say that python-mode.el should be loadable
standalone. It can use optional additional tools, but loading python-mode.el
should not break if it can't find them, and basic editing, syntax
highlighting, etc. should just continue to work.
>Anyway, since I have not found any place in the python-mode.el file
>where pycomplete.el nor did I find any auto-load instructions I thought of
>this solution. Let's say that at a certain point python-mode wanted to use
>functions provided in pycomplete and thus had to load it as a library. My
>idea was that in that case the loading was to be made this way:
>
>(let ((load-path (add-to-list 'load-path (concat py-library-path
>"completion"))))
> (load-library "pycomplete")
> )
Rather, I think the right way to do this is to leave load-path hackery up to
the user, but python-mode.el should have something like:
(condition-case nil
(require 'pycomplete)
(error))
to just ignore it if it can't be found (or *maybe* echo a warning).
Cheers,
- -Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAEBCAAGBQJOSugMAAoJEBJutWOnSwa/QUwP/0XYgRKYZB8GflhSAuSug41J
9GHHqePMjA0VyZK+VgRtqtEdyIJmCMKAST26BdgobJwBcjPtEQj9RRnbAkbToA2+
BAnndi8ToKgdMFBdLI6n7p854mP44/Y7EJQLKCFw08EqQmoWY8duPSnY6JLFVIXz
NkPS9MbEst96ZNqSu7U7wTUGfm0fsa/9nd8P6R6Z0tYLlftz/vla2z1quDxG0fSI
B+ZEKHE6zl8N9F8JptIyGBc293yBsqQ27nl1J0bhRh7CVkZq1/FltiLiqeSEd30w
FfcKJavhrCQUQvuqIbzvJB/doZi6adi1f3wUiExtlvcnMXTBvSnH6dK8b2Pie/LR
KvOoMMWR7t7Amo56W5xMDGON+FmmOK33mKiN6/pyl3hy/nFoWvp3qdQwI7u7xSt4
58XXxpS71yXBIKb2ZeLF4XOSNEP5EaL9g6vHbHXKx1VD5a2k3VvyowNXGa74CTIH
9pWC6zUV0ta5JD7721UOIwimxdQXBKOfh411X5Wdx/N+oiiAEVlFTT/TvORUrpt9
3Ml73gItH7h9qkRUu4Y5egPZinfq84CMEm0mc99TPf4kKJzl2X56vQignnhTBUTw
XXDKlwO2aauhG2WbaK8P941w1k7LpQ54Xfku2Waivb3l+Kt+snqHTbHHLsHKfPh2
a6ZDtEGUrCANUFCvZjTD
=XAWo
-----END PGP SIGNATURE-----
More information about the Python-mode
mailing list