Windows Emacs запускает программу Python в текущем буфере и отображает вывод в окне вывода - PullRequest
3 голосов
/ 09 января 2010

Я использую режим Python (не по умолчанию поставляется с Emacs 23).

Я не смог выполнить программу на Python, загруженную в данный момент в emacs.

Я получаю сообщение об ошибке "Определение функции символа недействительно: режим интеллектуального оператора включен".

Любая подсказка или любые подсказки делают программу на Python, и она может быть запущена в emacs и отображать окно вывода результатов?

Здесь отчет об ошибке emacs .

Debugger entered--Lisp error: (void-function smart-operator-mode-on)
     (smart-operator-mode-on)
     (lambda nil (set-variable (quote py-indent-offset) 4) 
      (set-variable (quote indent-tabs-mode) nil) (define-key py-mode-map (kbd "RET")  (quote newline-and-indent)) (smart-operator-mode-on))()
      run-hooks(python-mode-hook)
     (if python-mode-hook (run-hooks (quote python-mode-hook)) (run-hooks (quote py-mode-hook)))   python-mode()

Мой скрипт init_python.el

 (autoload 'python-mode "python-mode" "Python Mode." t)
 (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
 (add-to-list 'interpreter-mode-alist '("python" . python-mode))

  (require 'python-mode)
  (add-hook 'python-mode-hook
    (lambda ()
(set-variable 'py-indent-offset 4)
;(set-variable 'py-smart-indentation nil)
(set-variable 'indent-tabs-mode nil)
(define-key py-mode-map (kbd "RET") 'newline-and-indent)
;(define-key py-mode-map [tab] 'yas/expand)
;(setq yas/after-exit-snippet-hook 'indent-according-to-mode)
(smart-operator-mode-on)
))

Ответы [ 2 ]

0 голосов
/ 21 сентября 2011

Я исправил эту ошибку, загрузив файл smart-operator.el в путь загрузки и добавив require 'smart-operator' перед вызовом smart-operator-mode-on.

0 голосов
/ 09 января 2010

Работает после выключения (smart-operator-mode-on) Мне нужно посмотреть, как решить smart-operator-mode-on

(setq debug-on-error t) помогает мне определить ошибку. Спасибо, Нуфал.

...