From bcfa2eba72afde8826e1aaa1e808629a0a67c226 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Mon, 6 Mar 2023 13:18:46 +0100 Subject: [PATCH] Clean up the `tempo' setup --- README.org | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/README.org b/README.org index 7d8b5b0..048031b 100644 --- a/README.org +++ b/README.org @@ -2054,6 +2054,7 @@ list detailing and motivating each listing: (gnuplot . ,(fboundp 'gnuplot-mode)) (js . t) (latex . t) + (lilypond . ,(fboundp 'lilypond-mode)) (lisp . t) (lua . ,(fboundp 'lua-mode)) (maxima . ,(fboundp 'maxima-mode)) @@ -2074,18 +2075,7 @@ list detailing and motivating each listing: ol-info org-id org-protocol - org-tempo) - org-structure-template-alist '(("a" . "export ascii") - ("c" . "center") - ("C" . "comment") - ("e" . "example") - ("E" . "export") - ("h" . "export html") - ("l" . "export latex") - ("q" . "quote") - ("s" . "src") - ("p" . "src python -n -i :session") - ("v" . "verse")))) + org-tempo))) #+end_src #+caption[Setup =org-babel=]: @@ -5716,7 +5706,7 @@ Listing [[lst:configure-tempo-latex-completing-read]] shows how to combine =temp #+caption: Configure =tempo= user-interface. #+name: lst:configure-tempo-ui #+begin_src emacs-lisp -n :results silent -(with-eval-after-load 'tempo +(when (require 'tempo nil 'noerror) (setopt tempo-interactive t) (with-eval-after-load 'marginalia @@ -5750,9 +5740,6 @@ Allows `tempo' expansion by typing after a complete `tempo' tag." (unless (abbrev-symbol (car tag) abbrev-table) (define-abbrev abbrev-table (car tag) 1 'abbrev-tempo-expand-if-complete))))) - -(with-eval-after-load 'org - (add-hook 'org-mode-hook 'setup-local-tempo-key-bindings)) #+end_src #+caption[Configure =tempo= for =latex= with =completing-read=]: @@ -5764,12 +5751,11 @@ Allows `tempo' expansion by typing after a complete `tempo' tag." (require 'tempo)) (defun tempo-latex-environment-handler (element) - (when-let ((ok (eq element 'latex-environment)) - (environment - (completing-read "LaTeX environment: " - (LaTeX-environment-list) - #'always 'require-match))) - `(l "\\begin{" ,environment "}" > n > r n "\\end{" ,environment "}" >))) + (when (eq element 'latex-environment) + (let ((environment (completing-read "LaTeX environment: " + (LaTeX-environment-list) + #'always 'require-match))) + `(l "\\begin{" ,environment "}" > n > r n "\\end{" ,environment "}" >)))) (cl-pushnew 'tempo-latex-environment-handler tempo-user-elements)