Running Python interpreter in Emacs

Sells, Fred fred at adventistcare.org
Mon Jun 27 16:03:35 EDT 2005


It works for me in W2000; I have an ancient .emacs file that someone gave me
that I use on each new system, wheter unix or windows and have never had a
problem.  It usually has to be installed at C:/ to work, unless you
understand emacs better than I.  I've inserted the file ".emacs" below, for
those who have attachment blocking.  I make no guarantees, nor do I
understand it, I just use it:
---------------------------------snip---------------------------------------
---------------
(setq initial-major-mode 'c-mode)
(setq text-mode-hook 'turn-on-auto-fill)
(setq-default indent-tabs-mode nil)
(global-set-key "\C-z" 'narten-suspend-emacs)
(global-set-key "\C-_" 'help-command)
(setq help-char 31)
(define-key global-map "\C-h" 'backward-delete-char-untabify)
(global-set-key "\C-x\C-e" 'compile)
(global-set-key "\C-x1" 'my-delete-other-windows)
(setq manual-program "man")
(setq manual-formatted-dir-prefix (list "/usr/man/cat"
"/usr/local/X11R4/man"))
(setq manual-formatted-dirlist (list
"/usr/man/cat1" "/usr/man/cat2" "/usr/man/cat3" "/usr/man/cat4"
"/usr/man/cat5" "/usr/man/cat6" "/usr/man/cat7" "/usr/man/cat8"
"/usr/man/catl" "/usr/man/catn" "/usr/local/X11R4/man/catn"
"/usr/local/X11R4/man/cat3" ))
(global-set-key "\em" 'manual-entry)
(global-set-key "\eg" 'goto-line)
(global-set-key "\C-xb" 'my-switch-to-buffer)
(global-set-key "\C-m" 'newline-and-indent)
(global-set-key "\C-q" 'electric-buffer-list)
(global-set-key "\C-x\C-b" 'buffer-menu)
(global-set-key "\C-x\C-y" 'cd)
(global-set-key "\es" 'shell)
(global-set-key "\C-xd" 'display-filename)
(global-set-key "\C-i" 'narten-do-a-tab)
(global-set-key "\C-x\C-b" 'buffer-menu)
(global-set-key "\C-_\C-_" 'help-for-help)
(global-set-key "\C-_\C-a" 'apropos)
(global-unset-key "\C-_\C-c")
(global-unset-key "\C-_\C-d")
(global-unset-key "\C-_\C-n")
(global-unset-key "\C-_\C-w")
(defun my-delete-other-windows ()
  (interactive)
  (delete-other-windows)
  (recenter))
(defun narten-suspend-emacs ()
  (interactive)
  (save-all-buffers)
  (suspend-emacs))
(defun narten-do-a-tab ()
  (interactive)
  (cond ((looking-at "^") 
	 (progn (delete-horizontal-space)
		(indent-relative)))
	((looking-at "[ \t]*")
	 (tab-to-tab-stop)))
  (let ((beg (point)))
    (re-search-backward "[^ \t]")
    (tabify (point) beg))
  (re-search-forward "[ \t]+"))
(defun display-filename ()
  (interactive)
  (message buffer-file-name))
(defun save-all-buffers ()
  (interactive)
  (save-some-buffers 1)
  (message "done!"))
(defun my-switch-to-buffer () 
  "switch to buffer, using completion to prevent bogus buffer names from
being given"
  (interactive)
  (switch-to-buffer (read-buffer "Switch to buffer: " (other-buffer) "t")))
;;;
;;; GNUS stuff
;;;
(setq gnus-nntp-server "astro")
(setq gnus-your-domain "sunrise.com")
(setq gnus-your-organization "Sunrise Software International")

(setq display-time-day-and-date t)
(setq display-time-no-load t)
(setq display-newmail-beep t)
(display-time)
;;(setq-default tab-width 4 );;;;;;;;;;;;;;;;fred

(put 'narrow-to-region 'disabled nil)


(put 'narrow-to-page 'disabled nil)

(put 'insert-file 'disabled nil)

(autoload 'python-mode "python-mode" "" t)
(setq auto-mode-alist
      (cons '("\\.py$" . python-mode) auto-mode-alist))
;;(my-delete-other-windows)
;;(electric-buffer-list)

;;(cond (window-system
;;       (setq hilit-mode-enable-list  '(not text-mode)
;;             hilit-background-mode   'light
;;             hilit-inhibit-hooks     nil
;;             hilit-inhibit-rebinding nil)
;;
;;       (require 'hilit19)
;;       ))

;;
;; Hilit stuff
;;
;;(cond (window-system
;;       (setq hilit-mode-enable-list  '(not text-mode)
;;             hilit-background-mode   'light
;;             hilit-inhibit-hooks     nil
;;             hilit-inhibit-rebinding nil)
;;
;;       (require 'hilit19)
;;       ))
;;(require 'paren)

(setq-default transient-mark-mode t)

;;(electric-buffer-menu-mode)
(my-delete-other-windows)
----------------------------------------snip
ends--------------------------------------------------------------




-----Original Message-----
From: Rex Eastbourne [mailto:rex.eastbourne at gmail.com]
Sent: Sunday, June 26, 2005 2:49 PM
To: python-list at python.org
Subject: Re: Running Python interpreter in Emacs


I went to My Computer | Properties | Advanced | Environment Variables
and added c:\program files\python24 to both the PYTHONPATH and Path
variables. Still no luck. I don't know whether the path I'm talking
about is the same as the $PATH you referred to, or whether I'm supposed
to put python.exe explicitly somewhere; could someone refer me to a
place where I can read about these things?

Thanks!

Rex

-- 
http://mail.python.org/mailman/listinfo/python-list

---------------------------------------------------------------------------
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---------------------------------------------------------------------------



More information about the Python-list mailing list