diff --git a/README.org b/README.org index f267de7..7627a9b 100644 --- a/README.org +++ b/README.org @@ -33,6 +33,7 @@ :END: Backup your =~/.emacs.d= directory to execute the following commands: +#+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src shell :noeval :tangle no cd ~ git clone ccdr@mercury.grenoble.cnrs.fr:SERVER/.emacs.d @@ -111,6 +112,9 @@ Here follows a list of interesting Emacs configurations: :CUSTOM_ID: sec:early-init-file :END: +Try to load [[https://github.com/emacscollective/no-littering][no-littering]] as early as possible, since it helps to keep +=~/.emacs.d= clean. + #+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp :tangle early-init.el ;;; early-init.el --- user early-init file -*- lexical-binding: t -*- @@ -243,15 +247,13 @@ not load the ~custom-file~ as [[info:emacs#Saving Customizations][saving customi archives: 1. The [[https://elpa.gnu.org/][GNU Emacs Lisp Package Archive]] 2. The [[https://elpa.nongnu.org/][NonGNU Emacs Lisp Package Archive]]. -3. The [[https://melpa.org/#/][MELPA - Milkypostman’s Emacs Lisp Package Archive]]. +3. The [[https://melpa.org/#/][Milkypostman’s Emacs Lisp Package Archive (MELPA)]]. Finally, the [[https://github.com/quelpa/quelpa][quelpa]] tool allows to fetch code from any source and build a package on your computer before installation. The order of the next two package-bootstrapping blocks matters because first block prepares Emacs for the second block. -If present, the package [[https://github.com/emacscollective/no-littering][no-littering]] helps to keep =~/.emacs.d= clean. - The code assumes that the package system is in a *virgin* state in case the package [[https://github.com/emacscollective/no-littering][no-littering]] is not present. Refreshing the contents of available packages at least once is a requirement in order to be able to install and load @@ -260,9 +262,9 @@ any packages, hence also [[https://github.com/emacscollective/no-littering][no-l You have to refresh the list of available packages yourself before updating the installed packages. -The call src_emacs-lisp[:exports_code]{(package-install-selected-packages)} +The call src_emacs-lisp[:exports code]{(package-install-selected-packages)} checks the installation status of all packages in -src_emacs-lisp[:exports_code]{package-selected-packages} and installs the +src_emacs-lisp[:exports code]{package-selected-packages} and installs the missing packages after the user has agreed to its prompt. Finally, ~my-install-packages~ facilitates installation of all packages in a @@ -287,7 +289,7 @@ list of packages. #+end_src The next source code block facilitates installlation of the optional package, -The user can run src_emacs-lisp[:exports_code]{(my-install-optional-packages)} +The user can run src_emacs-lisp[:exports code]{(my-install-optional-packages)} to install all optional packages, or he can install each package one by one. #+attr_latex: :options bgcolor=LightGoldenrodYellow @@ -446,6 +448,7 @@ niche than the five packages above. :CUSTOM_ID: sec:orderless-configuration :END: +#+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp (unless noninteractive (when (fboundp 'orderless-filter) @@ -569,8 +572,8 @@ annotate [[https://en.wikipedia.org/wiki/PDF][PDF]] files. It also exploits the files produced with LaTeX to the original LaTeX sources. In order to use [[https://github.com/vedang/pdf-tools][pdf-tools]], you have to type =M-x pdf-tools-install= after -installation of [[https://github.com/vedang/pdf-tools][pdf-tools]] from [[https://melpa.org/][MELPA]] or after each update of [[https://github.com/freedesktop/poppler][poppler]] to build -or rebuild the =epdfinfo= executable that serves the [[https://en.wikipedia.org/wiki/PDF][PDF]] files to Emacs. +installation of [[https://github.com/vedang/pdf-tools][pdf-tools]] from [[https://melpa.org/][MELPA]] or after each update of [[https://github.com/freedesktop/poppler][poppler]] to build or +rebuild the =epdfinfo= executable that serves the [[https://en.wikipedia.org/wiki/PDF][PDF]] files to Emacs. #+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp @@ -717,6 +720,7 @@ below corrects this by advising to override ~TeX-brace-count-line~ with :CUSTOM_ID: sec:export-external-links :END: +#+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp (with-eval-after-load 'ol (org-link-set-parameters @@ -747,7 +751,7 @@ below corrects this by advising to override ~TeX-brace-count-line~ with "ref" :export (lambda (path _desc backend _info) (pcase backend (`latex - (format "\\ref{%s}" path)) + (format "\\ref{% s}" path)) (_ path))))) #+end_src @@ -757,6 +761,7 @@ modify the constant ~org-info-other-documents~ defined in =ol-info.el=. Note: how to make it work without tangling? +#+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp (add-hook 'org-mode-hook @@ -853,6 +858,7 @@ Stolen from [[https://git.sr.ht/~bzg/org-contrib/tree/master/item/lisp/ox-extra. #+end_src #+name: emacs-lisp-setup +#+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp :tangle no (with-eval-after-load 'ox (my-activate-buffer-local-org-export-filters)) @@ -974,6 +980,7 @@ option to run different commands on those selections. Execute src_emacs-lisp[:exports code]{(find-library "novice")} to see how Emacs prevents new users from shooting themselves in the feet. +#+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp (setq disabled-command-function (defun my-enable-this-command (&rest _args) @@ -994,6 +1001,7 @@ Emacs prevents new users from shooting themselves in the feet. [[https://endlessparentheses.com/emacs-narrow-or-widen-dwim.html][Emacs narrow-or-widen-dwim]] +#+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp (defun narrow-or-widen-dwim (p) "Widen if buffer is narrowed, narrow-dwim otherwise. @@ -1101,6 +1109,7 @@ Emacs prevents new users from shooting themselves in the feet. * Coding +#+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp (with-eval-after-load 'eglot (add-to-list 'eglot-server-programs '(python-mode "pylsp")) @@ -1124,8 +1133,10 @@ built-in ~python-mode~. Here, the focus is on two packages: shows. The snippet below initializes [[https://github.com/pythonic-emacs/anaconda-mode][anaconda]]. See [[https://github.com/jorgenschaefer/elpy/blob/8d0de310d41ebf06b22321a8534546447456870c/elpy.el#L2775][elpy-module-company]] for how to -handle ~company-backends~ as a local variable and the call to ~advice~ opens +handle ~company-backends~ as a local variable and the call to [[info:elisp#Advising Functions][advice-add]] opens Python org-mode edit-buffers in ~anaconda-mode~. + +#+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp (with-eval-after-load 'python @@ -1242,6 +1253,7 @@ The next source code blocks implement those rules. In case of proper initialization of all face heigths, font scaling is easy as the next source code block shows. +#+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp (defun my-set-default-face-height () "Set the default face height in all current and future frames.