From c4db065b93ff6eda371054bccc93ed485f90dde7 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 30 May 2023 13:37:01 +0800 Subject: TeX: add a hiero-processing function * tex-conf.el (durand-tex-hiero): Send the region to the executable that translates it to the LaTeX commands that produce the corresponding hieroglyphs. This makes it convenient to obtain the correct LaTeX codes to use. --- tex-conf.el | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tex-conf.el b/tex-conf.el index 89065ea..5245c21 100644 --- a/tex-conf.el +++ b/tex-conf.el @@ -320,7 +320,7 @@ The list is in the variable `durand-o-things-list'" (t (user-error "Weird associated: %S" associated)))))) -;; Automatic braces +;;; Automatic braces (setq TeX-electric-sub-and-superscript t) @@ -329,5 +329,24 @@ The list is in the variable `durand-o-things-list'" ;; (setq-default TeX-master nil) +;;; hieroglyphs + +(defun durand-tex-hiero () + "Translate the hieroglyph code in the region to proper latex + code." + (interactive) + (let ((text (cond ((use-region-p) + (buffer-substring-no-properties + (region-beginning) + (region-end))) + ((buffer-substring-no-properties + (point-min) (point-max))))) + (temp-buffer (get-buffer-create "*temp*"))) + (call-process-region + text nil "sesh" nil temp-buffer) + (with-current-buffer temp-buffer + (kill-new (buffer-string))) + (kill-buffer temp-buffer))) + (provide 'tex-conf) ;;; tex-conf.el ends here -- cgit v1.2.3-18-g5258