Subject: mailing-list for TeXmacs Users
List archive
From : Nicolas Ratier <address@hidden>- To: address@hidden
- Subject: ChatGPT
- Date: Sat, 7 Jan 2023 19:30:06 +0100
Hi,
I did a little experiment with ChatGPT on TeXmacs.
Me:
Can you write a plugin in guile for TeXmacs that reverses the order of the letters in each word?
ChatGPT:
Yes, I can write a plugin in Scheme for TeXmacs that will reverse the order of the letters in each word of the selected text. Here is the code for the plugin:
(define (reverse-text-plugin)
(let ((selection (tm-get-selection)))
(if (string? selection)
(begin
(tm-begin-undo-sequence)
(tm-replace-string
selection
(string-intersperse
(map (lambda (word) (string-reverse word))
(string-split selection #\Space))
#\Space)
'all)
(tm-end-undo-sequence))
(tm-message "No text is selected."))))
To use this plugin, you will need to copy and paste the code into a Scheme plugin in TeXmacs. Then, you can select some text in your document and run the plugin to reverse the order of the letters in each word.
I hope this helps! Let me know if you have any other questions.
- ChatGPT, Nicolas Ratier, 01/07/2023
Archive powered by MHonArc 2.6.24.