:link '(emacs-commentary-link "python"))
\f
;;;###autoload
-(add-to-list 'interpreter-mode-alist '("jython" . jython-mode))
+(add-to-list 'interpreter-mode-alist (cons (purecopy "jython") 'jython-mode))
;;;###autoload
-(add-to-list 'interpreter-mode-alist '("python" . python-mode))
+(add-to-list 'interpreter-mode-alist (cons (purecopy "python") 'python-mode))
;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
-(add-to-list 'same-window-buffer-names "*Python*")
+(add-to-list 'auto-mode-alist (cons (purecopy "\\.py\\'") 'python-mode))
+(add-to-list 'same-window-buffer-names (purecopy "*Python*"))
\f
;;;; Font lock
(with-output-to-temp-buffer (help-buffer)
(with-current-buffer standard-output
;; Fixme: Is this actually useful?
- (help-setup-xref (list 'python-describe-symbol symbol) (interactive-p))
+ (help-setup-xref (list 'python-describe-symbol symbol)
+ (called-interactively-p 'interactive))
(set (make-local-variable 'comint-redirect-subvert-readonly) t)
(help-print-return-message))))
(comint-redirect-send-command-to-process (format "emacs.ehelp(%S, %s)"
(unless file (error "Don't know where `%s' is defined" name))
(pop-to-buffer (find-file-noselect file))
(when (integerp line)
- (goto-line line))))
+ (goto-char (point-min))
+ (forward-line (1- line)))))
\f
;;;; Skeletons
target_buffer (cadr target)
target_fname (buffer-file-name target_buffer))
(switch-to-buffer-other-window target_buffer)
- (goto-line target_lineno)
+ (goto-char (point-min))
+ (forward-line (1- target_lineno))
(message "pdbtrack: line %s, file %s" target_lineno target_fname)
(python-pdbtrack-overlay-arrow t)
(pop-to-buffer origbuf t)
;; Add in number of lines for leading '##' comments:
(setq lineno
(+ lineno
- (save-excursion
- (set-buffer funcbuffer)
+ (with-current-buffer funcbuffer
(if (equal (point-min)(point-max))
0
(count-lines
(while (and buffers (not got))
(setq buf (car buffers)
buffers (cdr buffers))
- (if (and (save-excursion (set-buffer buf)
- (string= major-mode "python-mode"))
+ (if (and (with-current-buffer buf
+ (string= major-mode "python-mode"))
(or (string-match funcname (buffer-name buf))
(string-match (concat "^\\s-*\\(def\\|class\\)\\s-+"
funcname "\\s-*(")
- (save-excursion
- (set-buffer buf)
+ (with-current-buffer buf
(buffer-substring (point-min)
(point-max))))))
(setq got buf)))
;; add some comment, so that we can filter it out of history
(cmd (format "execfile(r'%s') # PYTHON-MODE\n" filename)))
(unwind-protect
- (save-excursion
- (set-buffer procbuf)
+ (with-current-buffer procbuf
(goto-char (point-max))
(move-marker (process-mark proc) (point))
(funcall (process-filter proc) proc msg))
(python-toggle-shells python-default-interpreter))
(let ((args python-which-args))
(when (and argprompt
- (interactive-p)
+ (called-interactively-p 'interactive)
(fboundp 'split-string))
;; TBD: Perhaps force "-i" in the final list?
(setq args (split-string