Compare commits

...

4 Commits

View File

@ -209,6 +209,7 @@ of [[info:emacs#Saving Customizations][saving customizations (info)]].
;; Known problem: EasyPG fails to save files encrypted with GnuPG v2.4.1. ;; Known problem: EasyPG fails to save files encrypted with GnuPG v2.4.1.
;; Darwin: brew install gnupg@2.2 ;; Darwin: brew install gnupg@2.2
epg-pinentry-mode 'loopback epg-pinentry-mode 'loopback
fido-mode t
global-hl-line-mode t global-hl-line-mode t
global-hl-line-sticky-flag t global-hl-line-sticky-flag t
history-delete-duplicates t history-delete-duplicates t
@ -216,7 +217,6 @@ of [[info:emacs#Saving Customizations][saving customizations (info)]].
indent-tabs-mode nil indent-tabs-mode nil
inhibit-startup-buffer-menu t inhibit-startup-buffer-menu t
inhibit-startup-screen t inhibit-startup-screen t
initial-buffer-choice t
initial-scratch-message "" initial-scratch-message ""
isearch-lazy-count t isearch-lazy-count t
kill-ring-max 300 kill-ring-max 300
@ -1520,19 +1520,17 @@ configures =company= after ensuring the =company= installation.
#+caption: Setup =company=. #+caption: Setup =company=.
#+name: lst:setup-company #+name: lst:setup-company
#+begin_src emacs-lisp -n :results silent #+begin_src emacs-lisp -n :results silent
(when (and (ensure-package-installation 'company) (when (ensure-package-installation 'company)
(fboundp 'company-mode))
;; https://github.com/purcell/emacs.d/issues/778 ;; https://github.com/purcell/emacs.d/issues/778
(setopt company-transformers '(company-sort-by-occurrence)) (setopt company-transformers '(company-sort-by-occurrence))
(dolist (symbol '(LaTeX-mode-hook (add-hook 'LaTeX-mode-hook #'company-mode)
org-mode-hook (add-hook 'org-mode-hook #'company-mode)
emacs-lisp-mode-hook (add-hook 'emacs-lisp-mode-hook #'company-mode)
lisp-interaction-mode-hook (add-hook 'lisp-interaction-mode-hook #'company-mode)
lisp-mode-hook (add-hook 'lisp-mode-hook #'company-mode)
python-mode-hook (add-hook 'python-mode-hook #'company-mode)
ielm-mode-hook (add-hook 'ielm-mode-hook #'company-mode)
sly-mrepl-mode-hook)) (add-hook 'sly-mrepl-mode-hook #'company-mode))
(add-hook symbol #'company-mode)))
#+end_src #+end_src
* [[info:emacs#Search][Search and replace (info)]] * [[info:emacs#Search][Search and replace (info)]]
@ -1705,7 +1703,7 @@ regexp strings.
#+caption: Ensure =xr= installation. #+caption: Ensure =xr= installation.
#+name: lst:ensure-xr-installation #+name: lst:ensure-xr-installation
#+begin_src emacs-lisp -n :results silent #+begin_src emacs-lisp -n :results silent
(when (ensure-package-installation 'xr) t) (ensure-package-installation 'xr)
#+end_src #+end_src
* [[info:emacs#Version Control][Version Control (info)]] * [[info:emacs#Version Control][Version Control (info)]]
@ -1857,8 +1855,7 @@ Listing [[lst:configure-nov]] configures [[https://depp.brause.cc/nov.el/][nov.e
#+caption: Configure =nov=. #+caption: Configure =nov=.
#+name: lst:configure-nov #+name: lst:configure-nov
#+begin_src emacs-lisp -n :results silent #+begin_src emacs-lisp -n :results silent
(when (and (ensure-package-installation 'nov) (when (ensure-package-installation 'nov)
(fboundp 'nov-mode))
(add-to-list 'auto-mode-alist `(,(rx ".epub" eos) . nov-mode))) (add-to-list 'auto-mode-alist `(,(rx ".epub" eos) . nov-mode)))
#+end_src #+end_src
@ -1881,8 +1878,7 @@ file.
#+caption: Setup =pdf-tools=. #+caption: Setup =pdf-tools=.
#+name: lst:setup-pdf-tools #+name: lst:setup-pdf-tools
#+begin_src emacs-lisp -n :results silent #+begin_src emacs-lisp -n :results silent
(when (and (ensure-package-installation 'pdf-tools) (when (ensure-package-installation 'pdf-tools)
(fboundp 'pdf-loader-install))
;; Use `pdf-loader-install' for faster startup than with `pdf-tools-install'. ;; Use `pdf-loader-install' for faster startup than with `pdf-tools-install'.
(pdf-loader-install) (pdf-loader-install)
@ -2149,9 +2145,7 @@ list detailing and motivating each listing:
"\\documentclass[preview]{standalone}\n"))) "\\documentclass[preview]{standalone}\n")))
(with-eval-after-load 'ob-lisp (with-eval-after-load 'ob-lisp
;; Default to `sly-eval' whenever feasible: (when (package-installed-p 'sly)
(when (and (package-installed-p 'sly)
(fboundp 'sly-eval))
(setopt org-babel-lisp-eval-fn #'sly-eval))) (setopt org-babel-lisp-eval-fn #'sly-eval)))
#+end_src #+end_src
@ -3889,9 +3883,7 @@ it for this buffer is by typing {{{kbd(C-c C-e t U)}}} to export the it to a
#+caption: Configure =writegood-mode=. #+caption: Configure =writegood-mode=.
#+name: lst:configure-writegood-mode #+name: lst:configure-writegood-mode
#+begin_src emacs-lisp -n :results silent #+begin_src emacs-lisp -n :results silent
(when (and (ensure-package-installation 'writegood-mode) (when (ensure-package-installation 'writegood-mode)
(fboundp 'writegood-mode))
(add-hook 'after-init-hook (add-hook 'after-init-hook
(defun on-after-change-mode-hook-enable-writegood-mode () (defun on-after-change-mode-hook-enable-writegood-mode ()
(add-hook 'after-change-major-mode-hook (add-hook 'after-change-major-mode-hook
@ -3921,15 +3913,7 @@ true in case document headlines contain links. The code in listing
#+name: lst:setup-which-function-mode #+name: lst:setup-which-function-mode
#+begin_src emacs-lisp -n :results silent #+begin_src emacs-lisp -n :results silent
(with-eval-after-load 'which-func (with-eval-after-load 'which-func
(setopt which-func-modes (setopt which-func-modes '(emacs-lisp-mode org-mode pdf-view-mode)))
'(emacs-lisp-mode org-mode pdf-view-mode)))
;; It looks like `python-mode' does nothing when it is an element of
;; `which-func-modes'.
;; (setopt which-func-modes t)
;; (setopt which-func-display 'header) ;; AFAIU, fails on my system.
#+end_src #+end_src
#+caption[Define functions for ~which-func-functions~]: #+caption[Define functions for ~which-func-functions~]:
@ -4114,79 +4098,6 @@ Call `widen' after an `user-error'."
(widen)))) (widen))))
#+end_src #+end_src
#+caption: Real sessions for ~eval-buffer~ in ~org-src~ buffers.
#+begin_src org -n :tangle eval-buffer-in-org-src-buffers.org
,#+title: Sessions for ~eval-buffer~ in ~org-src~ buffers
,#+property: :tangle none
,* Real sessions in ~org-src-mode~ buffers
,#+header: :wrap "src text"
,#+begin_src python :results output :session
print("Hello *Python*!")
,#+end_src
,#+RESULTS:
,#+begin_src text
Hello *Python*!
,#+end_src
,#+header: :wrap "src text"
,#+begin_src python :results output :session Python
print("Hello *Python*!")
,#+end_src
,#+RESULTS:
,#+begin_src text
Hello *Python*!
,#+end_src
,#+header: :wrap "src text"
,#+begin_src python :results output :session snake
print("Hello *snake*!")
,#+end_src
,#+RESULTS:
,#+begin_src text
Hello *snake*!
,#+end_src
#+end_src
#+caption: Fake sessions for ~eval-buffer~ in ~org-src~ buffers.
#+begin_src org -n :tangle eval-buffer-in-org-src-buffers.org
,* Fake sessions in ~org-src-mode~ buffers
,#+header: :wrap "src text"
,#+begin_src python :results output :session none
print("Hello *none*!")
,#+end_src
,#+RESULTS:
,#+begin_src text
Hello *none*!
,#+end_src
,#+header: :wrap "src text"
,#+begin_src python :results output :session :default
print("Hello *Python* with `:default' unseen!")
,#+end_src
,#+RESULTS:
,#+begin_src text
Hello *Python* with `:default' unseen!
,#+end_src
,#+header: :wrap "src text"
,#+begin_src python :results output :session ":default"
print("Hello *Python* with `*:default*' seen!")
,#+end_src
,#+RESULTS:
,#+begin_src text
Hello *Python* with `*:default*' seen!
,#+end_src
#+end_src
** [[https://github.com/lassik/emacs-format-all-the-code#readme][Format-all]] ** [[https://github.com/lassik/emacs-format-all-the-code#readme][Format-all]]
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: sec:format-all :CUSTOM_ID: sec:format-all