I suppose my problem is pretty obvious, but I don’t know Lisp and can’t figure it out. Every time I try to write a capital “M” in a python file it won’t work (It seems to think that’s a start of a shortcut). My guess is that’s somewhere in a module or my .emacs file it tries to bind something to Alt + something. But instead it binds it to capital M something. Here’s my .emacs file (of which I copied most of it from the net):
; load-path setting is only needed if the directory you put
; weblogger.el in isn't already in your load-path
(add-to-list 'load-path "~/.emacs.d/")
; Remap Ctrl-tab to M-Tab
(define-key function-key-map [(control tab)] [?\M-\t])
(require 'ipython)
(define-key py-mode-map (kbd "M-") 'anything-ipython-complete)
(define-key py-shell-map (kbd "M-") 'anything-ipython-complete)
(define-key py-mode-map (kbd "C-c M") 'anything-ipython-import-modules-from-buffer)
(require 'python-mode)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(require 'python-pep8)
(require 'python-pylint)
(require 'lambda-mode)
(add-hook 'python-mode-hook #'lambda-mode 1)
(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)
(autoload 'pylookup-lookup "pylookup")
(autoload 'pylookup-update "pylookup")
(setq pylookup-program "~/.emacs.d/pylookup/pylookup.py")
(setq pylookup-db-file "~/.emacs.d/pylookup/pylookup.db")
(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
#'autopair-python-triple-quote-action))))
(require 'python-pep8)
(require 'python-pylint)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(autoload 'pylookup-lookup "pylookup")
(autoload 'pylookup-update "pylookup")
(setq pylookup-program "~/.emacs.d/pylookup/pylookup.py")
(setq pylookup-db-file "~/.emacs.d/pylookup/pylookup.db")
(global-set-key "\C-ch" 'pylookup-lookup)
;; Initialize Rope
(pymacs-load "ropemacs" "rope-")
(setq ropemacs-enable-autoimport t)
(require 'auto-complete)
(global-auto-complete-mode t)
;(when (require 'auto-complete nil t)
; (require 'auto-complete-yasnippet)
; (require 'auto-complete-python)
; (require 'auto-complete-css)
; (require 'auto-complete-cpp)
; (require 'auto-complete-emacs-lisp)
; (require 'auto-complete-semantic)
; (require 'auto-complete-gtags))
; (global-auto-complete-mode t)
; (setq ac-auto-start 3)
; (setq ac-dwim t)
; (set-default 'ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-words-in-buffer ac-source-files-in-current-dir ac-source-symbols))
; (load-library "init_python")
Any idea where I should start looking for the problem? A simple search or any other way to debug the files in the .emacs-directory?
This looks wrong to me:
kbdexpect a full binding, but you’re trying to bind M-to some functions. I suspect a letter is missing.
i.e.
Here, M stands for
METAwhich is usually bound toALTor
ESC.By the way, you can do XC–h to see
minor mode bindings starting with
X.