From abe02fe5114802b7ae933187b3d791b1c791409a Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 3 Nov 2018 19:11:48 +0100 Subject: [PATCH] [TeX] Move function for adding additional symbols to input method to db-utils --- init.el | 35 ++--------------------------------- site-lisp/db-utils.el | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/init.el b/init.el index e97f76e..b3c3c4e 100644 --- a/init.el +++ b/init.el @@ -506,38 +506,6 @@ :config (add-hook 'input-method-activate-hook #'db/add-symbols-to-TeX-input-method)) -(defun db/add-symbols-to-TeX-input-method () - "Add some new symbols to TeX input method." - (when (string= current-input-method "TeX") - (let ((quail-current-package (assoc "TeX" quail-package-alist))) - (quail-define-rules - ((append . t)) - ("\\land" ?∧) - ("\\lor" ?∨) - ("\\lnot" ?¬) - ("\\implies" ?⇒) - ("\\powerset" ?𝔓) - ("\\mathbbK" ?𝕂) - ("\\mathbbR" ?ℝ) - ("\\mathbbN" ?ℕ) - ("\\mathbbZ" ?ℤ) - ("\\mathbbP" ?ℙ) - ("\\mathcalA" ?𝒜) - ("\\mathcalB" ?ℬ) - ("\\mathcalC" ?𝒞) - ("\\mathcalD" ?𝒟) - ("\\mathcalE" ?ℰ) - ("\\mathcalH" ?ℋ) - ("\\mathcalI" ?ℐ) - ("\\mathcalJ" ?𝒥) - ("\\mathcalK" ?𝒦) - ("\\mathcalL" ?ℒ) - ("\\mathcalM" ?ℳ) - ("\\mathcalR" ?ℛ) - ("\\mathcalQ" ?𝒬) - ("\\mathcalS" ?𝒮) - ("\\mathfrakP" ?𝔓))))) - (use-package server :commands (server-running-p server-start)) @@ -587,7 +555,8 @@ _h_ _l_ _o_k _y_ank db/hex-to-ascii db/ascii-to-hex conditionally-enable-lispy - db/export-diary)) + db/export-diary + db/add-symbols-to-TeX-input-method)) (use-package db-emacsclient) diff --git a/site-lisp/db-utils.el b/site-lisp/db-utils.el index 23bc515..95955cb 100644 --- a/site-lisp/db-utils.el +++ b/site-lisp/db-utils.el @@ -366,6 +366,41 @@ This is done only if the value of this variable is not null." (org-icalendar-combine-agenda-files) (message "Exporting diary ... done."))))))) + +;;; Extend Input Methods + +(defun db/add-symbols-to-TeX-input-method () + "Add some new symbols to TeX input method." + (when (string= current-input-method "TeX") + (let ((quail-current-package (assoc "TeX" quail-package-alist))) + (quail-define-rules + ((append . t)) + ("\\land" ?∧) + ("\\lor" ?∨) + ("\\lnot" ?¬) + ("\\implies" ?⇒) + ("\\powerset" ?𝔓) + ("\\mathbbK" ?𝕂) + ("\\mathbbR" ?ℝ) + ("\\mathbbN" ?ℕ) + ("\\mathbbZ" ?ℤ) + ("\\mathbbP" ?ℙ) + ("\\mathcalA" ?𝒜) + ("\\mathcalB" ?ℬ) + ("\\mathcalC" ?𝒞) + ("\\mathcalD" ?𝒟) + ("\\mathcalE" ?ℰ) + ("\\mathcalH" ?ℋ) + ("\\mathcalI" ?ℐ) + ("\\mathcalJ" ?𝒥) + ("\\mathcalK" ?𝒦) + ("\\mathcalL" ?ℒ) + ("\\mathcalM" ?ℳ) + ("\\mathcalR" ?ℛ) + ("\\mathcalQ" ?𝒬) + ("\\mathcalS" ?𝒮) + ("\\mathfrakP" ?𝔓))))) + ;;; End