[IPython-user] Emacs support: three problems

John J Lee jjl at pobox.com
Mon Dec 13 04:45:38 CST 2004


On Mon, 13 Dec 2004, John J Lee wrote:

> On Mon, 13 Dec 2004, Prabhu Ramachandran wrote:
>
> > >>>>> "JJL" == John J Lee writes:
> >
> >     JJL> Thought I'd give IPython a try for the completion support
> >     JJL> from inside emacs (I see several of you have been working
> >     JJL> hard on this recently: it's appreciated!).  TAB-completion
> >     JJL> works fine in ordinary IPython.  M-x py-version confirms
that
> >     JJL> I have python-mode 4.69.  However:
> >
> >     JJL> 1. C-c ! gives me a standard Python shell, not an IPython
> >     JJL>    shell.
> >
> > Perhaps you haven't added the customary (require 'ipython) in your
> > .emacs/.xemacs/init.el?
>
> Yes, I have that in my .emacs.
>
> Any other ideas?

In case it's enlightening, here's the section of my (rather messy) .emacs
that seems relevant:

...
(defun jjl-wide-fill ()
      (setq fill-column 79)
    )
(add-hook 'python-mode-hook 'jjl-wide-fill)
; key rebindings
(global-set-key "\C-cj" 'revert-buffer)
(global-set-key "\C-cl" 'find-file-literally)
; column no. in status bar
(setq column-number-mode t)
; dired-x
(add-hook 'dired-load-hook
      (function (lambda ()
            (load "dired-x")
            (setq dired-omit-files
                  (concat dired-omit-files "\\|^CVS$\\|^.cvsignore$"))
	    (setq dired-omit-files
                  (concat dired-omit-files "\\|\\.pyc$\\|\\.pyo$|\\.pyw$"))
            (setq dired-omit-files
                  (concat dired-omit-files "\\|\\.o$\\|\\.so\\|\\.a\\|\\.lo\\|\\.la$"))
            )))
(add-hook 'dired-mode-hook 'dired-omit-toggle)
(setq initial-dired-omit-files-p t)
; python-mode
(setq auto-mode-alist
      (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq auto-mode-alist
      (cons '("\\.pyw$" . python-mode) auto-mode-alist))
(setq auto-mode-alist
      (cons '("\\.cgi$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
      (cons '("python" . python-mode)
            interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)

(setq auto-mode-alist
      (cons '("\\.prep$" . python-mode) auto-mode-alist))
(setq auto-mode-alist
      (cons '("\\.rml$" . sgml-mode) auto-mode-alist))
(setq auto-mode-alist
      (cons '("\\.qdf$" . sgml-mode) auto-mode-alist))

;(setq load-path (cons "/dir/of/python-mode/" load-path))

; ipython
;(setq py-shell-switch-buffers-on-execute nil)
(require 'ipython)
;(setq py-python-command-args '("-p" "numeric"))
...


John




More information about the IPython-user mailing list