Pylookup is a mode to search python documents especially within emacs.

Usage

1. M-x pylookup-lookup

 1-lookup.png

  • M-x pylookup-lookup, (set your local key map)

2. Ido autocompletion

2-ido.png

  • Interactive do interface to search keywords
  • C-r, C-s : next/prev match

3. Search results

3-search.png

4-result.png

  • Results of searching a keyword
  • n/p : next/prev line
  • C-v,M-v : scroll up/down
  • q : quit
  • Space/Enter : lookup document

4.Read in your browser

5-browsing.png

  • You can see the proper python document in your favorite browser, w3m, firefox, ie or whatever.

Install

Checkout

/content/body/div[2]/div[1]/p/span, reference to undefined name 'syntax': line 1, column 1 (click for details)

Edit .emacs

;; add pylookup to your loadpath, ex) "~/.lisp/addons/pylookup"
(setq pylookup-dir "[PATH]")
(add-to-list 'load-path pylookup-dir)
;; load pylookup when compile time
(eval-when-compile (require 'pylookup))

;; set executable file and db file
(setq pylookup-program (concat pylookup-dir "/pylookup.py"))
(setq pylookup-db-file (concat pylookup-dir "/pylookup.db"))

;; to speedup, just load it on demand
(autoload 'pylookup-lookup "pylookup"
  "Lookup SEARCH-TERM in the Python HTML indexes." t)
(autoload 'pylookup-update "pylookup" 
  "Run pylookup-update and create the database at `pylookup-db-file'." t)
  • Change [PATH] variable to proper path where you installed pylookup
  • Add above code in your .emacs

Preferences

Keybinding

(global-set-key "\C-ch" 'pylookup-lookup)

Lookup downloaded documents

  • Update Database (In repository, there is database to lookup online document, but slow to load in a browser)
/content/body/div[3]/div[2]/pre/@function, reference to undefined name 'syntax': line 1, column 1 (click for details)
  • Move to pylookup directory
  • Execute pylookup.py with your absolute python document path, download from here
  • Test by executing pylookup.py -l test and check pylookup indicating proper path you set

Default browser

(setq browse-url-browser-function 'w3m-browse-url) ;; w3m
(setq browse-url-default-browser "firefox.exe")    ;; firefox in M$ Windows
  • Change to your preferneces

Acknowledgements

 

Tag page