• 0 Posts
  • 5 Comments
Joined 11 months ago
cake
Cake day: October 17th, 2023

help-circle

  • It was for me.

    After reading Paul Graham wax lyrical about lisp ( see essay Beating the Averages), I wanted to learn a lisp. Emacs is the most practical lisp in the sense that even a small amount of it can do something immediately useful (for emacs), and I wasn’t going to replace R / Python / Fortran with Common Lisp or Scheme for my scientific computing needs.

    Not sure it expanded my mind like I had expected in the end. Apart from the homoiconicity and macros, most major ideas introduced by lisp has made its way into other mainstream languages.

    But it’s a beautiful language and at least I know now that I’m not missing out on something huge, and that gives me piece of mind (maybe macros are huge and I’m toying with them in Julia at the moment).



  • I have something like this

    ;; ----- language server
    
    (require 'eglot)
    (add-hook 'python-mode-hook #'eglot-ensure)
    (add-to-list 'eglot-server-programs
    	     `(python-mode
    	       . ,(eglot-alternatives '("pylsp"
    					"jedi-language-server"
    					("pyright-langserver" "--stdio")))))
    
    ;; ----- treesitter
    
    (use-package treesit-auto :ensure t)
    ;; treesit grammar should be installed here: "~/.emacs.d/tree-sitter/"
    
    ;; ----- select interpreter
    
    (setopt python-shell-interpreter ("~/miniconda3/bin/python"))
    (setopt python-shell-interpreter-args "-i")
    
    ;; ----- conda
    
    (use-package conda
      :ensure t
      :custom
      (conda-anaconda-home "~/miniconda3")
      (conda-env-home-directory "~/miniconda3")
      (conda-env-subdirectory "envs")
      :config
      (unless (getenv "CONDA_DEFAULT_ENV")
        (conda-env-activate "base"))))
    
    ;; ----- emacs-jupyter
    
    (use-package jupyter
      :commands
      (jupyter-run-server-repl
       jupyter-run-repl
       jupyter-server-list-kernels))
    (org-babel-jupyter-override-src-block "python") ;; so python becomes jupyter-python in org-babel
    
    ;; ----- other settings
    
    (setopt python-indent-guess-indent-offset-verbose nil)