[TeX] Move function for adding additional symbols to input method to db-utils

This commit is contained in:
Daniel - 2018-11-03 19:11:48 +01:00
parent f213e3d31c
commit abe02fe511
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
2 changed files with 37 additions and 33 deletions

35
init.el
View File

@ -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)

View File

@ -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