# HG changeset patch # User Oleksandr Gavenko # Date 1424367637 -7200 # Node ID f9baff41786884fcb292826d86034050fc5c832e # Parent e0de9be5c1ee602a4461df6f6b473ff0de2cfa17 If region active - use it content as default value. diff -r e0de9be5c1ee -r f9baff417868 pypi.el --- a/pypi.el Thu Feb 19 19:30:32 2015 +0200 +++ b/pypi.el Thu Feb 19 19:40:37 2015 +0200 @@ -27,7 +27,10 @@ ;;;###autoload (defun pypi.pkg (pkg) - (interactive (list (read-string "Python package: " "" 'pypi.pkg-history (thing-at-point 'symbol)))) + (interactive (list + (read-string "Python package: " + (if (region-active-p) (buffer-substring (mark) (point)) (thing-at-point 'symbol)) + 'pypi.pkg-history))) (url-retrieve (format pypi.url pkg) #'pypi.pkg-callback)) (provide 'pypi)