Group with-eval-after-load emacs instead of unless noninteractive

This commit is contained in:
Gerard Vermeulen 2022-02-27 16:58:24 +01:00
parent 781427c182
commit 93489d05a9

View File

@ -167,6 +167,8 @@ the ~custom-file~ as [[info:emacs#Saving Customizations][saving customizations (
'(epg-pinentry-mode 'loopback) '(epg-pinentry-mode 'loopback)
'(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-length 500)
'(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)
@ -286,34 +288,36 @@ background.
#+caption: Improve the visibility of faces in =faces.el=. #+caption: Improve the visibility of faces in =faces.el=.
#+name: lst:tweak-faces-faces-after #+name: lst:tweak-faces-faces-after
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun tweak-region-face-background-color () (with-eval-after-load 'emacs
(when (featurep 'gtk) (defun tweak-region-face-background-color ()
(set-face-attribute (when (featurep 'gtk)
'region nil (set-face-attribute
:background (cdr (assoc (face-attribute 'default :background) 'region nil
'(("white" . "LightGoldenrod2") :background (cdr (assoc (face-attribute 'default :background)
("black" . "blue3"))))))) '(("white" . "LightGoldenrod2")
("black" . "blue3")))))))
(tweak-region-face-background-color) (tweak-region-face-background-color))
#+end_src #+end_src
#+caption[Improve the visibility of faces in =org-faces.el=]: #+caption[Improve the visibility of faces in =org-faces.el=]:
#+caption: Improve the visibility of faces in =org-faces.el=. #+caption: Improve the visibility of faces in =org-faces.el=.
#+name: lst:tweak-org-faces-before #+name: lst:tweak-org-faces-before
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; Shadow the definition in org-faces.el: (with-eval-after-load 'emacs
(defface org-block ;; Shadow the definition in org-faces.el:
;; https://emacs.stackexchange.com/questions/9600/ (defface org-block
;; how-can-i-override-a-pre-defined-face-for-light-and-dark-backgrounds ;; https://emacs.stackexchange.com/a/9604 answers:
`((((background dark)) ;; How to override a defined face for light and dark backgrounds?
:inherit (fixed-pitch) `((((background dark))
,@(and (>= emacs-major-version 27) '(:extend t)) :inherit (fixed-pitch)
:background "#444444") ,@(and (>= emacs-major-version 27) '(:extend t))
(t :background "#444444")
:inherit (fixed-pitch) (t
,@(and (>= emacs-major-version 27) '(:extend t)) :inherit (fixed-pitch)
:background "#FFFFD0")) ,@(and (>= emacs-major-version 27) '(:extend t))
"My face used for text inside various blocks. :background "#FFFFD0"))
"My face used for text inside various blocks.
It is always used for source blocks. You can refine what face It is always used for source blocks. You can refine what face
should be used depending on the source block language by setting, should be used depending on the source block language by setting,
@ -321,22 +325,23 @@ background.
When `org-fontify-quote-and-verse-blocks' is not nil, text inside When `org-fontify-quote-and-verse-blocks' is not nil, text inside
verse and quote blocks are fontified using the `org-verse' and verse and quote blocks are fontified using the `org-verse' and
`org-quote' faces, which inherit from `org-block'.") `org-quote' faces, which inherit from `org-block'."))
#+end_src #+end_src
#+caption[Improve the visibility of faces in =sh-script.el=]: #+caption[Improve the visibility of faces in =sh-script.el=]:
#+caption: Improve the visibility of faces in =sh-script.el=. #+caption: Improve the visibility of faces in =sh-script.el=.
#+name: lst:tweak-sh-script-faces-before #+name: lst:tweak-sh-script-faces-before
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; Shadow the definition in sh-script.el: (with-eval-after-load 'emacs
(defface sh-heredoc ;; Shadow the definition in sh-script.el:
'((((class color) (background dark)) (defface sh-heredoc
(:foreground "yellow")) '((((class color) (background dark))
(((class color) (background light)) (:foreground "yellow"))
(:foreground "magenta")) (((class color) (background light))
(t (:foreground "magenta"))
(:weight bold))) (t
"My face to show a here-document.") (:weight bold)))
"My face to show a here-document."))
#+end_src #+end_src
** [[info:emacs#Dired][Dired: directory editor as file manager (info)]] ** [[info:emacs#Dired][Dired: directory editor as file manager (info)]]
@ -559,15 +564,16 @@ users from shooting themselves in the feet. Listing
#+caption: Configure the =disabled-command-function=. #+caption: Configure the =disabled-command-function=.
#+name: lst:configure-disabled-command-function #+name: lst:configure-disabled-command-function
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq disabled-command-function (with-eval-after-load 'emacs
(defun my-enable-this-command (&rest _args) (setq disabled-command-function
"Called when a disabled command is executed. (defun my-enable-this-command (&rest _args)
"Called when a disabled command is executed.
Enable it and re-execute it." Enable it and re-execute it."
(put this-command 'disabled nil) (put this-command 'disabled nil)
(message "You typed %s. %s was disabled until now." (message "You typed %s. %s was disabled until now."
(key-description (this-command-keys)) this-command) (key-description (this-command-keys)) this-command)
(sit-for 0) (sit-for 0)
(call-interactively this-command))) (call-interactively this-command))))
#+end_src #+end_src
* [[info:emacs#Emacs Server][Using Emacs as a server (info)]] * [[info:emacs#Emacs Server][Using Emacs as a server (info)]]
@ -703,23 +709,21 @@ file.
#+caption: Enable =savehist-mode= and =vertico-mode=. #+caption: Enable =savehist-mode= and =vertico-mode=.
#+name: lst:enable-vertico-mode #+name: lst:enable-vertico-mode
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (when (fboundp 'savehist-mode)
(savehist-mode +1)
(custom-set-variables (custom-set-variables
'(history-delete-duplicates t)
'(history-length 500)
'(savehist-additional-variables '(savehist-additional-variables
'(eww-history '(eww-history
kill-ring kill-ring
regexp-search-string regexp-search-string
search-ring search-ring
search-string))) search-string))))
(savehist-mode +1) (when (fboundp 'vertico-mode)
(when (fboundp 'vertico-mode) (vertico-mode +1))
(vertico-mode +1)) (with-eval-after-load 'vertico
(with-eval-after-load 'vertico (define-key vertico-map (kbd "RET") #'vertico-directory-enter)
(define-key vertico-map (kbd "RET") #'vertico-directory-enter) (define-key vertico-map (kbd "DEL") #'vertico-directory-delete-char)
(define-key vertico-map (kbd "DEL") #'vertico-directory-delete-char) (define-key vertico-map (kbd "M-DEL") #'vertico-directory-delete-word))
(define-key vertico-map (kbd "M-DEL") #'vertico-directory-delete-word)))
#+end_src #+end_src
#+attr_latex: :booktabs yes :float table #+attr_latex: :booktabs yes :float table
@ -760,17 +764,16 @@ Listing [[lst:configure-orderless]] enables =orderless=.
#+caption: Configure =orderless=. #+caption: Configure =orderless=.
#+name: lst:configure-orderless #+name: lst:configure-orderless
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (when (fboundp 'orderless-filter)
(when (fboundp 'orderless-filter) (custom-set-variables
(custom-set-variables ;; https://github.com/purcell/emacs.d/issues/778
;; https://github.com/purcell/emacs.d/issues/778 '(completion-styles '(basic completion-partial orderless))
'(completion-styles '(basic completion-partial orderless)) '(completion-category-defaults nil)
'(completion-category-defaults nil) '(completion-category-overrides
'(completion-category-overrides '((file (styles partial-completion)))))
'((file (styles partial-completion))))) (add-hook 'minibuffer-setup-hook
(add-hook 'minibuffer-setup-hook (defun my-on-minibuffer-setup-hook()
(defun my-on-minibuffer-setup-hook() (setq-default completion-styles '(substring orderless)))))
(setq-default completion-styles '(substring orderless))))))
#+end_src #+end_src
** [[info:embark#Top][Embark (info)]] ** [[info:embark#Top][Embark (info)]]
@ -787,12 +790,11 @@ minibuffer help after a prefix key.
#+caption: Configure =embark=. #+caption: Configure =embark=.
#+name: lst:configure-embark #+name: lst:configure-embark
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (when (cl-every #'fboundp '(embark-act embark-bindings embark-dwim))
(when (cl-every #'fboundp '(embark-act embark-bindings embark-dwim)) (global-set-key (kbd "C-,") #'embark-act)
(global-set-key (kbd "C-,") #'embark-act) (global-set-key (kbd "C-:") #'embark-dwim)
(global-set-key (kbd "C-:") #'embark-dwim) (global-set-key (kbd "C-h B") #'embark-bindings)
(global-set-key (kbd "C-h B") #'embark-bindings) (setq prefix-help-command #'embark-prefix-help-command))
(setq prefix-help-command #'embark-prefix-help-command)))
#+end_src #+end_src
** [[info:marginalia#Top][Marginalia (info)]] ** [[info:marginalia#Top][Marginalia (info)]]
@ -806,9 +808,8 @@ Listing [[lst:enable-marginalia-mode]] enables =marginalia-mode=.
#+caption: Enable =marginalia-mode=. #+caption: Enable =marginalia-mode=.
#+name: lst:enable-marginalia-mode #+name: lst:enable-marginalia-mode
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (when (fboundp 'marginalia-mode)
(when (fboundp 'marginalia-mode) (marginalia-mode +1))
(marginalia-mode +1)))
#+end_src #+end_src
** [[info:consult#Top][Consult (info)]] ** [[info:consult#Top][Consult (info)]]
@ -870,41 +871,40 @@ Listing [[lst:configure-consult]] configures =consult=.
#+caption: Configure =consult=. #+caption: Configure =consult=.
#+name: lst:configure-consult #+name: lst:configure-consult
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (when (fboundp 'consult-apropos)
(when (fboundp 'consult-apropos) (custom-set-variables
(custom-set-variables '(consult-project-root-function #'vc-root-dir))
'(consult-project-root-function #'vc-root-dir)) ;; C-c bindings (mode-specific-map)
;; C-c bindings (mode-specific-map) (global-set-key (kbd "C-c h") #'consult-history)
(global-set-key (kbd "C-c h") #'consult-history) (global-set-key (kbd "C-c m") #'consult-mode-command)
(global-set-key (kbd "C-c m") #'consult-mode-command) ;; C-x bindings (ctl-x-map)
;; C-x bindings (ctl-x-map) (define-key ctl-x-map (kbd "M-:") #'consult-complex-command)
(define-key ctl-x-map (kbd "M-:") #'consult-complex-command) (define-key ctl-x-map (kbd "b") #'consult-buffer)
(define-key ctl-x-map (kbd "b") #'consult-buffer) (define-key ctl-x-map (kbd "4 b") #'consult-buffer-other-window)
(define-key ctl-x-map (kbd "4 b") #'consult-buffer-other-window) (define-key ctl-x-map (kbd "5 b") #'consult-buffer-other-frame)
(define-key ctl-x-map (kbd "5 b") #'consult-buffer-other-frame) (define-key ctl-x-map (kbd "r x") #'consult-register)
(define-key ctl-x-map (kbd "r x") #'consult-register) (define-key ctl-x-map (kbd "r b") #'consult-bookmark)
(define-key ctl-x-map (kbd "r b") #'consult-bookmark) ;; M-g bindings (goto-map)
;; M-g bindings (goto-map) (define-key goto-map (kbd "g") #'consult-goto-line)
(define-key goto-map (kbd "g") #'consult-goto-line) (define-key goto-map (kbd "M-g") #'consult-goto-line)
(define-key goto-map (kbd "M-g") #'consult-goto-line) (define-key goto-map (kbd "o") #'consult-outline)
(define-key goto-map (kbd "o") #'consult-outline) (define-key goto-map (kbd "m") #'consult-mark)
(define-key goto-map (kbd "m") #'consult-mark) (define-key goto-map (kbd "k") #'consult-global-mark)
(define-key goto-map (kbd "k") #'consult-global-mark) (define-key goto-map (kbd "i") #'consult-imenu-project)
(define-key goto-map (kbd "i") #'consult-imenu-project) (define-key goto-map (kbd "e") #'consult-compile-error)
(define-key goto-map (kbd "e") #'consult-compile-error) ;; M-s bindings (search-map)
;; M-s bindings (search-map) (define-key search-map (kbd "g") #'consult-git-grep)
(define-key search-map (kbd "g") #'consult-git-grep) (define-key search-map (kbd "f") #'consult-find)
(define-key search-map (kbd "f") #'consult-find) (define-key search-map (kbd "k") #'consult-keep-lines)
(define-key search-map (kbd "k") #'consult-keep-lines) (define-key search-map (kbd "l") #'consult-line)
(define-key search-map (kbd "l") #'consult-line) (define-key search-map (kbd "m") #'consult-multi-occur)
(define-key search-map (kbd "m") #'consult-multi-occur) (define-key search-map (kbd "u") #'consult-focus-lines)
(define-key search-map (kbd "u") #'consult-focus-lines) ;; Other bindings
;; Other bindings (global-set-key (kbd "M-y") #'consult-yank-pop)
(global-set-key (kbd "M-y") #'consult-yank-pop) (global-set-key (kbd "<help> a") #'consult-apropos)
(global-set-key (kbd "<help> a") #'consult-apropos) ;; Tweak functions
;; Tweak functions (advice-add 'completing-read-multiple
(advice-add 'completing-read-multiple :override #'consult-completing-read-multiple))
:override #'consult-completing-read-multiple)))
#+end_src #+end_src
** [[https://company-mode.github.io/][Company: a modular complete anything framework for Emacs]] ** [[https://company-mode.github.io/][Company: a modular complete anything framework for Emacs]]
@ -918,20 +918,19 @@ Listing [[lst:configure-company]] configures =company=.
#+caption: Configure =company=. #+caption: Configure =company=.
#+name: lst:configure-company #+name: lst:configure-company
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (when (fboundp 'company-mode)
(when (fboundp 'company-mode) (custom-set-variables
(custom-set-variables ;; https://github.com/purcell/emacs.d/issues/778
;; https://github.com/purcell/emacs.d/issues/778 '(company-transformers '(company-sort-by-occurrence)))
'(company-transformers '(company-sort-by-occurrence))) (dolist (hook '(LaTeX-mode-hook
(dolist (hook '(LaTeX-mode-hook org-mode-hook
org-mode-hook emacs-lisp-mode-hook
emacs-lisp-mode-hook lisp-interaction-mode-hook
lisp-interaction-mode-hook lisp-mode-hook
lisp-mode-hook python-mode-hook
python-mode-hook ielm-mode-hook
ielm-mode-hook sly-mrepl-mode-hook))
sly-mrepl-mode-hook)) (add-hook hook #'company-mode)))
(add-hook hook #'company-mode))))
#+end_src #+end_src
** [[https://lists.gnu.org/archive/html/emacs-devel/2021-12/msg00802.html][Minibuffer history completion]] ** [[https://lists.gnu.org/archive/html/emacs-devel/2021-12/msg00802.html][Minibuffer history completion]]
@ -947,30 +946,31 @@ previous input in the minibuffer. Listing
#+caption: Enable =minibuffer-history-completion=. #+caption: Enable =minibuffer-history-completion=.
#+name: lst:enable-minibuffer-history-completion #+name: lst:enable-minibuffer-history-completion
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun minibuffer-setup-history-completions () (with-eval-after-load 'emacs
(unless (or minibuffer-completion-table minibuffer-completion-predicate) (defun minibuffer-setup-history-completions ()
(setq-local minibuffer-completion-table (unless (or minibuffer-completion-table minibuffer-completion-predicate)
(symbol-value minibuffer-history-variable)))) (setq-local minibuffer-completion-table
(symbol-value minibuffer-history-variable))))
(add-hook 'minibuffer-setup-hook 'minibuffer-setup-history-completions) (add-hook 'minibuffer-setup-hook 'minibuffer-setup-history-completions)
;; Stolen from Emacs-28.1 for Emacs-27.2: ;; Stolen from Emacs-28.1 for Emacs-27.2:
(unless (fboundp 'minibuffer--completion-prompt-end) (unless (fboundp 'minibuffer--completion-prompt-end)
(defun minibuffer--completion-prompt-end () (defun minibuffer--completion-prompt-end ()
(let ((end (minibuffer-prompt-end))) (let ((end (minibuffer-prompt-end)))
(if (< (point) end) (if (< (point) end)
(user-error "Can't complete in prompt") (user-error "Can't complete in prompt")
end)))) end))))
;; Adapted from minibuffer-complete: ;; Adapted from minibuffer-complete:
(defun minibuffer-complete-history () (defun minibuffer-complete-history ()
"Allow minibuffer completion on previous input." "Allow minibuffer completion on previous input."
(interactive) (interactive)
(completion-in-region (minibuffer--completion-prompt-end) (point-max) (completion-in-region (minibuffer--completion-prompt-end) (point-max)
(symbol-value minibuffer-history-variable) (symbol-value minibuffer-history-variable)
nil)) nil))
(define-key minibuffer-local-map (kbd "C-<tab>") #'minibuffer-complete-history) (define-key minibuffer-local-map (kbd "C-<tab>") #'minibuffer-complete-history))
#+end_src #+end_src
* [[info:emacs#Search][Search and replace (info)]] * [[info:emacs#Search][Search and replace (info)]]
@ -984,8 +984,8 @@ previous input in the minibuffer. Listing
:END: :END:
[[https://github.com/Wilfred/deadgrep#readme][Deadgrep]] uses [[https://github.com/BurntSushi/ripgrep#readme][ripgrep]] for superfast text searching in the default directory or [[https://github.com/Wilfred/deadgrep#readme][Deadgrep]] uses [[https://github.com/BurntSushi/ripgrep#readme][ripgrep]] for superfast text searching in the default directory or
the current [[https://en.wikipedia.org/wiki/Version_control][VCS]] directory tree. Listing [[lst:configure-deadgrep]] binds the the current [[https://en.wikipedia.org/wiki/Version_control][VCS]] directory tree. Listing [[lst:configure-deadgrep]] binds =deadgrep=
=deadgrep= function to {{{kbd(M-s d)}}}. to {{{kbd(M-s d)}}} and =deadgrep-edit-mode= to {{{kbd(C-c C-w)}}}.
#+caption[Configure =deadgrep=]: #+caption[Configure =deadgrep=]:
#+caption: Configure =deadgrep=. #+caption: Configure =deadgrep=.
@ -993,6 +993,8 @@ the current [[https://en.wikipedia.org/wiki/Version_control][VCS]] directory tre
#+begin_src emacs-lisp #+begin_src emacs-lisp
(when (autoload 'deadgrep "deadgrep" nil t) (when (autoload 'deadgrep "deadgrep" nil t)
(define-key search-map (kbd "d") #'deadgrep)) (define-key search-map (kbd "d") #'deadgrep))
(with-eval-after-load 'deadgrep
(define-key deadgrep-mode-map (kbd "C-c C-w") #'deadgrep-edit-mode))
#+end_src #+end_src
* Reading * Reading
@ -1042,17 +1044,17 @@ rebuild the =epdfinfo= executable that serves the [[https://en.wikipedia.org/wik
#+caption: Enable =pdf-tools=. #+caption: Enable =pdf-tools=.
#+name: lst:enable-pdf-tools #+name: lst:enable-pdf-tools
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; `pdf-loader-install' is the lazy equivalent of `pdf-tools-install':
;; see the README file.
(when (fboundp 'pdf-loader-install) (when (fboundp 'pdf-loader-install)
(pdf-loader-install)) ;; `pdf-loader-install' is the lazy equivalent of `pdf-tools-install':
;; see the README file.
(pdf-loader-install)
(with-eval-after-load 'pdf-view (with-eval-after-load 'pdf-view
(custom-set-variables (custom-set-variables
'(pdf-view-display-size 'fit-page)) '(pdf-view-display-size 'fit-page))
(when (fboundp 'pdf-view-restore-mode) (when (fboundp 'pdf-view-restore-mode)
(add-hook 'pdf-view-mode-hook #'pdf-view-restore-mode))) (add-hook 'pdf-view-mode-hook #'pdf-view-restore-mode))))
#+end_src #+end_src
* Writing * Writing
@ -1206,15 +1208,14 @@ advising to override ~TeX-brace-count-line~ with ~my-TeX-brace-count-line~.
#+caption: Activate =Org=. #+caption: Activate =Org=.
#+name: lst:activate-org #+name: lst:activate-org
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; Inspect: (when (cl-every #'fboundp '(org-agenda
;; function with "C-h f" org-capture
;; symbols with "C-h o" org-store-link
;; variables with "C-h v" org-store-link-global))
(global-set-key (kbd "C-c a") #'org-agenda)
(global-set-key (kbd "C-c a") #'org-agenda) (global-set-key (kbd "C-c c") #'org-capture)
(global-set-key (kbd "C-c c") #'org-capture) (global-set-key (kbd "C-c l") #'org-store-link)
(global-set-key (kbd "C-c l") #'org-store-link) (global-set-key (kbd "C-c C-l") #'org-insert-link-global))
(global-set-key (kbd "C-c C-l") #'org-insert-link-global)
#+end_src #+end_src
*** Org customization *** Org customization
@ -1517,8 +1518,10 @@ compatibility with [[https://github.com/jkitchin/org-ref][org-ref]]. Listing [[
from the definition of =docview-org-link= and =doi-org-link= types to define an from the definition of =docview-org-link= and =doi-org-link= types to define an
=pdfview-org-link= type for use with [[https://github.com/vedang/pdf-tools][pdf-tools]]. Finally, listing =pdfview-org-link= type for use with [[https://github.com/vedang/pdf-tools][pdf-tools]]. Finally, listing
[[lst:emacs-lisp-setup-patch-ol-info]] patches the function =org-info-export= and [[lst:emacs-lisp-setup-patch-ol-info]] patches the function =org-info-export= and
the constant ~org-info-other-documents~, to export the =info-org-link= types in listing [[lst:emacs-lisp-setup-buffer-local-ol-info]] sets the constants
this document to =html= and LaTeX correctly. ~org-info-emacs-documents~ and ~org-info-other-documents~ as buffer local
variables in order to export the =info-org-link= types in this document to
=html= and LaTeX correctly.
#+caption[Define =org-link= types for backwards compatibility with =org-ref=]: #+caption[Define =org-link= types for backwards compatibility with =org-ref=]:
#+caption: Define =org-link= types for backwards compatibility with =org-ref=. #+caption: Define =org-link= types for backwards compatibility with =org-ref=.
@ -1632,8 +1635,14 @@ this document to =html= and LaTeX correctly.
(`texinfo (`texinfo
(let ((title (or desc ""))) (let ((title (or desc "")))
(format "@ref{%s,%s,,%s,}" node title manual))) (format "@ref{%s,%s,,%s,}" node title manual)))
(_ nil)))) (_ nil)))))
#+end_src
#+caption[Patch buffer local =ol-info=]:
#+caption: Patch buffer local =ol-info=.
#+name: lst:emacs-lisp-setup-buffer-local-ol-info
#+begin_src emacs-lisp :exports code :silent :tangle no
(with-eval-after-load 'ol-info
(make-variable-buffer-local 'org-info-emacs-documents) (make-variable-buffer-local 'org-info-emacs-documents)
(setq org-info-emacs-documents (delete "org" org-info-emacs-documents)) (setq org-info-emacs-documents (delete "org" org-info-emacs-documents))
(make-variable-buffer-local 'org-info-other-documents) (make-variable-buffer-local 'org-info-other-documents)
@ -1645,10 +1654,8 @@ this document to =html= and LaTeX correctly.
("orderless" . "https://github.com/oantolin/orderless") ("orderless" . "https://github.com/oantolin/orderless")
("sly" . "https://joaotavora.github.io/sly/") ("sly" . "https://joaotavora.github.io/sly/")
("vertico" . "https://github.com/minad/vertico")) ("vertico" . "https://github.com/minad/vertico"))
org-info-other-documents org-info-other-documents :test #'equal)))
:test #'equal)))
#+end_src #+end_src
*** [[https://tecosaur.github.io/emacs-config/#translate-capital-keywords][Translate capital keywords (old) to lower case (new)]] *** [[https://tecosaur.github.io/emacs-config/#translate-capital-keywords][Translate capital keywords (old) to lower case (new)]]
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: sec:convert-upper-to-lower-case-keywords :CUSTOM_ID: sec:convert-upper-to-lower-case-keywords
@ -2087,7 +2094,7 @@ exporting from Org-mode to LaTeX.
#+caption: Define buffer local =-ox-latex= variables. #+caption: Define buffer local =-ox-latex= variables.
#+header: :var title-page=lst/title-page #+header: :var title-page=lst/title-page
#+name: lst:ox-latex-emacs-lisp-setup #+name: lst:ox-latex-emacs-lisp-setup
#+begin_src emacs-lisp :results silent #+begin_src emacs-lisp :results silent :tangle no
(when (require 'ox-latex nil 'noerror) (when (require 'ox-latex nil 'noerror)
;; https://emacs.stackexchange.com/questions/47347/ ;; https://emacs.stackexchange.com/questions/47347/
;; customizing-org-latex-title-command-to-edit-title-page ;; customizing-org-latex-title-command-to-edit-title-page
@ -2879,7 +2886,7 @@ library. It is a requirement of several packages in this Emacs setup ([[https:/
#+caption: Enable =iedit=. #+caption: Enable =iedit=.
#+name: lst:enable-iedit #+name: lst:enable-iedit
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (with-eval-after-load 'emacs
(require 'iedit nil 'noerror)) (require 'iedit nil 'noerror))
#+end_src #+end_src
@ -2892,12 +2899,11 @@ library. It is a requirement of several packages in this Emacs setup ([[https:/
#+caption: Configure =ws-butler=. #+caption: Configure =ws-butler=.
#+name: lst:configure-ws-butler #+name: lst:configure-ws-butler
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (when (require 'ws-butler nil 'noerror)
(when (require 'ws-butler nil 'noerror) (custom-set-variables
(custom-set-variables '(ws-butler-keep-whitespace-before-point nil))
'(ws-butler-keep-whitespace-before-point nil)) (add-hook 'prog-mode-hook #'ws-butler-mode)
(add-hook 'prog-mode-hook #'ws-butler-mode) (add-hook 'text-mode-hook #'ws-butler-mode))
(add-hook 'text-mode-hook #'ws-butler-mode)))
#+end_src #+end_src
** [[https://countvajhula.com/2021/09/25/the-animated-guide-to-symex/][Structural editing]] ** [[https://countvajhula.com/2021/09/25/the-animated-guide-to-symex/][Structural editing]]
@ -2944,7 +2950,7 @@ contrary to for instance [[https://github.com/Fanael/rainbow-delimiters#readme][
#+caption: Configure =smartparens=. #+caption: Configure =smartparens=.
#+name: lst:configure-smartparens #+name: lst:configure-smartparens
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (with-eval-after-load 'emacs
;; To disables pairing of the quote character for lisp modes, ;; To disables pairing of the quote character for lisp modes,
;; require smartparens-config instead of smartparens. ;; require smartparens-config instead of smartparens.
(when (require 'smartparens-config nil 'noerror) (when (require 'smartparens-config nil 'noerror)
@ -3098,7 +3104,7 @@ of the default face on all frames.
#+caption: Configure =face-attributes=. #+caption: Configure =face-attributes=.
#+name: lst:configure-face-attributes #+name: lst:configure-face-attributes
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (with-eval-after-load 'emacs
;; Set face attributes. ;; Set face attributes.
(cond (cond
((eq system-type 'darwin) ((eq system-type 'darwin)
@ -3119,7 +3125,7 @@ of the default face on all frames.
#+caption: Implement =my-set-default-face-height=. #+caption: Implement =my-set-default-face-height=.
#+name: lst:my-set-default-face-height #+name: lst:my-set-default-face-height
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (with-eval-after-load 'emacs
(defun my-set-default-face-height () (defun my-set-default-face-height ()
"Set the default face height in all current and future frames. "Set the default face height in all current and future frames.
@ -3139,7 +3145,7 @@ of the default face on all frames.
#+caption: Implement =my-invert-default-face=. #+caption: Implement =my-invert-default-face=.
#+name: lst:my-invert-default-face #+name: lst:my-invert-default-face
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (with-eval-after-load 'emacs
(defun my-invert-default-face () (defun my-invert-default-face ()
"Invert the default face." "Invert the default face."
(interactive) (interactive)
@ -3182,7 +3188,7 @@ and names in buffers for debugging.
#+caption: Implement =my-pulse-one-line=. #+caption: Implement =my-pulse-one-line=.
#+name: lst:my-pulse-one-line #+name: lst:my-pulse-one-line
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless noninteractive (with-eval-after-load 'emacs
;; https://karthinks.com/software/batteries-included-with-emacs/ ;; https://karthinks.com/software/batteries-included-with-emacs/
;; https://www.reddit.com/r/emacs/comments/jwhr6g/batteries_included_with_emacs/ ;; https://www.reddit.com/r/emacs/comments/jwhr6g/batteries_included_with_emacs/
(defun my-pulse-one-line (&rest _) (defun my-pulse-one-line (&rest _)