diff --git a/study.org b/study.org index 08fdd5810595df34f0f0b5a35e6c414cf7c4b381..c33a7ec3d93b0eead61c1ada970d7a030c11881e 100644 --- a/study.org +++ b/study.org @@ -193,9 +193,96 @@ in the experimental environment of the study, use the command below. #+BEGIN_SRC shell guix time-machine -C channels.scm -- shell --pure -m manifest.scm -- \ - emacs --batch --no-init-file study.org + emacs -q -l study.org #+END_SRC +***** Emacs configuration +:PROPERTIES: +:CUSTOM_ID: emacs-el +:header-args: :tangle emacs.el :eval never +:END: + +For a smoother editing experience in Emacs, we provide here a minimal +configuration file for the Emacs editor, the =emacs.el= file, to use within the +experimental software environment of the study. + +The first part of the configuration is dedicated to the indentation setup, we +want to use 2 spaces instead of TAB to indent for every language. + +#+begin_src elisp +(defun set-indent (n) + (setq-local c-basic-offset n) + (setq-local sh-basic-offset n) + (setq-local coffee-tab-width n) + (setq-local javascript-indent-level n) + (setq-local js-indent-level n) + (setq-local js2-basic-offset n) + (setq-local web-mode-markup-indent-offset n) + (setq-local web-mode-css-indent-offset n) + (setq-local web-mode-code-indent-offset n) + (setq-local css-indent-offset n) + (setq indent-tabs-mode nil)) +(add-hook 'prog-mode-hook (lambda () (set-indent 2))) +(add-hook 'text-mode-hook (lambda () (set-indent 2))) +#+end_src + +We then want to highlight the 80th column an automatically wrap text around the +latter. + +#+begin_src elisp +(require 'fill-column-indicator) +(setq fci-rule-column 80) +(add-hook 'prog-mode-hook 'turn-on-fci-mode) +(add-hook 'text-mode-hook 'turn-on-fci-mode) +(setq-default fill-column 80) +#+end_src + +Follows the Org mode-related setup. After loading the necessary Org packages for +editing templates and bibliography support, + +#+begin_src elisp +(require 'org-tempo) +(require 'org-ref) +#+end_src + +we: + +- do not want to have to confirm every single source code evaluation, + #+begin_src elisp +(setq org-confirm-babel-evaluate nil) + #+end_src +- want to preserve the indentation on export and tangle actions, + #+begin_src elisp +(setq org-src-preserve-indentation t) +(setq org-src-tab-acts-natively t) + #+end_src +- allow syntax highlighting, + #+begin_src elisp +(setq org-src-fontify-natively t) + #+end_src +- load R and shell language support for code evaluation, + #+begin_src elisp +(org-babel-do-load-languages + 'org-babel-load-languages + '((R . t) + (shell . t))) + #+end_src +- do not want to hide brackets around URLs. + #+begin_src elisp +(setq org-descriptive-links nil) + #+end_src + + Finally, we: + + - set the color of the line highlighting the 80th column, + #+begin_src elisp +(setq fci-rule-color "#3C3D37") + #+end_src + - disable the start-up screen. + #+begin_src elisp +(setq inhibit-startup-screen t) + #+end_src + *** Hardware environment :PROPERTIES: :CUSTOM_ID: hwe @@ -305,6 +392,7 @@ Emacs and Texlive packages. "emacs-org" "emacs-org-ref" "emacs-ess" + "emacs-fill-column-indicator" "texlive-scheme-basic" "texlive-hyperref" "texlive-geometry"