@ -629,11 +629,13 @@
#+BEGIN_SRC emacs-lisp
(use-package org
:ensure org-plus-contrib
:init
(add-hook 'org-mode-hook 'company/org-mode-hook)
)
(use-package org
:ensure org-plus-contrib
:init
(add-hook 'org-mode-hook 'company/org-mode-hook)
)
(add-hook 'org-mode-hook 'company/org-mode-hook)
#+END_SRC
To avoid problems executing source blocks out of the box. [[https://emacs.stackexchange.com/a/28604 ][Others have the same problem, too ]]. The solution is to remove the .elc files form the package directory:
@ -1157,7 +1159,7 @@ It is only available for emacs 26 and higher.
#+BEGIN_SRC emacs-lisp
(defun company/python-mode-hook()
(message "python-mode-hook activated")
(message "company/ python-mode-hook activated")
(set (make-local-variable 'company-backends)
'((company-ob-ipython company-jedi)))
; '((company-jedi company-dabbrev-code company-yasnippet) company-capf company-files))
@ -1169,7 +1171,7 @@ It is only available for emacs 26 and higher.
I have yet to find the proper hook to call this.
#+BEGIN_SRC emacs-lisp
(defun company/ipython-mode-hook()
(message "python-mode-hook activated")
(message "company/i python-mode-hook activated")
(set (make-local-variable 'company-backends)
'((company-ob-ipython)))
(company-mode t)
@ -1183,12 +1185,13 @@ It is only available for emacs 26 and higher.
Backend for Orgmode
#+BEGIN_SRC emacs-lisp
(defun company/org-mode-hook()
(set (make-local-variable 'company-backends)
'(company-capf company-files))
(add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t)
(company-mode t)
)
(defun company/org-mode-hook()
(set (make-local-variable 'company-backends)
'(company-capf company-files))
(add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t)
(message "company/org-mode-hook")
(company-mode t)
)
#+END_SRC
Backend configuration for lisp-mode
@ -1448,7 +1451,7 @@ END_SRC
(setenv "WORKON_HOME" (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/ "))
:config
(pyvenv-mode t)
(defun my/post-activate-hook()
(defun my/pyvenv-p ost-activate-hook()
(setq jedi:environment-root pyvenv-virtual-env)
(setq jedi:environment-virtualenv pyvenv-virtual-env)
(setq jedi:tooltip-method '(nil)) ;; variants: nil or pos-tip and/or popup
@ -1456,20 +1459,18 @@ END_SRC
;; default traceback, other option M-x jedi:toggle-log-traceback
;; traceback is in jedi:pop-to-epc-buffer
(jedi:setup)
(company/python-mode-hook)
;; (company/python-mode-hook)
(setq jedi:server-args '("--log-traceback"))
(message "post-activate-hook"))
(add-hook 'pyvenv-post-activate-hooks 'my/post-activate-hook)
(message "pyvenv-p ost-activate-hook activated "))
(add-hook 'pyvenv-post-activate-hooks 'my/pyvenv-p ost-activate-hook)
)
#+END_SRC
I want Emacs to automatically start the proper virtual environment.
Required is a .python-version file with, content in the first line being /path/to/virtualenv/
[[https://github.com/marcwebbie/auto-virtualenv ][Github source ]]
Depends on pyvenv
#+BEGIN_SRC emacs-lisp
(use-package auto-virtualenv
:ensure t