An Emacs mode for editing Python code

File mode specification error: (void-variable py-mode-map)

Reported by sanjay dhoni on 2012-11-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Medium
Andreas Roehler

Bug Description

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org. Please check that
the From: line contains a valid email address. After a delay of up
to one day, you should receive an acknowledgement at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug. If you can, give a recipe
starting from `emacs -Q':

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/Applications/Emacs.app/Contents/Resources/etc/DEBUG.

In GNU Emacs 24.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2012-08-27 on bob.porkrind.org
Windowing system distributor `Apple', version 10.3.1187
Configured using:
 `configure '--host=x86_64-apple-darwin' '--build=i686-apple-darwin'
 '--with-ns' 'build_alias=i686-apple-darwin'
 'host_alias=x86_64-apple-darwin' 'CC=gcc -mmacosx-version-min=10.5''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

In GNU Emacs 24.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2012-08-27 on bob.porkrind.org
Windowing system distributor `Apple', version 10.3.1187
Configured using:
 `configure '--host=x86_64-apple-darwin' '--build=i686-apple-darwin'
 '--with-ns' 'build_alias=i686-apple-darwin'
 'host_alias=x86_64-apple-darwin' 'CC=gcc -mmacosx-version-min=10.5''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  autopair-mode: t
  autopair-global-mode: t
  delete-selection-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

.emacs file

;path to python-mode
(add-to-list 'load-path "/Users/someuser/.emacs.d/python-mode.el-6.0.12/")
;;remove??
(add-to-list 'load-path "/usr/local/bin")
;;remove??
(add-to-list 'load-path "/Users/someuser/.emacs.d")
(setq py-install-directory "/Users/someuser/.emacs.d/python-mode.el-6.0.12/")
(setq pylookup-dir "/Users/someuser/.emacs.d/pylookup/")
(add-to-list 'load-path pylookup-dir)
(add-to-list 'load-path "/Users/someuser/.emacs.d/pylookup")
(setq py-shell-name "ipython")
(setq py-shell-name "/usr/local/bin/ipython")

(require 'python-mode)
(autoload 'python-mode "python-mode.el")
  (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))

(transient-mark-mode 1) ;
(delete-selection-mode 1) ;
;;(require 'ipython)

(require 'anything-ipython)
 (add-hook 'python-mode-hook #'(lambda ()
                                 (define-key py-mode-map (kbd "M-<tab>") 'anything-ipython-complete)))
 (add-hook 'ipython-shell-hook #'(lambda ()
                                   (define-key py-mode-map (kbd "M-<tab>") 'anything-ipython-complete)))
(when (require 'anything-show-completion nil t)
   (use-anything-show-completion 'anything-ipython-complete
                                 '(length initial-pattern)))

(require 'comint)
  (define-key comint-mode-map (kbd "M-") 'comint-next-input)
  (define-key comint-mode-map (kbd "M-") 'comint-previous-input)
  (define-key comint-mode-map [down] 'comint-next-matching-input-from-input)
  (define-key comint-mode-map [up] 'comint-previous-matching-input-from-input)

;; add pylookup to your loadpath, ex) ~/.emacs.d/pylookup
;;(setq pylookup-dir "[/Users/someuser/.emacs.d/pylookup]")
;;(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"))

;; set search option if you want
 (setq pylookup-search-options '("--insensitive" "0" "--desc" "0"))

;; 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)
(global-set-key "\C-ch" 'pylookup-lookup)

(autoload 'autopair-global-mode "autopair" nil t)
  (autopair-global-mode)
  (add-hook 'lisp-mode-hook #'(lambda () (setq autopair-dont-activate t)))

(add-hook 'python-mode-hook
          #'(lambda () (push '(?' . ?')
                              (getf autopair-extra-pairs :code))
 (setq autopair-handle-action-fns
      (list #'autopair-default-handle-action

(add-hook 'before-save-hook 'delete-trailing-whitespace)

Andreas Roehler (a-roehler) wrote :

py-mode-map isn't used any more. Probably you loaded ipython.el , which isn't needed any more also.
Not loading ipython.el should solve it. Will re-install a defvaralias lost by mistake, which should avoid that error anyway. Thanks for the report.

Changed in python-mode:
milestone: none → 6.1.0
assignee: nobody → Andreas Roehler (a-roehler)
importance: Undecided → Medium
Changed in python-mode:
status: New → Fix Committed
sanjay dhoni (sdhoniji) wrote :

Thanks for the response. If you look at my .emacs I have commented the loading of ipython. That didn't fix it, do I need to remove anything else?

Thanks

Am 22.11.2012 17:15, schrieb sanjay dhoni:
> Thanks for the response. If you look at my .emacs I have commented the
> loading of ipython. That didn't fix it, do I need to remove anything
> else?
>
> Thanks
>

do you get it still with latest trunk? Provided a

(defvaralias 'py-mode-map 'python-mode-map)

you should not get this error anymore.

Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers