From 4cdf1d8a4685fc83be3a31143e2f2f86088199cd Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Sat, 15 Feb 2025 15:43:28 +0100 Subject: My shavian transliteration --- config/doom/config.org | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'config') diff --git a/config/doom/config.org b/config/doom/config.org index e56dfb4..ad09a93 100644 --- a/config/doom/config.org +++ b/config/doom/config.org @@ -190,18 +190,22 @@ Shamelessly copied from https://tecosaur.github.io/emacs-config/#dictionary (defun on/shavian-transliterate (start end) "Convert text from START to END to Shavian in new buffer." (interactive "r") - (let ((buffer (get-buffer-create "*shavian translit*"))) - (with-current-buffer buffer - (erase-buffer)) - (call-process-region - start end - (expand-file-name ".virtualenvs/shavian/bin/python" "~/") - nil buffer nil - (expand-file-name "dev/readlex/latin2shaw.py" "~/")) - (with-current-buffer buffer - (text-mode) - (display-buffer buffer)))) - + (let ((buffer (get-buffer-create "*shavian translit*")) + (url-request-method "POST") + (url-request-extra-headers + '(("Content-Type" . "application/x-www-form-urlencoded"))) + (url-request-data + (thread-last + (buffer-substring-no-properties start end) + (url-hexify-string ) + (format "text=%s")))) + + (url-retrieve + "http://localhost:4242/shaw" + (lambda (status) + (set-buffer-multibyte t) + ;; (decode-coding-region (point) (point-max) 'utf-8) + (pop-to-buffer (current-buffer)))))) #+end_src * Orgmode #+begin_src emacs-lisp -- cgit v1.2.3