Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work in terminal #19

Open
quidnu opened this issue Nov 12, 2022 · 1 comment
Open

Doesn't work in terminal #19

quidnu opened this issue Nov 12, 2022 · 1 comment

Comments

@quidnu
Copy link

quidnu commented Nov 12, 2022

The code seems to only insert images and not plaintext if an image is returned by Wolfram alpha and because images don't work when in the terminal nothing is shown in that case.

Images should not be inserted when in the terminal.
Plaintext should probably always be inserted (or at least have a setting).

(defun wolfram--append-subpod (subpod)
  "Appends a subpod to the current buffer."
  (let ((plaintext (car (xml-get-children subpod 'plaintext)))
        (image (car (xml-get-children subpod 'img))))
    (if (and image window-system)
        (wolfram--insert-image-from-url (xml-get-attribute image 'src)))
    (insert (format "%s\n" (car (last plaintext))))
    (insert "\n")))

I don't understand what wolfram--insert-image does (vs. Wolfram--insert-image-from-url)

@hsjunnesson
Copy link
Owner

I wrote wolfram.el twelves years ago, and it was part a project to help me get more into Emacs. Partly as a fun toy.
I can't remember what half of this stuff does, but at a glance, the API request seem to ask for both images and plaintext, so it should be fairly simple to detect whether to display images or text response. Happy to receive a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants